-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ux): added a generic error page. Closes #619
- Loading branch information
1 parent
a295adf
commit 6712b6e
Showing
3 changed files
with
107 additions
and
25 deletions.
There are no files selected for viewing
This file was deleted.
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,70 @@ | ||
import PageHeader from '@/Components/PageHeader'; | ||
import { PageContentWrapper } from '@/Components/PageContentWrapper'; | ||
import { Head, Link } from '@inertiajs/react'; | ||
import FooterGuest from '@/Components/FooterGuest'; | ||
import { HOME_URL, LOGOUT_URL } from '@knowii/common'; | ||
import { Button } from 'primereact/button'; | ||
import classNames from 'classnames'; | ||
import { FaHome, FaSignOutAlt } from 'react-icons/fa'; | ||
import { useRoute } from 'ziggy-js'; | ||
|
||
interface Props { | ||
status: string; | ||
} | ||
|
||
export default function Contact(props: Props) { | ||
const route = useRoute(); | ||
|
||
const errorTitle = { | ||
503: '503: Service Unavailable', | ||
500: '500: Server Error', | ||
404: '404: Page Not Found', | ||
403: '403: Forbidden', | ||
}[props.status]; | ||
|
||
const errorDescription = { | ||
503: 'Sorry, we are doing some maintenance. Please check back soon. 😔', | ||
500: 'Whoops, something went wrong on our servers. 😔', | ||
404: 'Sorry, the page you are looking for could not be found. 😭', | ||
403: 'Sorry, you are forbidden from accessing this page. ⛔', | ||
}[props.status]; | ||
|
||
return ( | ||
<> | ||
<Head title={`Error: ${errorTitle}`} /> | ||
|
||
<div className="page-wrapper"> | ||
<PageHeader | ||
compact={true} | ||
addLinkOnLogo={true} | ||
showDashboardButton={false} | ||
showLogoutButton={false} | ||
showLoginButton={false} | ||
showRegisterButton={false} | ||
/> | ||
|
||
<PageContentWrapper> | ||
<div className="flex flex-col items-center"> | ||
<div className="min-w-full md:min-w-[75%] xl:min-w-[50%] p-6 mt-6 overflow-hidden prose bg-white shadow-md sm:max-w-2xl sm:rounded-lg"> | ||
<h1>{errorTitle}</h1> | ||
<h2>{errorDescription}</h2> | ||
<div className="mt-12 flex flex-row justify-center"> | ||
<a href={HOME_URL} className=""> | ||
<Button aria-label={'Go back to the homepage'} severity="primary" className=""> | ||
<FaHome /> | ||
Go back to the homepage | ||
</Button> | ||
</a> | ||
</div> | ||
<p className="mt-12 text-center"> | ||
If the problem persists, you can contact us at the following address:{' '} | ||
<a href="mailto:contact@knowii.net">contact@knowii.net</a> | ||
</p> | ||
</div> | ||
</div> | ||
<FooterGuest /> | ||
</PageContentWrapper> | ||
</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