1
0
mirror of https://github.com/oceanprotocol/docs.git synced 2024-11-26 19:49:26 +01:00

Issue-#968: Add a check before rendering 404

This commit is contained in:
Akshay 2022-05-01 15:06:51 +02:00
parent 4fb9ec17d4
commit 3af7134c52

View File

@ -19,6 +19,8 @@ const tag = 'ocean'
export default class NotFoundPage extends Component {
state = { gif: '' }
browser = typeof window !== 'undefined' && window
static propTypes = {
location: PropTypes.object
}
@ -44,6 +46,8 @@ export default class NotFoundPage extends Component {
render() {
return (
<>
{this.browser && (
<>
<Seo location={this.props.location} title="404 - Not Found" />
<Layout location={this.props.location}>
@ -52,8 +56,8 @@ export default class NotFoundPage extends Component {
<h1>Page not found.</h1>
<p>
You just hit a route that doesn&#39;t exist... the sadness.
Check your url, <Link to="/">go back to the homepage</Link>, or
check out some <em>{tag}</em> gifs, entirely your choice.
Check your url, <Link to="/">go back to the homepage</Link>,
or check out some <em>{tag}</em> gifs, entirely your choice.
</p>
<video className="gif" src={this.state.gif} autoPlay loop />
@ -67,6 +71,8 @@ export default class NotFoundPage extends Component {
</Content>
</Layout>
</>
)}
</>
)
}
}