Skip to content

Commit e7abe5a

Browse files
committed
Improve missing repo error message
The new file structure makes it clear that this component is only used when there is no repo in the URL path.
1 parent fb47014 commit e7abe5a

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

static-site/app/community/[user]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ export default function Page({
1010
user: string;
1111
};
1212
}): React.ReactElement {
13-
return <MissingRepoErrorPage />;
13+
return <MissingRepoErrorPage user={params.user} />;
1414
}

static-site/app/community/error-page.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,18 @@ import CommunityPageContent from "./content";
77
import { usePathname } from "next/navigation";
88

99
/**
10-
* Renders a generic error page.
10+
* Renders an error page for incomplete user-only paths.
1111
*/
12-
export function MissingRepoErrorPage(): React.ReactElement {
12+
export function MissingRepoErrorPage({
13+
user,
14+
}: {
15+
user: string;
16+
}): React.ReactElement {
1317
const errorPath = "nextstrain.org" + usePathname();
1418
return (
1519
<>
1620
<ErrorMessage
17-
title={`The community repository, dataset, or narrative "${errorPath}" doesn't exist.`}
21+
title={`The path "${errorPath}" is not valid. If you are looking for resources under "${user}", add a repo to the path: "${errorPath}/{repo}"`}
1822
contents={<p>Here is the community page instead.</p>}
1923
/>
2024
<CommunityPageContent />

static-site/app/community/narratives/[user]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ export default function Page({
1010
user: string;
1111
};
1212
}): React.ReactElement {
13-
return <MissingRepoErrorPage />;
13+
return <MissingRepoErrorPage user={params.user} />;
1414
}

0 commit comments

Comments
 (0)