Fix 404 [ci skip]

This commit is contained in:
Ines Montani 2020-07-01 15:02:55 +02:00
parent 7037512e55
commit 6e28760316
4 changed files with 48 additions and 27 deletions

View File

@ -27,7 +27,7 @@ Button.defaultProps = {
}
Button.propTypes = {
to: PropTypes.string.isRequired,
to: PropTypes.string,
variant: PropTypes.oneOf(['primary', 'secondary', 'tertiary']),
large: PropTypes.bool,
icon: PropTypes.string,

47
website/src/pages/404.js Normal file
View File

@ -0,0 +1,47 @@
import React from 'react'
import { window } from 'browser-monads'
import { graphql } from 'gatsby'
import Template from '../templates/index'
import { LandingHeader, LandingTitle } from '../components/landing'
import Button from '../components/button'
export default ({ data, location }) => {
const { nightly } = data.site.siteMetadata
const pageContext = { title: '404 Error', searchExclude: true, isIndex: false }
return (
<Template data={data} pageContext={pageContext} location={location}>
<LandingHeader style={{ minHeight: 400 }} nightly={nightly}>
<LandingTitle>
Ooops, this page
<br />
does not exist!
</LandingTitle>
<br />
<Button onClick={() => window.history.go(-1)} variant="tertiary">
Click here to go back
</Button>
</LandingHeader>
</Template>
)
}
export const pageQuery = graphql`
query {
site {
siteMetadata {
nightly
title
description
navigation {
text
url
}
docSearch {
apiKey
indexName
}
}
}
}
`

View File

@ -1,7 +0,0 @@
---
title: 404 Error
---
import Error from 'widgets/404.js'
<Error />

View File

@ -1,19 +0,0 @@
import React from 'react'
import { window } from 'browser-monads'
import { LandingHeader, LandingTitle } from '../components/landing'
import Button from '../components/button'
export default () => (
<LandingHeader style={{ minHeight: 400 }}>
<LandingTitle>
Ooops, this page
<br />
does not exist!
</LandingTitle>
<br />
<Button onClick={() => window.history.go(-1)} variant="tertiary">
Click here to go back
</Button>
</LandingHeader>
)