mirror of
https://github.com/formbricks/formbricks.git
synced 2026-05-05 11:21:07 -05:00
feat: refactor translation key management (#6717)
Co-authored-by: Piyush Gupta <piyushguptaa2z123@gmail.com> Co-authored-by: Piyush Gupta <56182734+gupta-piyush19@users.noreply.github.com> Co-authored-by: Victor Hugo dos Santos <115753265+victorvhs017@users.noreply.github.com> Co-authored-by: pandeymangg <anshuman.pandey9999@gmail.com> Co-authored-by: Matti Nannt <matti@formbricks.com> Co-authored-by: Matti Nannt <mail@matthiasnannt.com> Co-authored-by: Johannes <johannes@formbricks.com> Co-authored-by: Johannes <72809645+jobenjada@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
c9a50a6ff2
commit
a5fa876aa3
+2
-2
@@ -1,8 +1,8 @@
|
||||
"use client";
|
||||
|
||||
import { useTranslate } from "@tolgee/react";
|
||||
import { useEffect } from "react";
|
||||
import toast from "react-hot-toast";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { getFormattedErrorMessage } from "@/lib/utils/helper";
|
||||
import { Button } from "@/modules/ui/components/button";
|
||||
import { resendVerificationEmailAction } from "../actions";
|
||||
@@ -12,7 +12,7 @@ interface RequestVerificationEmailProps {
|
||||
}
|
||||
|
||||
export const RequestVerificationEmail = ({ email }: RequestVerificationEmailProps) => {
|
||||
const { t } = useTranslate();
|
||||
const { t } = useTranslation();
|
||||
useEffect(() => {
|
||||
const handleVisibilityChange = () => {
|
||||
if (document.visibilityState === "visible") {
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
"use client";
|
||||
|
||||
import { Trans } from "react-i18next";
|
||||
|
||||
interface VerificationMessageProps {
|
||||
email: string;
|
||||
}
|
||||
|
||||
export const VerificationMessage = ({ email }: VerificationMessageProps) => {
|
||||
return (
|
||||
<p className="text-center text-sm text-slate-700">
|
||||
<Trans
|
||||
i18nKey="auth.verification-requested.verification_email_successfully_sent_info"
|
||||
values={{ email }}
|
||||
components={{ span: <span className="font-semibold" /> }}
|
||||
/>
|
||||
</p>
|
||||
);
|
||||
};
|
||||
@@ -1,9 +1,10 @@
|
||||
import { logger } from "@formbricks/logger";
|
||||
import { ZUserEmail } from "@formbricks/types/user";
|
||||
import { getEmailFromEmailToken } from "@/lib/jwt";
|
||||
import { getTranslate } from "@/lingodotdev/server";
|
||||
import { FormWrapper } from "@/modules/auth/components/form-wrapper";
|
||||
import { RequestVerificationEmail } from "@/modules/auth/verification-requested/components/request-verification-email";
|
||||
import { T, getTranslate } from "@/tolgee/server";
|
||||
import { VerificationMessage } from "@/modules/auth/verification-requested/components/verification-message";
|
||||
|
||||
export const VerificationRequestedPage = async ({ searchParams }) => {
|
||||
const t = await getTranslate();
|
||||
@@ -18,12 +19,7 @@ export const VerificationRequestedPage = async ({ searchParams }) => {
|
||||
<h1 className="leading-2 mb-4 text-center text-lg font-semibold text-slate-900">
|
||||
{t("auth.verification-requested.please_confirm_your_email_address")}
|
||||
</h1>
|
||||
<p className="text-center text-sm text-slate-700">
|
||||
<T
|
||||
keyName="auth.verification-requested.verification_email_successfully_sent_info"
|
||||
params={{ email, span: <span /> }}
|
||||
/>
|
||||
</p>
|
||||
<VerificationMessage email={email} />
|
||||
<hr className="my-4" />
|
||||
<p className="text-center text-xs text-slate-500">
|
||||
{t("auth.verification-requested.you_didnt_receive_an_email_or_your_link_expired")}
|
||||
|
||||
Reference in New Issue
Block a user