2022-05-29 02:01:56 +00:00
|
|
|
import { 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 15:38:30 +00:00
|
|
|
import { LoginContext } from '../components/contexts/login'
|
2022-06-04 03:13:19 +00:00
|
|
|
import { useDefinedContext } from '../utils/definedContext'
|
|
|
|
import { ActionLoginTelegram } from '../components/ActionLoginTelegram'
|
|
|
|
import { ActionEventList } from '../components/ActionEventList'
|
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-04 03:13:19 +00:00
|
|
|
import { Postcard } from '../components/postcard/Postcard'
|
|
|
|
import { ViewLanding } from '../components/view/ViewLanding'
|
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
|
|
|
|
|
|
|
export default function PageIndex() {
|
2022-06-03 01:55:02 +00:00
|
|
|
const { t } = useTranslation()
|
2022-06-03 02:07:12 +00:00
|
|
|
const [login, ] = useDefinedContext(LoginContext)
|
|
|
|
|
2022-06-04 03:13:19 +00:00
|
|
|
return <>
|
|
|
|
<Head>
|
|
|
|
<title key="title">{t("siteTitle")}</title>
|
|
|
|
</Head>
|
|
|
|
<Postcard
|
|
|
|
src={defaultPostcard}
|
|
|
|
/>
|
|
|
|
<ViewLanding
|
|
|
|
title={t("siteTitle")}
|
|
|
|
subtitle={t("siteSubtitle")}
|
|
|
|
actions={
|
|
|
|
(login ?
|
|
|
|
<ActionEventList
|
|
|
|
className="hero-action"
|
|
|
|
/>
|
|
|
|
:
|
|
|
|
<ActionLoginTelegram
|
|
|
|
className="hero-action"
|
|
|
|
/>
|
|
|
|
)
|
2022-05-29 03:00:48 +00:00
|
|
|
}
|
2022-06-04 03:13:19 +00:00
|
|
|
/>
|
|
|
|
</>
|
2022-05-20 11:59:24 +00:00
|
|
|
}
|