Skip to content

Commit

Permalink
fix: Add missing custom 404 page
Browse files Browse the repository at this point in the history
  • Loading branch information
thasup committed Dec 7, 2024
1 parent e1ace33 commit 019663a
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions client/pages/404.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React from 'react';

function Custom404({ statusCode }) {
return (
<p
className="d-flex justify-content-center align-items-center"
style={{ height: '90vh' }}
>
{
statusCode === 404
? '404 Page not found X('
: 'Something went wrong. Please try again. :('
}
</p>
);
}

Custom404.getInitialProps = ({ res, err }) => {
const statusCode = res ? res.statusCode : err ? err.statusCode : 404;
return { statusCode };
};

export default Custom404

0 comments on commit 019663a

Please sign in to comment.