mirror of
https://github.com/Myzel394/kleckrelay-website.git
synced 2025-06-19 07:55:25 +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"
|
"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 {MultiStepForm} from "~/components"
|
||||||
import {ServerSettings} from "~/server-types"
|
import {ServerSettings} from "~/server-types"
|
||||||
import EmailForm from "~/route-widgets/SignupRoute/EmailForm"
|
import EmailForm from "~/route-widgets/SignupRoute/EmailForm"
|
||||||
|
import RegistrationsDisabled from "~/route-widgets/SignupRoute/RegistrationsDisabled"
|
||||||
import YouGotMail from "~/route-widgets/SignupRoute/YouGotMail"
|
import YouGotMail from "~/route-widgets/SignupRoute/YouGotMail"
|
||||||
|
|
||||||
export default function SignupRoute(): ReactElement {
|
export default function SignupRoute(): ReactElement {
|
||||||
@ -13,6 +14,10 @@ export default function SignupRoute(): ReactElement {
|
|||||||
|
|
||||||
const index = email ? 1 : 0
|
const index = email ? 1 : 0
|
||||||
|
|
||||||
|
if (!serverSettings.allowRegistrations) {
|
||||||
|
return <RegistrationsDisabled />
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<MultiStepForm
|
<MultiStepForm
|
||||||
steps={[
|
steps={[
|
||||||
|
@ -85,6 +85,7 @@ export interface ServerSettings {
|
|||||||
publicKey: string
|
publicKey: string
|
||||||
allowAliasDeletion: boolean
|
allowAliasDeletion: boolean
|
||||||
apiKeyMaxDays: number
|
apiKeyMaxDays: number
|
||||||
|
allowRegistrations: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Alias {
|
export interface Alias {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user