2022-06-11 03:08:49 +00:00
|
|
|
import { NextPage, NextPageContext } from 'next'
|
2022-05-25 14:20:22 +00:00
|
|
|
import { useTranslation } from 'next-i18next'
|
2022-06-04 03:13:19 +00:00
|
|
|
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
2022-06-08 02:52:41 +00:00
|
|
|
import { default as Head } from 'next/head'
|
2022-06-03 02:07:12 +00:00
|
|
|
import defaultPostcard from "../public/postcards/adi-goldstein-Hli3R6LKibo-unsplash.jpg"
|
2022-06-11 03:08:49 +00:00
|
|
|
import { Postcard } from '../components/postcard/changer'
|
|
|
|
import { ViewLanding } from '../components/generic/views/landing'
|
|
|
|
import { LandingActionLogin } from '../components/landing/actions/login'
|
|
|
|
import { useDefinedContext } from '../utils/definedContext'
|
|
|
|
import { AuthContext } from '../components/auth/base'
|
|
|
|
import { LandingActionEvents } from '../components/landing/actions/events'
|
2022-05-29 02:01:56 +00:00
|
|
|
|
2022-05-25 14:20:22 +00:00
|
|
|
|
|
|
|
export async function getStaticProps(context: NextPageContext) {
|
2022-05-28 03:45:05 +00:00
|
|
|
return {
|
|
|
|
props: {
|
|
|
|
...(await serverSideTranslations(context.locale ?? "it-IT", ["common"]))
|
|
|
|
}
|
|
|
|
}
|
2022-05-25 14:20:22 +00:00
|
|
|
}
|
2022-05-20 11:59:24 +00:00
|
|
|
|
2022-05-29 02:01:56 +00:00
|
|
|
|
2022-06-11 03:08:49 +00:00
|
|
|
const PageIndex: NextPage = () => {
|
2022-06-03 01:55:02 +00:00
|
|
|
const { t } = useTranslation()
|
2022-06-11 03:08:49 +00:00
|
|
|
const [auth,] = useDefinedContext(AuthContext)
|
2022-06-03 02:07:12 +00:00
|
|
|
|
2022-06-04 03:13:19 +00:00
|
|
|
return <>
|
|
|
|
<Head>
|
|
|
|
<title key="title">{t("siteTitle")}</title>
|
|
|
|
</Head>
|
2022-06-11 03:08:49 +00:00
|
|
|
<Postcard
|
|
|
|
src={defaultPostcard}
|
|
|
|
/>
|
2022-06-04 03:13:19 +00:00
|
|
|
<ViewLanding
|
|
|
|
title={t("siteTitle")}
|
|
|
|
subtitle={t("siteSubtitle")}
|
2022-06-11 03:08:49 +00:00
|
|
|
actions={auth ?
|
|
|
|
<LandingActionEvents />
|
|
|
|
:
|
|
|
|
<LandingActionLogin />
|
2022-05-29 03:00:48 +00:00
|
|
|
}
|
2022-06-04 03:13:19 +00:00
|
|
|
/>
|
|
|
|
</>
|
2022-05-20 11:59:24 +00:00
|
|
|
}
|
2022-06-11 03:08:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
export default PageIndex
|