Skip to content

Commit

Permalink
feat: back home button on error-page (#60)
Browse files Browse the repository at this point in the history
Fixes #59
  • Loading branch information
CostasAK authored Jul 26, 2024
1 parent 915152c commit 23afe65
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
13 changes: 10 additions & 3 deletions src/pages/error.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
import { Button } from "@/components/ui/button";
import { useRouteErrorMessage } from "@/hooks/use-route-error-message";
import Page from "@/layout/page";
import { Link } from "react-router-dom";

export default function ErrorPage() {
const error = useRouteErrorMessage();
console.error(error);

return (
<div id="error-page">
<h1>Oops!</h1>
<Page className="flex w-fit flex-col gap-4">
<p>Sorry, an unexpected error has occurred.</p>
<p>
<i>{error}</i>
</p>
</div>
<Button asChild>
<Link to="/" reloadDocument>
Go Home
</Link>
</Button>
</Page>
);
}
4 changes: 3 additions & 1 deletion src/pages/no-match.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ export function NoMatch() {
<Page className="flex w-fit flex-col gap-4">
<span>Page not found.</span>
<Button asChild>
<Link to="/">Go Home</Link>
<Link to="/" reloadDocument>
Go Home
</Link>
</Button>
</Page>
);
Expand Down

0 comments on commit 23afe65

Please sign in to comment.