mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-21 06:10:44 +08:00
Move file selection to browser component
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user