mirror of
https://github.com/Myzel394/kleckrelay-website.git
synced 2025-06-18 23:45:26 +02:00
refactor: Improve i18n for verify email
This commit is contained in:
parent
6370f367ed
commit
e4fdcecbe6
@ -26,19 +26,6 @@
|
||||
"title": "Overview",
|
||||
"description": "Not much to see here, yet."
|
||||
},
|
||||
"SignupRoute": {
|
||||
"forms": {
|
||||
"mailVerification": {
|
||||
"title": "You got mail!",
|
||||
"description": "We sent you an email with a link to confirm your email address. Please check your inbox and click on the link to continue.",
|
||||
"editEmail": {
|
||||
"title": "Edit email address?",
|
||||
"description": "Would you like to return to the previous step and edit your email address?",
|
||||
"continueAction": "Yes, edit email"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"VerifyEmailRoute": {
|
||||
"title": "Verify your email",
|
||||
"isLoading": "Verifying your email...",
|
||||
|
7
public/locales/en-US/verify-email.json
Normal file
7
public/locales/en-US/verify-email.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"title": "Verify your email",
|
||||
"isLoading": "We are verifying your email address...",
|
||||
"errors": {
|
||||
"invalid": "The verification link is invalid or has expired."
|
||||
}
|
||||
}
|
@ -17,9 +17,9 @@ import {AuthContext} from "~/components"
|
||||
const emailSchema = yup.string().email()
|
||||
|
||||
export default function VerifyEmailRoute(): ReactElement {
|
||||
const {t} = useTranslation("verify-email")
|
||||
const theme = useTheme()
|
||||
const navigate = useNavigate()
|
||||
const {t} = useTranslation()
|
||||
|
||||
const {login} = useContext(AuthContext)
|
||||
const [_, setEmail] = useLocalStorage<string>("signup-form-state-email", "")
|
||||
@ -32,7 +32,7 @@ export default function VerifyEmailRoute(): ReactElement {
|
||||
const tokenSchema = yup
|
||||
.string()
|
||||
.length(serverSettings.emailVerificationLength)
|
||||
.test("token", t("routes.VerifyEmailRoute.errors.code.invalid") as string, token => {
|
||||
.test("token", t("errors.invalid") as string, token => {
|
||||
if (!token) {
|
||||
return false
|
||||
}
|
||||
@ -69,13 +69,13 @@ export default function VerifyEmailRoute(): ReactElement {
|
||||
>
|
||||
<Grid item>
|
||||
<Typography variant="h5" component="h1" align="center">
|
||||
{t("routes.VerifyEmailRoute.title")}
|
||||
{t("title")}
|
||||
</Typography>
|
||||
</Grid>
|
||||
{loading ? (
|
||||
<Grid item>
|
||||
<Typography variant="subtitle1" component="p" align="center">
|
||||
{t("routes.VerifyEmailRoute.isLoading")}
|
||||
{t("isLoading")}
|
||||
</Typography>
|
||||
</Grid>
|
||||
) : (
|
||||
@ -85,7 +85,7 @@ export default function VerifyEmailRoute(): ReactElement {
|
||||
</Grid>
|
||||
<Grid item>
|
||||
<Typography variant="subtitle1" component="p" align="center">
|
||||
{t("routes.VerifyEmailRoute.isCodeInvalid")}
|
||||
{t("errors.invalid")}
|
||||
</Typography>
|
||||
</Grid>
|
||||
</>
|
||||
|
Loading…
x
Reference in New Issue
Block a user