-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path404.jsx
27 lines (24 loc) · 768 Bytes
/
404.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import styles from '../styles/404.module.scss';
import Layout from './components/Layout';
import Link from 'next/link';
import { setPageNumber } from '../redux/notesReducer';
import { useDispatch } from 'react-redux';
import { useRouter } from 'next/router';
export default function Custom404() {
const dispatch = useDispatch();
const router = useRouter();
const paginationHandler = async (page) => {
dispatch(setPageNumber(page));
await router.push(`?page=${page}`);
};
return (
<Layout title={'Notes | 404'}>
<div className={styles.container}>
<p>404 - Page Not Found</p>
<Link href={'/?page=1'}>
<a onClick={() => paginationHandler(1)}>Back to home page</a>
</Link>
</div>
</Layout>
);
}