-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add interface for error pages (#2589)
* feat: add interface for error pages * chore: remove console.log from error page * chore: remove error message from error page * refactor: error page * fix: 404 and error pages styles * fix: 404 and error pages buttons styles * fix: 404 and error pages buttons styles * fix: 404 and error pages buttons styles * fix: restore missing header sidebar * fix: missing darkTheme for GithubStars
- Loading branch information
Showing
12 changed files
with
150 additions
and
68 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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
'use client'; | ||
|
||
import PropTypes from 'prop-types'; | ||
import { useEffect } from 'react'; | ||
|
||
import Hero from 'components/pages/error/hero'; | ||
import Layout from 'components/shared/layout'; | ||
import SEO_DATA from 'constants/seo-data'; | ||
|
||
/* | ||
NOTE: | ||
This page is needed to handle unexpected errors and display fallback UI. | ||
*/ | ||
const ErrorPage = ({ error, reset }) => { | ||
useEffect(() => { | ||
// eslint-disable-next-line no-console | ||
console.error(error); | ||
}, [error]); | ||
|
||
return ( | ||
<> | ||
<title>{SEO_DATA.error.title}</title> | ||
|
||
<Layout isClient> | ||
<Hero | ||
title="Page is broken..." | ||
text="Sorry, the page you are looking for is broken. Please try again later, we'll fix it soon!" | ||
reset={reset} | ||
/> | ||
</Layout> | ||
</> | ||
); | ||
}; | ||
|
||
ErrorPage.propTypes = { | ||
error: PropTypes.object, | ||
reset: PropTypes.func, | ||
}; | ||
|
||
export default ErrorPage; |
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
Binary file not shown.
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
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
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
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