-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add NotFound page and root error element
- Loading branch information
1 parent
4459b95
commit 82abb44
Showing
13 changed files
with
1,111 additions
and
10 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,13 @@ | ||
import { DashboardHeader } from "~features/dashboard/components/dashboard-header"; | ||
import { TableList } from "~features/dashboard/components/table-list"; | ||
|
||
export function Component() { | ||
export function DashboardRoot() { | ||
return ( | ||
<div className="flex flex-col grow p-12 sm:p-16 min-h-0 space-y-12 sm:space-y-16"> | ||
<DashboardHeader /> | ||
<TableList /> | ||
</div> | ||
); | ||
} | ||
|
||
export const Component = DashboardRoot; |
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { | ||
Card, | ||
CardContent, | ||
CardDescription, | ||
CardHeader, | ||
CardTitle, | ||
} from "@manifold/ui/components/ui/card"; | ||
import { isError } from "@tanstack/react-query"; | ||
import { GiDiceTwentyFacesOne } from "react-icons/gi"; | ||
import { useRouteError } from "react-router-dom"; | ||
|
||
const FALLBACK_ERROR_MESSAGE = | ||
"The details remain elusive, but our quest to understand their true nature is just beginning…" as const; | ||
|
||
export function RootError() { | ||
const error = useRouteError(); | ||
|
||
return ( | ||
<div className="flex flex-col grow items-center justify-center"> | ||
<Card className="min-w-256 max-w-sm text-center"> | ||
<CardHeader> | ||
<GiDiceTwentyFacesOne className="text-emerald-100 size-40 mx-auto mb-8" /> | ||
|
||
<CardTitle>Unlucky!</CardTitle> | ||
<CardDescription>We rolled a natural 1…</CardDescription> | ||
</CardHeader> | ||
|
||
<CardContent> | ||
<p> | ||
{isError(error) | ||
? error.message || FALLBACK_ERROR_MESSAGE | ||
: FALLBACK_ERROR_MESSAGE} | ||
</p> | ||
</CardContent> | ||
</Card> | ||
</div> | ||
); | ||
} |
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
File renamed without changes.
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,37 @@ | ||
import { Button } from "@manifold/ui/components/ui/button"; | ||
import { | ||
Card, | ||
CardContent, | ||
CardDescription, | ||
CardHeader, | ||
CardTitle, | ||
} from "@manifold/ui/components/ui/card"; | ||
import { GiSuspicious } from "react-icons/gi"; | ||
import { GoChevronRight } from "react-icons/go"; | ||
import { Link } from "react-router-dom"; | ||
|
||
export function NotFound() { | ||
return ( | ||
<div className="flex flex-col grow items-center justify-center"> | ||
<Card className="min-w-256 max-w-sm text-center"> | ||
<CardHeader> | ||
<GiSuspicious className="text-emerald-100 size-40 mx-auto mb-8" /> | ||
|
||
<CardTitle>An empty room…</CardTitle> | ||
<CardDescription>…how suspicious!</CardDescription> | ||
</CardHeader> | ||
|
||
<CardContent> | ||
<Button asChild variant="outline"> | ||
<Link to="/" className="flex gap-8 items-center group"> | ||
Take me back to safety | ||
<GoChevronRight className="group-hover:translate-x-4 transition-transform" /> | ||
</Link> | ||
</Button> | ||
</CardContent> | ||
</Card> | ||
</div> | ||
); | ||
} | ||
|
||
export const Component = NotFound; |
Oops, something went wrong.