Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Move ProjectContentRoutes into View
Sebastian Martinez committed 4 years ago
commit 935044ac4c3ebbcc5a1299f8d87fc802e0675b42
parent 56bc7bd180062789d27701e085b0c9aacca51ed1
2 files changed +28 -40
deleted src/base/projects/ProjectContentRoutes.svelte
@@ -1,38 +0,0 @@
-
<script lang="ts">
-
  import { Route, Router } from "svelte-routing";
-
  import type * as proj from "@app/project";
-
  import type { Config } from "@app/config";
-
  import { ProjectContent } from "@app/project";
-
  import ProjectRoute from "./ProjectRoute.svelte";
-

-
  export let config: Config;
-
  export let source: proj.Source;
-
  export let peer: string | null;
-
</script>
-

-
<Router>
-
  <!-- The default action is to render Browser with the default branch head -->
-
  <Route path="/">
-
    <ProjectRoute content={ProjectContent.Tree} {peer} {source} {config} />
-
  </Route>
-
  <Route path="/tree">
-
    <ProjectRoute content={ProjectContent.Tree} {peer} {source} {config} />
-
  </Route>
-
  <Route path="/tree/*" let:params>
-
    <ProjectRoute route={params["*"]} content={ProjectContent.Tree} {peer} {source} {config} />
-
  </Route>
-

-
  <Route path="/history">
-
    <ProjectRoute content={ProjectContent.History} {peer} {source} {config} />
-
  </Route>
-
  <Route path="/history/*" let:params>
-
    <ProjectRoute route={params["*"]} content={ProjectContent.History} {peer} {source} {config} />
-
  </Route>
-

-
  <Route path="/commits/:commit" let:params>
-
    <ProjectRoute revision={params.commit} content={ProjectContent.Commit} {peer} {source} {config} />
-
  </Route>
-
  <Route path="/commits/*" let:params>
-
    <ProjectRoute route={params["*"]} content={ProjectContent.Commit} {peer} {source} {config} />
-
  </Route>
-
</Router>
modified src/base/projects/View.svelte
@@ -1,5 +1,6 @@
<script lang="ts">
  import type { Config } from '@app/config';
+
  import { Route, Router } from "svelte-routing";
  import * as proj from '@app/project';
  import Loading from '@app/Loading.svelte';
  import { Profile, ProfileType } from '@app/profile';
@@ -7,7 +8,7 @@
  import { Seed } from '@app/base/seeds/Seed';
  import NotFound from '@app/NotFound.svelte';

-
  import ProjectContentRoutes from './ProjectContentRoutes.svelte';
+
  import ProjectRoute from "./ProjectRoute.svelte";

  export let id: string; // Project name or URN.
  export let seedHost: string | null = null;
@@ -76,7 +77,32 @@
      <Loading center />
    </header>
  {:then source}
-
    <ProjectContentRoutes {source} {peer} {config} />
+
    <Router>
+
      <!-- The default action is to render Browser with the default branch head -->
+
      <Route path="/">
+
        <ProjectRoute content={proj.ProjectContent.Tree} {peer} {source} {config} />
+
      </Route>
+
      <Route path="/tree">
+
        <ProjectRoute content={proj.ProjectContent.Tree} {peer} {source} {config} />
+
      </Route>
+
      <Route path="/tree/*" let:params>
+
        <ProjectRoute route={params["*"]} content={proj.ProjectContent.Tree} {peer} {source} {config} />
+
      </Route>
+

+
      <Route path="/history">
+
        <ProjectRoute content={proj.ProjectContent.History} {peer} {source} {config} />
+
      </Route>
+
      <Route path="/history/*" let:params>
+
        <ProjectRoute route={params["*"]} content={proj.ProjectContent.History} {peer} {source} {config} />
+
      </Route>
+

+
      <Route path="/commits/:commit" let:params>
+
        <ProjectRoute revision={params.commit} content={proj.ProjectContent.Commit} {peer} {source} {config} />
+
      </Route>
+
      <Route path="/commits/*" let:params>
+
        <ProjectRoute route={params["*"]} content={proj.ProjectContent.Commit} {peer} {source} {config} />
+
      </Route>
+
    </Router>
  {:catch}
    <NotFound title={id} subtitle="This project was not found." />
  {/await}