This repository was archived by the owner on Feb 27, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change
1
+ import PropTypes from 'prop-types'
2
+ import getPostTypeStaticProps from '@/api/wordpress/_global/getPostTypeStaticProps'
3
+ import Layout from '@/components/common/Layout'
4
+ import { seoPropTypes } from '@/functions/getPagePropTypes'
5
+ import Page from './[...slug]'
6
+
7
+ /**
8
+ * Render the Custom404 component.
9
+ *
10
+ * @author WebDevStudios
11
+ * @param {object } props The component attributes as props.
12
+ * @param {object } props.post Post data from WordPress.
13
+ * @return {Element } The Search component.
14
+ */
15
+ export default function Custom404 ( { post} ) {
16
+ // Display dynamic page data if 404 page retrieved from WP.
17
+ if ( post ) {
18
+ return < Page post = { post } />
19
+ }
20
+
21
+ return (
22
+ < Layout seo = { { ...post ?. seo } } >
23
+ < h1 > 404 Not Found</ h1 >
24
+ < p > That post could not be found!</ p >
25
+ </ Layout >
26
+ )
27
+ }
28
+
29
+ /**
30
+ * Get post static props.
31
+ *
32
+ * @author WebDevStudios
33
+ * @return {object } Post props.
34
+ */
35
+ export async function getStaticProps ( ) {
36
+ return await getPostTypeStaticProps ( null , '404' )
37
+ }
38
+
39
+ Custom404 . propTypes = {
40
+ post : PropTypes . shape ( {
41
+ seo : { ...seoPropTypes . seo }
42
+ } )
43
+ }
You can’t perform that action at this time.
0 commit comments