-
Notifications
You must be signed in to change notification settings - Fork 440
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
13ff883
commit a503bce
Showing
3 changed files
with
77 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
import Link from "next/link"; | ||
import "server-only"; | ||
import { ErrorPage } from "@/components/ErrorPage"; | ||
|
||
export default function NotFound() { | ||
return ( | ||
<div> | ||
<h1>Not Found</h1> | ||
<p>Could not find requested resource</p> | ||
<Link href="/">Return Home</Link> | ||
</div> | ||
<ErrorPage | ||
errorCode="404" | ||
title="Page not found" | ||
description="We couldn't find the page you were looking for" | ||
/> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import { DashboardContainer } from "@/components/DashboardContainer"; | ||
import { DataBlockWithCopy } from "@/components/requirements/DataBlockWithCopy"; | ||
import { Anchor } from "@/components/ui/Anchor"; | ||
import { buttonVariants } from "@/components/ui/Button"; | ||
|
||
// TODO: simple compound component when design is certain | ||
|
||
const ErrorPage = ({ | ||
title, | ||
description, | ||
correlationId, | ||
errorCode, | ||
}: { | ||
title: string; | ||
description: string; | ||
correlationId?: string; | ||
errorCode: string; | ||
}) => { | ||
return ( | ||
<div className="relative h-screen"> | ||
<DashboardContainer className="flex size-full flex-col"> | ||
<main className="mx-auto flex h-full max-w-prose flex-col items-center justify-center text-center"> | ||
<h1 className="mb-4 text-pretty font-bold font-display text-4xl"> | ||
{title} | ||
</h1> | ||
<p className="mb-12 text-balance text-foreground-dimmed text-lg"> | ||
{description} | ||
</p> | ||
<Anchor | ||
variant={"unstyled"} | ||
href="/" | ||
className={buttonVariants({ | ||
variant: "solid", | ||
colorScheme: "primary", | ||
})} | ||
> | ||
Return Home | ||
</Anchor> | ||
</main> | ||
<footer className="mt-auto pb-8 text-center text-foreground-secondary text-xs sm:text-sm"> | ||
{correlationId && ( | ||
<code> | ||
correlation id: <DataBlockWithCopy text={correlationId} /> | ||
</code> | ||
)} | ||
</footer> | ||
</DashboardContainer> | ||
<div className="-translate-y-1/2 -z-10 absolute top-1/2 w-full overflow-hidden text-center"> | ||
<div | ||
className="font-black text-[clamp(128px,32vw,360px)] text-foreground leading-none tracking-tight opacity-20" | ||
aria-hidden | ||
> | ||
{errorCode} | ||
</div> | ||
<div className="absolute inset-0 bg-gradient-to-t from-background" /> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export { ErrorPage }; |