Skip to content

Commit

Permalink
fixed inner folder navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
hdJerry committed Aug 1, 2023
1 parent d3c50c1 commit 8e57c5f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ const BranchNavigation = (props: Props) => {
<Switch
fallback={
<>
<A
<a
href={`${hrefPath(index())}`}
data-testid={`file explorer nav crumb ${crumb}`}
class={styles.crumbLink}
>
{crumb}
</A>
</a>
<span class={styles.separator}>/</span>
</>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
Switch,
Match,
} from 'solid-js';
import { A } from '@solidjs/router';
import { DocumentIcon, FolderIcon } from '../Icons';
import styles from './FileExplorer.module.css';
import getRepoTree from '../../services/get-repo-tree';
Expand Down Expand Up @@ -55,12 +54,13 @@ const FileExplorerView = (props: IProps) => {
<Match when={resTree.isSuccess && !resTree.isLoading}>
<div class={styles.container}>
<Show when={local.path && local.path !== ''}>
<A
<a
href={`${basePath()}/tree/${local.branch}/${local.path}`}
class={styles.cellBack}
replace
>
<div class="text-blue-600">..</div>
</A>
</a>
</Show>
<For each={tree()}>
{(item) => (
Expand All @@ -73,15 +73,15 @@ const FileExplorerView = (props: IProps) => {
</Match>
</Switch>
</div>
<A
<a
href={`${basePath()}/${item.type}/${local.branch}/${
item.path
}`}
data-testid={`file explorer list ${item.name}`}
class={styles.link}
>
{item.name}
</A>
</a>
</div>
</div>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
} from './mapExtensionToLanguage';
import FileCode from './FileCode';
import { LoadingPulseDot } from '../LoadingPulseDot';
import { useParams } from 'solid-start';
import { useParams } from '@solidjs/router';

const FileViewer = () => {
const params = useParams();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useParams } from 'solid-start';
import { useParams } from '@solidjs/router';
import { BranchNavigation } from '~/components/BranchNavigation';
import FileExplorer from '~/components/FileExplorer';
import { RepoHeader } from '~/components/RepoHeader';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const getRepoFile = async (variables: RepoFileVariables) => {
};
const resp = (await FetchApi(data)) as Response;

return resp?.data?.repository?.blob;
return resp?.data?.repository?.blob || null;
};

export default getRepoFile;

0 comments on commit 8e57c5f

Please sign in to comment.