mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-07-31 12:00:10 +08:00
Add locale to leaderboard and organize locale json
This commit is contained in:
@@ -3,17 +3,17 @@ 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";
|
||||
export { getDefaultStaticProps as getStaticProps } from "src/lib/default_static_props";
|
||||
|
||||
const Home = () => {
|
||||
const router = useRouter();
|
||||
const { status } = useSession();
|
||||
const { t } = useTranslation("index");
|
||||
const { t } = useTranslation();
|
||||
useEffect(() => {
|
||||
if (status === "authenticated") {
|
||||
router.push("/dashboard");
|
||||
@@ -37,10 +37,4 @@ const Home = () => {
|
||||
|
||||
Home.getLayout = getTransparentHeaderLayout;
|
||||
|
||||
export const getStaticProps = async ({ locale }) => ({
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ["index", "common"])),
|
||||
},
|
||||
});
|
||||
|
||||
export default Home;
|
||||
|
||||
@@ -1,27 +1,29 @@
|
||||
import { Box, Heading, Tab, TabList, TabPanel, TabPanels, Tabs } from "@chakra-ui/react";
|
||||
import Head from "next/head";
|
||||
import { useTranslation } from "next-i18next";
|
||||
import { getDashboardLayout } from "src/components/Layout";
|
||||
import { LeaderboardGridCell } from "src/components/LeaderboardGridCell";
|
||||
export { getDefaultStaticProps as getStaticProps } from "src/lib/default_static_props";
|
||||
import { LeaderboardTimeFrame } from "src/types/Leaderboard";
|
||||
|
||||
const Leaderboard = () => {
|
||||
const { t } = useTranslation(["leaderboard", "common"]);
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
<title>Leaderboard - Open Assistant</title>
|
||||
<title>{`${t("leaderboard")} - ${t("common:title")}`}</title>
|
||||
<meta name="description" content="Leaderboard Rankings" charSet="UTF-8" />
|
||||
</Head>
|
||||
<Box display="flex" flexDirection="column">
|
||||
<Heading fontSize="2xl" fontWeight="bold" pb="4">
|
||||
Leaderboard
|
||||
{t("leaderboard")}
|
||||
</Heading>
|
||||
<Tabs isFitted isLazy>
|
||||
<TabList>
|
||||
<Tab>Daily</Tab>
|
||||
<Tab>Weekly</Tab>
|
||||
<Tab>Monthly</Tab>
|
||||
<Tab>Overall</Tab>
|
||||
<Tab>{t("daily")}</Tab>
|
||||
<Tab>{t("weekly")}</Tab>
|
||||
<Tab>{t("monthly")}</Tab>
|
||||
<Tab>{t("overall")}</Tab>
|
||||
</TabList>
|
||||
|
||||
<TabPanels>
|
||||
|
||||
Reference in New Issue
Block a user