chore: bump version to 2.18.2 and refactor GlobalErrorPage component
- Incremented application version from 2.18.1 to 2.18.2 in package.json. - Refactored GlobalErrorPage component to improve structure and readability, encapsulating the error content in a separate function and ensuring proper HTML semantics.
This commit is contained in:
@@ -22,71 +22,73 @@ const GlobalErrorPage = ({
|
|||||||
}) => {
|
}) => {
|
||||||
useCaptureException(error);
|
useCaptureException(error);
|
||||||
|
|
||||||
const user = useUser();
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<html>
|
<html lang="en">
|
||||||
<body>
|
<body>
|
||||||
<RootProviders>
|
<RootProviders>
|
||||||
<div className={'flex h-screen flex-1 flex-col'}>
|
<GlobalErrorPageContent reset={reset} />
|
||||||
<SiteHeader user={user.data} />
|
|
||||||
|
|
||||||
<div
|
|
||||||
className={
|
|
||||||
'container m-auto flex w-full flex-1 flex-col items-center justify-center'
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<div className={'flex flex-col items-center space-y-8'}>
|
|
||||||
<div>
|
|
||||||
<h1 className={'font-heading text-9xl font-semibold'}>
|
|
||||||
<Trans i18nKey={'common:errorPageHeading'} />
|
|
||||||
</h1>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className={'flex flex-col items-center space-y-8'}>
|
|
||||||
<div
|
|
||||||
className={
|
|
||||||
'flex max-w-xl flex-col items-center gap-y-2 text-center'
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<div>
|
|
||||||
<Heading level={2}>
|
|
||||||
<Trans i18nKey={'common:genericError'} />
|
|
||||||
</Heading>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<p className={'text-muted-foreground text-lg'}>
|
|
||||||
<Trans i18nKey={'common:genericErrorSubHeading'} />
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className={'flex space-x-4'}>
|
|
||||||
<Button
|
|
||||||
className={'w-full'}
|
|
||||||
variant={'default'}
|
|
||||||
onClick={reset}
|
|
||||||
>
|
|
||||||
<ArrowLeft className={'mr-2 h-4'} />
|
|
||||||
|
|
||||||
<Trans i18nKey={'common:goBack'} />
|
|
||||||
</Button>
|
|
||||||
|
|
||||||
<Button className={'w-full'} variant={'outline'} asChild>
|
|
||||||
<Link href={'/contact'}>
|
|
||||||
<MessageCircle className={'mr-2 h-4'} />
|
|
||||||
|
|
||||||
<Trans i18nKey={'common:contactUs'} />
|
|
||||||
</Link>
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</RootProviders>
|
</RootProviders>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function GlobalErrorPageContent({ reset }: { reset: () => void }) {
|
||||||
|
const user = useUser();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={'flex h-screen flex-1 flex-col'}>
|
||||||
|
<SiteHeader user={user.data} />
|
||||||
|
|
||||||
|
<div
|
||||||
|
className={
|
||||||
|
'container m-auto flex w-full flex-1 flex-col items-center justify-center'
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<div className={'flex flex-col items-center space-y-8'}>
|
||||||
|
<div>
|
||||||
|
<h1 className={'font-heading text-9xl font-semibold'}>
|
||||||
|
<Trans i18nKey={'common:errorPageHeading'} />
|
||||||
|
</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className={'flex flex-col items-center space-y-8'}>
|
||||||
|
<div
|
||||||
|
className={
|
||||||
|
'flex max-w-xl flex-col items-center gap-y-2 text-center'
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<Heading level={2}>
|
||||||
|
<Trans i18nKey={'common:genericError'} />
|
||||||
|
</Heading>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p className={'text-muted-foreground text-lg'}>
|
||||||
|
<Trans i18nKey={'common:genericErrorSubHeading'} />
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className={'flex space-x-4'}>
|
||||||
|
<Button className={'w-full'} variant={'default'} onClick={reset}>
|
||||||
|
<ArrowLeft className={'mr-2 h-4'} />
|
||||||
|
|
||||||
|
<Trans i18nKey={'common:goBack'} />
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Button className={'w-full'} variant={'outline'} asChild>
|
||||||
|
<Link href={'/contact'}>
|
||||||
|
<MessageCircle className={'mr-2 h-4'} />
|
||||||
|
|
||||||
|
<Trans i18nKey={'common:contactUs'} />
|
||||||
|
</Link>
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
export default GlobalErrorPage;
|
export default GlobalErrorPage;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "next-supabase-saas-kit-turbo",
|
"name": "next-supabase-saas-kit-turbo",
|
||||||
"version": "2.18.1",
|
"version": "2.18.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|||||||
Reference in New Issue
Block a user