Skip to content

Commit 1b17c61

Browse files
feat(user): display email on email verification remainder page (#1533)
* feat: add email on email verification remainder page * refactor: update translation
1 parent edaf8d5 commit 1b17c61

3 files changed

Lines changed: 19 additions & 4 deletions

File tree

packages/i18n/src/locales/en/user.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"invalidToken": "The token is invalid.",
3838
"resendEmailInfo": "Not received yet?",
3939
"success": "Email verified successfully.",
40-
"unverified": "We've sent you an email with a link to verify your email address. Please check your inbox.",
40+
"unverified": "We've sent an email to <strong>{{ email }}</strong> with a link for verification. Please check your inbox.",
4141
"unauthenticated": "User session expired. Please signin to continue."
4242
},
4343
"title": "Please verify your email address.",

packages/i18n/src/locales/fr/user.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"invalidToken": "The token is invalid. (fr)",
3838
"resendEmailInfo": "Not received yet? (fr)",
3939
"success": "Email verified successfully. (fr)",
40-
"unverified": "We've sent you an email with a link to verify your email address. Please check your inbox. (fr)",
40+
"unverified": "We've sent an email to <strong>{{ email }}</strong> with a link for verification. Please check your inbox. (fr)",
4141
"unauthenticated": "User session expired. Please signin to continue. (fr)"
4242
},
4343
"title": "Please verify your email address. (fr)",

packages/user/src/views/EmailVerificationReminder.tsx

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
import { useTranslation } from "@dzangolab/react-i18n";
1+
import { Trans, useTranslation } from "@dzangolab/react-i18n";
22
import { Page } from "@dzangolab/react-ui";
33
import { useState } from "react";
44
import { Link } from "react-router-dom";
55
import { toast } from "react-toastify";
66

7+
import { useUser } from "@/hooks";
8+
79
import { EMAIL_VERIFICATION } from "../constants";
810
import { resendVerificationEmail } from "../supertokens/resend-email-verification";
911

@@ -16,6 +18,8 @@ export const EmailVerificationReminder = ({
1618

1719
const { t } = useTranslation("user");
1820

21+
const { user } = useUser();
22+
1923
const handleResend = () => {
2024
resendVerificationEmail()
2125
.then((status) => {
@@ -42,7 +46,18 @@ export const EmailVerificationReminder = ({
4246
<p>{t("emailVerification.messages.alreadyVerified")}</p>
4347
) : (
4448
<>
45-
<p>{t("emailVerification.messages.unverified")}</p>
49+
<p>
50+
{
51+
<Trans
52+
i18nKey={"emailVerification.messages.unverified"}
53+
values={{ email: user?.email }}
54+
components={{
55+
strong: <strong />,
56+
}}
57+
t={t}
58+
/>
59+
}
60+
</p>
4661
<p className="resend-email">
4762
{t("emailVerification.messages.resendEmailInfo")}{" "}
4863
<Link to="#" onClick={handleResend}>

0 commit comments

Comments
 (0)