Skip to content
This repository was archived by the owner on Feb 27, 2024. It is now read-only.

Commit 1b0cc76

Browse files
committed
Update 404 static props, proptypes
1 parent d9a498b commit 1b0cc76

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pages/404.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
import PropTypes from 'prop-types'
21
import getPostTypeStaticProps from '@/api/wordpress/_global/getPostTypeStaticProps'
32
import Layout from '@/components/common/Layout'
4-
import {seoPropTypes} from '@/functions/getPagePropTypes'
3+
import getPagePropTypes from '@/functions/getPagePropTypes'
54
import Page from './[...slug]'
65

6+
// Define route post type.
7+
const postType = 'page'
8+
79
/**
810
* Render the Custom404 component.
911
*
@@ -35,11 +37,9 @@ export default function Custom404({post}) {
3537
* @return {object} Post props.
3638
*/
3739
export async function getStaticProps() {
38-
return await getPostTypeStaticProps(null, '404')
40+
return await getPostTypeStaticProps({slug: 404}, postType)
3941
}
4042

4143
Custom404.propTypes = {
42-
post: PropTypes.shape({
43-
seo: {...seoPropTypes.seo}
44-
})
44+
...getPagePropTypes(postType)
4545
}

0 commit comments

Comments
 (0)