2022-05-25 14:20:22 +00:00
|
|
|
import type { NextPage, NextPageContext } from 'next'
|
|
|
|
import { useTranslation } from 'next-i18next'
|
|
|
|
import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
|
2022-05-25 15:50:31 +00:00
|
|
|
import { Intro } from '../components/Intro';
|
2022-05-28 03:45:05 +00:00
|
|
|
import { TutorialTelegramLogin } from '../components/TutorialTelegramLogin';
|
|
|
|
import { LoginContext } from '../contexts/login';
|
|
|
|
import { useDefinedContext } from '../utils/definedContext';
|
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-20 22:46:39 +00:00
|
|
|
const Page: NextPage = () => {
|
2022-05-28 03:45:05 +00:00
|
|
|
const { t } = useTranslation("common")
|
|
|
|
const [login, setLogin] = useDefinedContext(LoginContext)
|
|
|
|
|
|
|
|
if (!login) {
|
|
|
|
return (
|
|
|
|
<main className="page-index">
|
|
|
|
<hgroup>
|
|
|
|
<h1>
|
|
|
|
{t("siteTitle")}
|
|
|
|
</h1>
|
|
|
|
<h2>
|
|
|
|
{t("siteSubtitle")}
|
|
|
|
</h2>
|
|
|
|
</hgroup>
|
|
|
|
<div>
|
|
|
|
<TutorialTelegramLogin />
|
|
|
|
</div>
|
|
|
|
</main>
|
|
|
|
)
|
|
|
|
}
|
2022-05-25 14:20:22 +00:00
|
|
|
|
2022-05-20 22:46:39 +00:00
|
|
|
return (
|
2022-05-28 03:45:05 +00:00
|
|
|
<main className="page-index">
|
2022-05-25 15:50:31 +00:00
|
|
|
<hgroup>
|
|
|
|
<h1>
|
|
|
|
{t("siteTitle")}
|
|
|
|
</h1>
|
|
|
|
<h2>
|
|
|
|
{t("siteSubtitle")}
|
|
|
|
</h2>
|
|
|
|
</hgroup>
|
2022-05-28 03:45:05 +00:00
|
|
|
</main>
|
2022-05-20 22:46:39 +00:00
|
|
|
)
|
2022-05-20 11:59:24 +00:00
|
|
|
}
|
|
|
|
|
2022-05-20 22:46:39 +00:00
|
|
|
export default Page
|