Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Move file selection to browser component
Alexis Sellier committed 4 years ago
commit e7f15acd97586769d25b2cc9a98577d694e6447c
parent 8f5d8a6841eeabcb14372420d43f34913c73f58c
2 files changed +8 -7
modified src/base/projects/Browser.svelte
@@ -1,4 +1,5 @@
<script lang="typescript">
+
  import { navigate } from 'svelte-routing';
  import type { Config } from '@app/config';
  import * as proj from '@app/project';
  import Loading from '@app/Loading.svelte';
@@ -14,8 +15,11 @@
  export let commit: string;
  export let config: Config;
  export let path: string;
-
  export let onSelect: (event: { detail: string }) => void;
-
  export let org: string | null = null;
+
  export let org = "";
+

+
  const onSelect = ({ detail: path }: { detail: string }) => {
+
    navigate(proj.path({ urn, org, commit, path }));
+
  };

  const fetchTree = async (path: string) => {
    return proj.getTree(urn, commit, path, config);
modified src/base/projects/View.svelte
@@ -1,5 +1,5 @@
<script lang="typescript">
-
  import { Link, navigate } from 'svelte-routing';
+
  import { Link } from 'svelte-routing';
  import type { Config } from '@app/config';
  import * as proj from '@app/project';
  import Loading from '@app/Loading.svelte';
@@ -17,9 +17,6 @@
  let getProject = proj.getInfo(urn, config);
  let projectRoot = proj.path({ urn, org, commit });

-
  const onSelect = ({ detail: path }: { detail: string }) => {
-
    navigate(proj.path({ urn, org, commit, path }));
-
  };
  const back = () => window.history.back();
</script>

@@ -73,7 +70,7 @@
      <div class="urn">{urn}</div>
      <div class="description">{project.meta.description}</div>
    </header>
-
    <Browser {urn} {org} commit={commit || project.head} {path} {onSelect} {config} />
+
    <Browser {urn} {org} commit={commit || project.head} {path} {config} />
  {:catch}
    <Modal subtle>
      <span slot="title">🏜️</span>