add changes from v0.3

This commit is contained in:
JJ Kasper
2018-11-24 00:23:32 -06:00
parent 73f05ce4a3
commit 111cf2ed35
133 changed files with 10768 additions and 7443 deletions

39
pages/_error.js Normal file
View File

@@ -0,0 +1,39 @@
import React from 'react'
export default class Error extends React.Component {
static getInitialProps({ res, err }) {
let statusCode = null
if (res) statusCode = res.statusCode
else if (err) statusCode = err.statusCode
return { statusCode }
}
render() {
const { statusCode } = this.props
return (
<div className="fill">
<h4>
{(() => {
if (statusCode === 404) {
return (
<>
<span>404</span> | This page could not be found
</>
)
}
return statusCode ? `Error: ${statusCode}` : 'An error occurred...'
})()}
</h4>
<style jsx>{`
div {
display: flex;
align-items: center;
justify-content: center;
}
`}</style>
</div>
)
}
}