Files
Open-Assistant/website/src/pages/index.tsx
T
rjmacarthy d10f691eeb Implemented i18n for internationalization and refactor index for localization support
lint

Fix Hero as tag types

Fix build warning regarding i18n

Update package.json and package-lock.json

Revert package-lock.json

Add package-lock, fix build

Pre-commit

Fix default export in favour of named export

Refactor cta buttons to use react-icons

Remove unused props from CircleBackground
2023-01-17 08:01:37 +00:00

47 lines
1.2 KiB
TypeScript

import { Box } from "@chakra-ui/react";
import Head from "next/head";
import { useRouter } from "next/router";
import { useSession } from "next-auth/react";
import { useTranslation } from "next-i18next";
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
import { useEffect } from "react";
import { CallToAction } from "src/components/CallToAction";
import { Faq } from "src/components/Faq";
import { Hero } from "src/components/Hero";
import { getTransparentHeaderLayout } from "src/components/Layout";
const Home = () => {
const router = useRouter();
const { status } = useSession();
const { t } = useTranslation("index");
useEffect(() => {
if (status === "authenticated") {
router.push("/dashboard");
}
}, [router, status]);
return (
<>
<Head>
<title>{t("title")}</title>
<meta name="description" content={t("description")} />
</Head>
<Box as="main" className="oa-basic-theme">
<Hero />
<CallToAction />
<Faq />
</Box>
</>
);
};
Home.getLayout = getTransparentHeaderLayout;
export const getStaticProps = async ({ locale }) => ({
props: {
...(await serverSideTranslations(locale, ["index", "common"])),
},
});
export default Home;