🔒️ Remove link to change email (#1156)

This commit is contained in:
Luke Vella 2024-06-17 22:27:57 +01:00 committed by GitHub
parent f7eda38e0a
commit b1d3241ca9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 5 additions and 22 deletions

View file

@ -80,7 +80,6 @@
"validEmail": "Please enter a valid email", "validEmail": "Please enter a valid email",
"verificationCodeHelp": "Didn't get the email? Check your spam/junk.", "verificationCodeHelp": "Didn't get the email? Check your spam/junk.",
"verificationCodePlaceholder": "Enter your 6-digit code", "verificationCodePlaceholder": "Enter your 6-digit code",
"verificationCodeSent": "A verification code has been sent to <b>{email}</b> <a>Change</a>",
"verifyYourEmail": "Verify your email", "verifyYourEmail": "Verify your email",
"startOfWeek": "Start of week", "startOfWeek": "Start of week",
"weekView": "Week view", "weekView": "Week view",
@ -261,5 +260,6 @@
"advancedSettingsTitle": "Advanced Settings", "advancedSettingsTitle": "Advanced Settings",
"advancedSettingsDescription": "Hide participants, hide scores, require participant email address.", "advancedSettingsDescription": "Hide participants, hide scores, require participant email address.",
"keepPollsIndefinitely": "Keep Polls Indefinitely", "keepPollsIndefinitely": "Keep Polls Indefinitely",
"keepPollsIndefinitelyDescription": "Inactive polls will not be auto-deleted." "keepPollsIndefinitelyDescription": "Inactive polls will not be auto-deleted.",
"verificationCodeSentTo": "We sent a verification code to <b>{{ email }}</b>"
} }

View file

@ -143,9 +143,6 @@ export function LoginForm() {
} }
}} }}
email={getValues("email")} email={getValues("email")}
onChangeEmail={() => {
setEmail(undefined);
}}
/> />
); );
} }

View file

@ -68,9 +68,6 @@ export const RegisterForm = () => {
}); });
}} }}
email={getValues("email")} email={getValues("email")}
onChangeEmail={() => {
setToken(undefined);
}}
/> />
); );
} }

View file

@ -1,4 +1,3 @@
"use client";
import { Button } from "@rallly/ui/button"; import { Button } from "@rallly/ui/button";
import { Input } from "@rallly/ui/input"; import { Input } from "@rallly/ui/input";
import { Trans, useTranslation } from "next-i18next"; import { Trans, useTranslation } from "next-i18next";
@ -22,8 +21,7 @@ export const verifyCode = async (options: { email: string; token: string }) => {
export const VerifyCode: React.FunctionComponent<{ export const VerifyCode: React.FunctionComponent<{
email: string; email: string;
onSubmit: (code: string) => Promise<void>; onSubmit: (code: string) => Promise<void>;
onChangeEmail?: () => void; }> = ({ onSubmit, email }) => {
}> = ({ onSubmit, onChangeEmail, email }) => {
const { register, handleSubmit, setError, formState } = useForm<{ const { register, handleSubmit, setError, formState } = useForm<{
code: string; code: string;
}>(); }>();
@ -54,20 +52,11 @@ export const VerifyCode: React.FunctionComponent<{
<p className="mb-4"> <p className="mb-4">
<Trans <Trans
t={t} t={t}
i18nKey="verificationCodeSent" i18nKey="verificationCodeSentTo"
defaults="We sent a verification code to <b>{{ email }}</b>"
values={{ email }} values={{ email }}
components={{ components={{
b: <strong className="whitespace-nowrap" />, b: <strong className="whitespace-nowrap" />,
a: (
<button
type="button"
role="button"
className="text-link"
onClick={() => {
onChangeEmail?.();
}}
/>
),
}} }}
/> />
</p> </p>