improved email verification experience wording

This commit is contained in:
jackiettran
2025-12-25 23:09:10 -05:00
parent 4f85243815
commit 36cf5b65fa
3 changed files with 31 additions and 26 deletions

View File

@@ -100,26 +100,34 @@ const VerifyEmail: React.FC = () => {
switch (code) {
case "VERIFICATION_EXPIRED":
setError("Your verification code has expired. Please request a new one.");
setError(
"Your verification code has expired. Please request a new code below."
);
setShowManualEntry(true);
break;
case "VERIFICATION_INVALID":
setError("Invalid verification code. Please check and try again.");
setError(
"That code didn't match. Please try again or request a new code below."
);
setShowManualEntry(true);
break;
case "TOO_MANY_ATTEMPTS":
setError("Too many attempts. Please request a new code.");
setError("Too many attempts. Please request a new code below.");
setShowManualEntry(true);
break;
case "ALREADY_VERIFIED":
setError("Your email is already verified.");
break;
case "NO_CODE":
setError("No verification code found. Please request a new one.");
setError(
"No verification code found. Please request a new code below."
);
setShowManualEntry(true);
break;
default:
setError(errorData?.error || "Failed to verify email. Please try again.");
setError(
errorData?.error || "Failed to verify email. Please try again."
);
setShowManualEntry(true);
}
};
@@ -294,7 +302,9 @@ const VerifyEmail: React.FC = () => {
{code.map((digit, index) => (
<input
key={index}
ref={(el) => { inputRefs.current[index] = el; }}
ref={(el) => {
inputRefs.current[index] = el;
}}
type="text"
inputMode="numeric"
maxLength={1}
@@ -343,7 +353,7 @@ const VerifyEmail: React.FC = () => {
? `Resend in ${resendCooldown}s`
: resending
? "Sending..."
: "Resend Code"}
: "Send Code"}
</button>
</div>
@@ -351,10 +361,7 @@ const VerifyEmail: React.FC = () => {
Check your spam folder if you don't see the email.
</p>
<Link
to="/"
className="btn btn-outline-secondary mt-3"
>
<Link to="/" className="btn btn-outline-secondary mt-3">
Return to Home
</Link>
</>