mirror of
https://github.com/oceanprotocol/docs.git
synced 2024-11-26 19:49:26 +01:00
Merge pull request #978 from oceanprotocol/issue-968-resolve-404
Add a check before rendering 404
This commit is contained in:
commit
e23d46b8ce
@ -19,6 +19,8 @@ const tag = 'ocean'
|
|||||||
export default class NotFoundPage extends Component {
|
export default class NotFoundPage extends Component {
|
||||||
state = { gif: '' }
|
state = { gif: '' }
|
||||||
|
|
||||||
|
browser = typeof window !== 'undefined' && window
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
location: PropTypes.object
|
location: PropTypes.object
|
||||||
}
|
}
|
||||||
@ -44,6 +46,8 @@ export default class NotFoundPage extends Component {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
|
<>
|
||||||
|
{this.browser && (
|
||||||
<>
|
<>
|
||||||
<Seo location={this.props.location} title="404 - Not Found" />
|
<Seo location={this.props.location} title="404 - Not Found" />
|
||||||
<Layout location={this.props.location}>
|
<Layout location={this.props.location}>
|
||||||
@ -52,8 +56,8 @@ export default class NotFoundPage extends Component {
|
|||||||
<h1>Page not found.</h1>
|
<h1>Page not found.</h1>
|
||||||
<p>
|
<p>
|
||||||
You just hit a route that doesn't exist... the sadness.
|
You just hit a route that doesn't exist... the sadness.
|
||||||
Check your url, <Link to="/">go back to the homepage</Link>, or
|
Check your url, <Link to="/">go back to the homepage</Link>,
|
||||||
check out some <em>{tag}</em> gifs, entirely your choice.
|
or check out some <em>{tag}</em> gifs, entirely your choice.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<video className="gif" src={this.state.gif} autoPlay loop />
|
<video className="gif" src={this.state.gif} autoPlay loop />
|
||||||
@ -67,6 +71,8 @@ export default class NotFoundPage extends Component {
|
|||||||
</Content>
|
</Content>
|
||||||
</Layout>
|
</Layout>
|
||||||
</>
|
</>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user