mirror of
https://github.com/Myzel394/kleckrelay-website.git
synced 2025-06-19 07:55:25 +02:00
refactor: Improve i18n for verify email
This commit is contained in:
parent
6370f367ed
commit
e4fdcecbe6
@ -26,19 +26,6 @@
|
|||||||
"title": "Overview",
|
"title": "Overview",
|
||||||
"description": "Not much to see here, yet."
|
"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": {
|
"VerifyEmailRoute": {
|
||||||
"title": "Verify your email",
|
"title": "Verify your email",
|
||||||
"isLoading": "Verifying 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()
|
const emailSchema = yup.string().email()
|
||||||
|
|
||||||
export default function VerifyEmailRoute(): ReactElement {
|
export default function VerifyEmailRoute(): ReactElement {
|
||||||
|
const {t} = useTranslation("verify-email")
|
||||||
const theme = useTheme()
|
const theme = useTheme()
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
const {t} = useTranslation()
|
|
||||||
|
|
||||||
const {login} = useContext(AuthContext)
|
const {login} = useContext(AuthContext)
|
||||||
const [_, setEmail] = useLocalStorage<string>("signup-form-state-email", "")
|
const [_, setEmail] = useLocalStorage<string>("signup-form-state-email", "")
|
||||||
@ -32,7 +32,7 @@ export default function VerifyEmailRoute(): ReactElement {
|
|||||||
const tokenSchema = yup
|
const tokenSchema = yup
|
||||||
.string()
|
.string()
|
||||||
.length(serverSettings.emailVerificationLength)
|
.length(serverSettings.emailVerificationLength)
|
||||||
.test("token", t("routes.VerifyEmailRoute.errors.code.invalid") as string, token => {
|
.test("token", t("errors.invalid") as string, token => {
|
||||||
if (!token) {
|
if (!token) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@ -69,13 +69,13 @@ export default function VerifyEmailRoute(): ReactElement {
|
|||||||
>
|
>
|
||||||
<Grid item>
|
<Grid item>
|
||||||
<Typography variant="h5" component="h1" align="center">
|
<Typography variant="h5" component="h1" align="center">
|
||||||
{t("routes.VerifyEmailRoute.title")}
|
{t("title")}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Grid>
|
</Grid>
|
||||||
{loading ? (
|
{loading ? (
|
||||||
<Grid item>
|
<Grid item>
|
||||||
<Typography variant="subtitle1" component="p" align="center">
|
<Typography variant="subtitle1" component="p" align="center">
|
||||||
{t("routes.VerifyEmailRoute.isLoading")}
|
{t("isLoading")}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Grid>
|
</Grid>
|
||||||
) : (
|
) : (
|
||||||
@ -85,7 +85,7 @@ export default function VerifyEmailRoute(): ReactElement {
|
|||||||
</Grid>
|
</Grid>
|
||||||
<Grid item>
|
<Grid item>
|
||||||
<Typography variant="subtitle1" component="p" align="center">
|
<Typography variant="subtitle1" component="p" align="center">
|
||||||
{t("routes.VerifyEmailRoute.isCodeInvalid")}
|
{t("errors.invalid")}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Grid>
|
</Grid>
|
||||||
</>
|
</>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user