mirror of
https://github.com/Myzel394/kleckrelay-website.git
synced 2025-06-18 23:45:26 +02:00
feat: Show RegistrationsDisabled on login page
This commit is contained in:
parent
7a2df877b7
commit
4049117a01
@ -14,5 +14,10 @@
|
||||
"continueActionLabel": "Yes, edit email"
|
||||
}
|
||||
}
|
||||
},
|
||||
"registrationsDisabled": {
|
||||
"title": "Registrations are disabled",
|
||||
"description": "We are sorry, but registrations on this instance are disabled.",
|
||||
"login": "Login"
|
||||
}
|
||||
}
|
||||
|
40
src/route-widgets/SignupRoute/RegistrationsDisabled.tsx
Normal file
40
src/route-widgets/SignupRoute/RegistrationsDisabled.tsx
Normal file
@ -0,0 +1,40 @@
|
||||
import {ReactElement} from "react"
|
||||
import {Link} from "react-router-dom"
|
||||
import {useTranslation} from "react-i18next"
|
||||
|
||||
import {Box, Button, Grid, Paper, Typography} from "@mui/material"
|
||||
|
||||
export default function RegistrationsDisabled(): ReactElement {
|
||||
const {t} = useTranslation("signup")
|
||||
|
||||
return (
|
||||
<Paper>
|
||||
<Box maxWidth="sm">
|
||||
<Grid
|
||||
container
|
||||
spacing={4}
|
||||
padding={4}
|
||||
alignItems="center"
|
||||
justifyContent="center"
|
||||
flexDirection="column"
|
||||
>
|
||||
<Grid item>
|
||||
<Typography variant="h4" align="center">
|
||||
{t("registrationsDisabled.title")}
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item>
|
||||
<Typography variant="body1" align="center">
|
||||
{t("registrationsDisabled.description")}
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item>
|
||||
<Button component={Link} to="/auth/login" variant="contained">
|
||||
{t("registrationsDisabled.login")}
|
||||
</Button>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Box>
|
||||
</Paper>
|
||||
)
|
||||
}
|
@ -5,6 +5,7 @@ import {useLoaderData} from "react-router-dom"
|
||||
import {MultiStepForm} from "~/components"
|
||||
import {ServerSettings} from "~/server-types"
|
||||
import EmailForm from "~/route-widgets/SignupRoute/EmailForm"
|
||||
import RegistrationsDisabled from "~/route-widgets/SignupRoute/RegistrationsDisabled"
|
||||
import YouGotMail from "~/route-widgets/SignupRoute/YouGotMail"
|
||||
|
||||
export default function SignupRoute(): ReactElement {
|
||||
@ -13,6 +14,10 @@ export default function SignupRoute(): ReactElement {
|
||||
|
||||
const index = email ? 1 : 0
|
||||
|
||||
if (!serverSettings.allowRegistrations) {
|
||||
return <RegistrationsDisabled />
|
||||
}
|
||||
|
||||
return (
|
||||
<MultiStepForm
|
||||
steps={[
|
||||
|
@ -85,6 +85,7 @@ export interface ServerSettings {
|
||||
publicKey: string
|
||||
allowAliasDeletion: boolean
|
||||
apiKeyMaxDays: number
|
||||
allowRegistrations: boolean
|
||||
}
|
||||
|
||||
export interface Alias {
|
||||
|
Loading…
x
Reference in New Issue
Block a user