Even cleaner header and auth pages

This commit is contained in:
2025-04-12 02:06:48 +02:00
parent b6f1e3eb8e
commit ab3947b4a9
3 changed files with 96 additions and 6 deletions

View File

@@ -2,7 +2,12 @@ import { AuthPage } from "@refinedev/mui";
import GoogleIcon from "@mui/icons-material/Google";
import DiscordIcon from "../../components/DiscordIcon";
import { useSearchParams, Navigate } from "react-router";
import {useSearchParams, Navigate, Link} from "react-router";
import MuiLink from "@mui/material/Link";
import * as React from "react";
import Typography from "@mui/material/Typography";
import Box from "@mui/material/Box";
import Stack from "@mui/material/Stack";
export const Login = () => {
const [searchParams] = useSearchParams();
@@ -16,6 +21,7 @@ export const Login = () => {
<AuthPage
type="login"
formProps={{ defaultValues: { email: "test@test.te", password: "test" }, }}
rememberMe={false}
providers={[{
name: "google",
label: "Sign in with Google",
@@ -27,6 +33,58 @@ export const Login = () => {
icon: (<DiscordIcon style={{ fontSize: 24, }} />),
},
]}
forgotPasswordLink={
<Stack
sx={{
direction: "row",
display: "flex",
justifyContent: "flex-end",
alignItems: "center",
}}
>
<MuiLink
variant="body2"
color="primary"
fontSize="12px"
component={Link}
underline="none"
to="/auth/forgot-password"
>
Forgot password?
</MuiLink>
</Stack>
}
registerLink={
<Box
sx={{
mt: "24px",
display: "flex",
justifyContent: "center",
alignItems: "center",
}}
>
<Typography
textAlign="center"
variant="body2"
component="span"
fontSize="12px"
>
Dont have an account?
</Typography>
<MuiLink
ml="4px"
fontSize="12px"
variant="body2"
color="primary"
component={Link}
underline="none"
to="/auth/register"
fontWeight="bold"
>
Sign up
</MuiLink>
</Box>
}
/>
);
};