mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-10-18 19:30:27 +08:00
Move ProjectContentRoutes into View
Signed-off-by: Sebastian Martinez <sebastinez@me.com>
This commit is contained in:
@@ -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>
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user