Commit f83de343 by Moorthy G

feat(404): handle 404 response

parent 938cacf0
...@@ -6,10 +6,7 @@ export default function PageNotFound() { ...@@ -6,10 +6,7 @@ export default function PageNotFound() {
return ( return (
<div className={styles.notFound}> <div className={styles.notFound}>
<img src={require('./img/404.png')} alt="" /> <img src={require('./img/404.png')} alt="" />
<p>The page you're looking for is not found</p> <Button href="/">Back to Home</Button>
<Button href="/" onClick={() => sendGA('page-not-found', 'cta')}>
Back to home
</Button>
</div> </div>
); );
} }
import PageNotFound from '@components/page-not-found';
function FourOhFour() {
return <PageNotFound />;
}
export default FourOhFour;
import PageNotFound from '@components/page-not-found';
import '@styles/global.scss'; import '@styles/global.scss';
function MyApp({ Component, pageProps }) { function MyApp({ Component, pageProps }) {
return pageProps.statusCode === 404 ? ( return <Component {...pageProps} />;
<PageNotFound />
) : (
<Component {...pageProps} />
);
} }
export default MyApp; export default MyApp;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment