1
Fork 0
mirror of https://github.com/Steffo99/festa.git synced 2024-10-16 15:07:27 +00:00
festa/pages/index.tsx

45 lines
1.3 KiB
TypeScript
Raw Normal View History

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'
import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
2022-05-28 03:45:05 +00:00
import { LoginContext } from '../contexts/login';
import { useDefinedContext } from '../utils/definedContext';
import { ActionLoginTelegram } from '../components/ActionLoginTelegram';
import { ActionEventList } from '../components/ActionEventList';
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-05-28 03:45:05 +00:00
const { t } = useTranslation("common")
const [login, _] = useDefinedContext(LoginContext)
return (
2022-05-29 03:00:48 +00:00
<main id="page-index" className="page">
<hgroup className="hero-titles">
2022-05-29 02:01:56 +00:00
<h1>
{t("siteTitle")}
</h1>
2022-05-29 03:00:48 +00:00
<h2>
{t("siteSubtitle")}
</h2>
</hgroup>
{login ?
<ActionEventList
2022-06-01 03:04:15 +00:00
className="hero-action"
/>
:
<ActionLoginTelegram
className="hero-action"
/>
2022-05-29 03:00:48 +00:00
}
</main>
)
2022-05-20 11:59:24 +00:00
}