1
0
mirror of https://github.com/theoludwig/theoludwig.git synced 2025-12-12 20:46:52 +01:00

feat: add version number in footer

This commit is contained in:
Divlo
2021-07-27 11:36:35 +00:00
parent 669f592a9f
commit 3a278fec10
10 changed files with 290 additions and 531 deletions

View File

@@ -1,22 +1,32 @@
import { GetStaticProps } from 'next'
import useTranslation from 'next-translate/useTranslation'
import readPackageJSON from 'read-pkg'
import { ErrorPage } from 'components/ErrorPage'
import { Head } from 'components/Head'
import { Header } from 'components/Header'
import { Footer, FooterProps } from 'components/Footer'
const Error404: React.FC = () => {
const Error404: React.FC<FooterProps> = (props) => {
const { t } = useTranslation()
const { version } = props
return (
<>
<Head title='Divlo - 404' />
<ErrorPage statusCode={404} message={t('errors:notFound')} />
<Header />
<main className='flex flex-col md:mx-auto md:max-w-4xl lg:max-w-7xl'>
<ErrorPage statusCode={404} message={t('errors:notFound')} />
</main>
<Footer version={version} />
</>
)
}
export const getStaticProps: GetStaticProps = async () => {
return { props: {} }
export const getStaticProps: GetStaticProps<FooterProps> = async () => {
const { version } = await readPackageJSON()
return { props: { version } }
}
export default Error404