feat: Enhance Login page design and fix UI details

This commit is contained in:
karenvicent committed 2025-07-31 16:32:30 -04:00
1 parent f934bbf829
commit 2e675f5dee
8 files changed
+130 -31

No files matched your search

@@ -17,6 +17,7 @@ const FallbackActionButtons = ({ link, type }) => {
<Button <Button
variant="contained" variant="contained"
color="accent" color="accent"
sx={{ fontWeight: 700 }}
onClick={() => navigate(link)} onClick={() => navigate(link)}
> >
{t(`${type}.fallback.actionButton`)} {t(`${type}.fallback.actionButton`)}
@@ -1,7 +1,7 @@
import { useTheme } from "@emotion/react"; import { useTheme } from "@emotion/react";
import { Box, Stack } from "@mui/material"; import { Box, Stack } from "@mui/material";
import Skeleton from "../../assets/Images/create-placeholder.svg?react"; import OutputAnimation from "../../assets/Animations/output.gif";
import SkeletonDark from "../../assets/Images/create-placeholder-dark.svg?react"; import DarkmodeOutput from "../../assets/Animations/darkmodeOutput.gif";
import Background from "../../assets/Images/background-grid.svg?react"; import Background from "../../assets/Images/background-grid.svg?react";
import { useSelector } from "react-redux"; import { useSelector } from "react-redux";
@@ -37,11 +37,18 @@ const GenericFallback = ({ children }) => {
marginTop: "100px", marginTop: "100px",
}} }}
> >
{mode === "light" ? ( <Box
<Skeleton style={{ zIndex: 1 }} /> component="img"
) : ( src={mode === "light" ? OutputAnimation : DarkmodeOutput}
<SkeletonDark style={{ zIndex: 1 }} /> Background="transparent"
)} alt="Loading animation"
sx={{
zIndex: 1,
border: "none",
borderRadius: theme.spacing(8),
width: "100%",
}}
/>
<Box <Box
sx={{ sx={{
"& svg g g:last-of-type path": { "& svg g g:last-of-type path": {
+3
View File
@@ -70,6 +70,9 @@ const DataTable = ({
backgroundColor: theme.palette.primary.main, backgroundColor: theme.palette.primary.main,
color: theme.palette.primary.contrastTextSecondary, color: theme.palette.primary.contrastTextSecondary,
}, },
"& .MuiTableBody-root .MuiTableRow-root:last-child .MuiTableCell-root": {
borderBottom: "none",
},
}} }}
> >
<TableHead> <TableHead>
+90 -18
View File
@@ -7,7 +7,9 @@ import { PasswordEndAdornment } from "../../../Components/Inputs/TextInput/Adorn
import { loginCredentials } from "../../../Validation/validation"; import { loginCredentials } from "../../../Validation/validation";
import TextLink from "../../../Components/TextLink"; import TextLink from "../../../Components/TextLink";
import Typography from "@mui/material/Typography"; import Typography from "@mui/material/Typography";
import Box from "@mui/material/Box";
import Logo from "../../../assets/icons/checkmate-icon.svg?react";
import Background from "../../../assets/Images/background-grid.svg?react";
// Utils // Utils
import { login } from "../../../Features/Auth/authSlice"; import { login } from "../../../Features/Auth/authSlice";
import { useNavigate } from "react-router-dom"; import { useNavigate } from "react-router-dom";
@@ -92,34 +94,105 @@ const Login = () => {
<Stack <Stack
gap={theme.spacing(10)} gap={theme.spacing(10)}
minHeight="100vh" minHeight="100vh"
position="relative"
backgroundColor={theme.palette.primary.main}
sx={{ overflow: "hidden" }}
> >
<AuthHeader /> <Box
<Stack sx={{
margin="auto" position: "absolute",
width="100%" top: 0,
alignItems="center" left: "0%",
gap={theme.spacing(10)} transform: "translate(-40%, -40%)",
zIndex: 0,
width: "100%",
height: "100%",
"& svg g g:last-of-type path": {
stroke: theme.palette.primary.lowContrast,
},
}}
> >
<Typography variant="h1">{t("auth.login.heading")}</Typography> <Background style={{ width: "100%" }} />
</Box>
<Box
sx={{
position: "absolute",
bottom: 0,
right: 0,
transform: "translate(45%, 55%)",
zIndex: 0,
width: "100%",
height: "100%",
"& svg g g:last-of-type path": {
stroke: theme.palette.primary.lowContrast,
},
}}
>
<Background style={{ width: "100%" }} />
</Box>
<AuthHeader hideLogo={true} />
<Stack
backgroundColor={theme.palette.primary.main}
sx={{
borderRadius: theme.spacing(8),
boxShadow: theme.palette.tertiary.cardShadow,
margin: "auto",
alignItems: "center",
gap: theme.spacing(10),
padding: theme.spacing(20),
zIndex: 1,
position: "relative",
width: {
sm: "60%",
md: "50%",
lg: "40%",
xl: "30%",
},
}}
>
<Box
mb={theme.spacing(10)}
mt={theme.spacing(5)}
>
<Box
sx={{
width: { xs: 60, sm: 80, md: 90 },
}}
/>
<Logo style={{ width: "100%", height: "100%" }} />
</Box>
<Stack
mb={theme.spacing(12)}
textAlign="center"
>
<Typography
variant="h1"
mb={theme.spacing(2)}
>
{t("auth.login.welcome")}
</Typography>
<Typography variant="h1">{t("auth.login.heading")}</Typography>
</Stack>
<Stack <Stack
component="form" component="form"
width="100%" width="100%"
maxWidth={600} padding={theme.spacing(8)}
alignSelf="center"
justifyContent="center"
borderRadius={theme.spacing(5)}
borderColor={theme.palette.primary.lowContrast}
backgroundColor={theme.palette.primary.main}
padding={theme.spacing(12)}
gap={theme.spacing(12)} gap={theme.spacing(12)}
onSubmit={onSubmit} onSubmit={onSubmit}
sx={{
width: {
sm: "80%",
md: "70%",
lg: "65%",
xl: "65%",
},
}}
> >
<TextInput <TextInput
type="email" type="email"
name="email" name="email"
label={t("auth.common.inputs.email.label")} label={t("auth.common.inputs.email.label")}
isRequired={true}
placeholder={t("auth.common.inputs.email.placeholder")} placeholder={t("auth.common.inputs.email.placeholder")}
autoComplete="email" autoComplete="email"
value={form.email} value={form.email}
@@ -131,7 +204,6 @@ const Login = () => {
type="password" type="password"
name="password" name="password"
label={t("auth.common.inputs.password.label")} label={t("auth.common.inputs.password.label")}
isRequired={true}
placeholder="••••••••••" placeholder="••••••••••"
autoComplete="current-password" autoComplete="current-password"
value={form.password} value={form.password}
@@ -144,7 +216,7 @@ const Login = () => {
variant="contained" variant="contained"
color="accent" color="accent"
type="submit" type="submit"
sx={{ width: "30%", alignSelf: "flex-end" }} sx={{ width: "100%", alignSelf: "center", fontWeight: 700 }}
> >
Login Login
</Button> </Button>
@@ -9,7 +9,7 @@ import ThemeSwitch from "../../../Components/ThemeSwitch";
import { useTheme } from "@mui/material/styles"; import { useTheme } from "@mui/material/styles";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
const AuthHeader = () => { const AuthHeader = ({ hideLogo = false }) => {
// Hooks // Hooks
const theme = useTheme(); const theme = useTheme();
const { t } = useTranslation(); const { t } = useTranslation();
@@ -27,8 +27,12 @@ const AuthHeader = () => {
alignItems="center" alignItems="center"
gap={theme.spacing(4)} gap={theme.spacing(4)}
> >
<Logo style={{ borderRadius: theme.shape.borderRadius }} /> {!hideLogo && (
<Typography sx={{ userSelect: "none" }}>{t("common.appName")}</Typography> <>
<Logo style={{ borderRadius: theme.shape.borderRadius }} />
<Typography sx={{ userSelect: "none" }}>{t("common.appName")}</Typography>
</>
)}
</Stack> </Stack>
<Stack <Stack
direction="row" direction="row"
+4
View File
@@ -216,6 +216,10 @@ const newSemanticColors = {
light: newColors.gray500, light: newColors.gray500,
dark: newColors.blueGray600, dark: newColors.blueGray600,
}, },
cardShadow: {
light: "0 0 0 1px rgba(0, 0, 0, 0.04), 0 12px 24px rgba(0, 0, 0, 0.08)",
dark: "0 2px 10px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.04)",
},
}, },
success: { success: {
main: { main: {
+8 -1
View File
@@ -61,7 +61,6 @@ const baseTheme = (palette) => ({
style: { style: {
backgroundColor: theme.palette.accent.main, backgroundColor: theme.palette.accent.main,
color: theme.palette.primary.contrastTextSecondaryDarkBg, color: theme.palette.primary.contrastTextSecondaryDarkBg,
fontWeight: 700,
letterSpacing: "0.5px", letterSpacing: "0.5px",
textShadow: "0 0 1px rgba(0, 0, 0, 0.15)", textShadow: "0 0 1px rgba(0, 0, 0, 0.15)",
"&:hover": { "&:hover": {
@@ -723,6 +722,14 @@ const baseTheme = (palette) => ({
}, },
], ],
}, },
MuiTooltip: {
styleOverrides: {
tooltip: () => ({
fontSize: typographyLevels.m,
}),
},
},
}, },
shape: { shape: {
borderRadius: 2, borderRadius: 2,
+3 -2
View File
@@ -154,7 +154,7 @@
"incorrect": "The password you provided does not match our records" "incorrect": "The password you provided does not match our records"
} }
}, },
"heading": "Log In", "heading": "Log in to continue",
"links": { "links": {
"forgotPassword": "Forgot password?", "forgotPassword": "Forgot password?",
"forgotPasswordLink": "Reset password", "forgotPasswordLink": "Reset password",
@@ -168,7 +168,8 @@
"toasts": { "toasts": {
"incorrectPassword": "Incorrect password", "incorrectPassword": "Incorrect password",
"success": "Welcome back! You're successfully logged in." "success": "Welcome back! You're successfully logged in."
} },
"welcome": "Welcome back to Checkmate!"
}, },
"registration": { "registration": {
"description": { "description": {