From cc251ba8ae2a366087d61f12153fad2960ed3fdd Mon Sep 17 00:00:00 2001 From: Vladyslav Matsiiako Date: Tue, 27 Dec 2022 11:52:23 -0500 Subject: [PATCH] Fixed the home directory transations --- frontend/pages/home/[id].tsx | 8 ++++++++ frontend/pages/login.tsx | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/frontend/pages/home/[id].tsx b/frontend/pages/home/[id].tsx index d433600d3..429c6e8a4 100644 --- a/frontend/pages/home/[id].tsx +++ b/frontend/pages/home/[id].tsx @@ -13,10 +13,12 @@ import { faUserPlus } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import { useTranslation } from "next-i18next"; import onboardingCheck from '~/components/utilities/checks/OnboardingCheck'; import registerUserAction from '../api/userActions/registerUserAction'; +import { getTranslatedServerSideProps } from '~/components/utilities/withTranslateProps'; type ItemProps = { text: string; @@ -37,6 +39,8 @@ const learningItem = ({ userAction, link }: ItemProps): JSX.Element => { + const { t } = useTranslation(); + if (link) { return ( @@ -139,6 +143,8 @@ export default function Home() { const [hasUserPushedSecrets, setHasUserPushedSecrets] = useState(false); const [usersInOrg, setUsersInOrg] = useState(false); + const { t } = useTranslation(); + useEffect(() => { onboardingCheck({ setHasUserClickedIntro, @@ -226,3 +232,5 @@ export default function Home() { } Home.requireAuth = true; + +export const getServerSideProps = getTranslatedServerSideProps(["home"]); diff --git a/frontend/pages/login.tsx b/frontend/pages/login.tsx index 252aeb715..b2485974a 100644 --- a/frontend/pages/login.tsx +++ b/frontend/pages/login.tsx @@ -92,7 +92,7 @@ export default function Login() { >

- {t("login:login-to")} + {t("login:login")}