added internationalization to pages [WIP]

This commit is contained in:
daniel31x13
2024-06-04 16:59:49 -04:00
parent 2c87459f35
commit d261bd39ec
32 changed files with 1299 additions and 1263 deletions
+7 -2
View File
@@ -2,11 +2,14 @@ import { signOut } from "next-auth/react";
import { useRouter } from "next/router";
import { useEffect } from "react";
import toast from "react-hot-toast";
import getServerSideProps from "@/lib/client/getServerSideProps";
import { useTranslation } from "next-i18next";
const VerifyEmail = () => {
const router = useRouter();
useEffect(() => {
const { t } = useTranslation();
const token = router.query.token;
if (!token || typeof token !== "string") {
@@ -19,12 +22,12 @@ const VerifyEmail = () => {
method: "POST",
}).then((res) => {
if (res.ok) {
toast.success("Email verified. Signing out..");
toast.success(t("email_verified_signing_out"));
setTimeout(() => {
signOut();
}, 3000);
} else {
toast.error("Invalid token.");
toast.error(t("invalid_token"));
}
});
@@ -35,3 +38,5 @@ const VerifyEmail = () => {
};
export default VerifyEmail;
export { getServerSideProps };