-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ feat(errors): implement error pages
- Loading branch information
1 parent
9fdd48f
commit f13ae2b
Showing
8 changed files
with
1,000 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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,46 @@ | ||
import { msg } from "@lingui/macro"; | ||
import Head from "next/head"; | ||
|
||
import { SoftButton } from "@/components/app/button/soft"; | ||
import { useAppTheme } from "@/frontend/_layouts/useAppTheme"; | ||
import { useAppConfiguration } from "@/frontend/hooks/configuration/configuration.store"; | ||
import { NAVIGATION_LINKS } from "@/frontend/lib/routing/links"; | ||
|
||
interface IProps { | ||
code: number; | ||
message: string; | ||
description: string; | ||
Icon: React.ReactNode; | ||
} | ||
|
||
export function BaseErrorCmp({ code, description, message, Icon }: IProps) { | ||
const { | ||
data: { name }, | ||
} = useAppConfiguration("site_settings"); | ||
|
||
useAppTheme(); | ||
|
||
return ( | ||
<> | ||
<Head> | ||
<title> | ||
{message} - {name} | ||
</title> | ||
</Head> | ||
<div className="flex h-lvh w-lvw flex-col items-center justify-center gap-6 bg-foundation"> | ||
<div className="text-center"> | ||
<h1 className="text-4xl font-bold text-main">{code}</h1> | ||
<h3 className="text-muted">{message}</h3> | ||
</div> | ||
{Icon} | ||
<p className="text-muted">{description}</p> | ||
<SoftButton | ||
action={NAVIGATION_LINKS.DASHBOARD.HOME} | ||
label={msg`Go Home`} | ||
size="lg" | ||
systemIcon="Home" | ||
/> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { UnAuthorized } from "@/frontend/views/errors/UnAuthorized"; | ||
|
||
UnAuthorized.useAppLayout = false; | ||
|
||
export default UnAuthorized; |
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,5 @@ | ||
import { NotFound } from "@/frontend/views/errors/NotFound"; | ||
|
||
NotFound.useAppLayout = false; | ||
|
||
export default NotFound; |
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,5 @@ | ||
import { ServerError } from "@/frontend/views/errors/ServerError"; | ||
|
||
ServerError.useAppLayout = false; | ||
|
||
export default ServerError; |
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