3 Commits

Author SHA1 Message Date
Chief Bube b132670152 Changed admin 2023-10-20 06:51:21 -07:00
Chief Bube 39fe9eaaa2 made changes to the auth layout 2023-10-20 06:45:34 -07:00
Chief Bube 5d4cbc7a1c Added wallpaper to the Authentication Page 2023-10-19 04:44:38 -07:00
8 changed files with 150 additions and 39 deletions
+92 -34
View File
@@ -1,13 +1,15 @@
import React from "react"; import React, { useState } from "react";
import Link from "next/link"; import Link from "next/link";
import Grid from "@mui/material/Grid"; import Grid from "@mui/material/Grid";
import IconButton from "@mui/material/IconButton";
import { Typography } from "@mui/material"; import { Typography } from "@mui/material";
import { Box } from "@mui/system"; import { Box } from "@mui/system";
import TextField from "@mui/material/TextField"; import TextField from "@mui/material/TextField";
import InputAdornment from "@mui/material/InputAdornment";
import Button from "@mui/material/Button"; import Button from "@mui/material/Button";
import FormControlLabel from "@mui/material/FormControlLabel"; import Visibility from "@mui/icons-material/Visibility";
import Checkbox from "@mui/material/Checkbox"; import VisibilityOff from "@mui/icons-material/VisibilityOff";
import styles from "@/components/Authentication/Authentication.module.css"; import styles from "./signinform.module.css";
import WrenchBoardLogo from "@/public/images/logos/wrenchboard-logo.png"; import WrenchBoardLogo from "@/public/images/logos/wrenchboard-logo.png";
const SignInForm = () => { const SignInForm = () => {
@@ -20,9 +22,15 @@ const SignInForm = () => {
}); });
}; };
const [showPassword, setShowPassword] = useState(false);
const handleTogglePassword = () => {
setShowPassword(!showPassword);
};
return ( return (
<> <>
<div className="authenticationBox"> <div className={styles.authenticationBox}>
<Box <Box
component="main" component="main"
sx={{ sx={{
@@ -30,6 +38,9 @@ const SignInForm = () => {
ml: "auto", ml: "auto",
mr: "auto", mr: "auto",
padding: "50px 0 100px", padding: "50px 0 100px",
paddingInline: { sm: "10px", lg: "0" },
zIndex: "999",
position: "relative",
}} }}
> >
<Grid item xs={12} md={12} lg={12} xl={12}> <Grid item xs={12} md={12} lg={12} xl={12}>
@@ -38,17 +49,23 @@ const SignInForm = () => {
display="flex" display="flex"
alignItems="center" alignItems="center"
justifyContent="center" justifyContent="center"
mb="60px" mb="70px"
> >
<img <img
src="/images/logos/wrenchboard-logo.png" src="/images/logos/android-chrome-512x512.png"
alt="logo" alt="logo"
className={styles.favicon} className={styles.favicon}
/> />
</Box> </Box>
<Typography as="h1" fontSize="28px" fontWeight="700" mb="5px"> {/* <Typography
as="h1"
fontSize="28px"
fontWeight="700"
mb="5px"
color="#fff"
>
Sign In{" "} Sign In{" "}
</Typography> </Typography> */}
<Box component="form" noValidate onSubmit={handleSubmit}> <Box component="form" noValidate onSubmit={handleSubmit}>
<Box <Box
@@ -62,7 +79,7 @@ const SignInForm = () => {
> >
<Grid container alignItems="center" spacing={2}> <Grid container alignItems="center" spacing={2}>
<Grid item xs={12}> <Grid item xs={12}>
<Typography {/* <Typography
component="label" component="label"
sx={{ sx={{
fontWeight: "500", fontWeight: "500",
@@ -72,7 +89,7 @@ const SignInForm = () => {
}} }}
> >
Email Email
</Typography> </Typography> */}
<TextField <TextField
required required
@@ -84,11 +101,12 @@ const SignInForm = () => {
InputProps={{ InputProps={{
style: { borderRadius: 8 }, style: { borderRadius: 8 },
}} }}
sx={textFieldStyles}
/> />
</Grid> </Grid>
<Grid item xs={12}> <Grid item xs={12}>
<Typography {/* <Typography
component="label" component="label"
sx={{ sx={{
fontWeight: "500", fontWeight: "500",
@@ -98,56 +116,60 @@ const SignInForm = () => {
}} }}
> >
Password Password
</Typography> </Typography> */}
<TextField <TextField
required required
fullWidth fullWidth
name="password" name="password"
label="Password" label="Password"
type="password" type={showPassword ? "text" : "password"}
id="password" id="password"
autoComplete="new-password" autoComplete="new-password"
InputProps={{ InputProps={{
style: { borderRadius: 8 }, style: { borderRadius: 8 },
endAdornment: (
<InputAdornment position="end">
<IconButton
onClick={handleTogglePassword}
sx={{
color: "#4687BA",
"&:hover": {
color: "#4687BA",
},
}}
>
{showPassword ? (
<VisibilityOff />
) : (
<Visibility />
)}
</IconButton>
</InputAdornment>
),
}} }}
sx={textFieldStyles}
/> />
</Grid> </Grid>
</Grid> </Grid>
</Box> </Box>
<Grid container alignItems="center" spacing={2}>
<Grid item xs={6} sm={6}>
<FormControlLabel
control={
<Checkbox value="allowExtraEmails" color="primary" />
}
label="Remember me."
/>
</Grid>
<Grid item xs={6} sm={6} textAlign="end">
<Link
href="/auth/forgot-password"
className="primaryColor text-decoration-none"
>
Forgot your password?
</Link>
</Grid>
</Grid>
<Button <Button
type="submit" type="submit"
fullWidth fullWidth
variant="contained" variant="contained"
sx={{ sx={{
mt: 2, mt: 2,
backgroundColor: "#4687BA",
textTransform: "capitalize", textTransform: "capitalize",
borderRadius: "8px", borderRadius: "8px",
fontWeight: "500", fontWeight: "500",
fontSize: "16px", fontSize: "16px",
padding: "12px 10px", padding: "12px 10px",
color: "#fff !important", color: "#fff !important",
"&:hover": {
backgroundColor: "rgba(70, 135, 186, 0.8)"
},
}} }}
> >
Sign In Sign In
@@ -162,3 +184,39 @@ const SignInForm = () => {
}; };
export default SignInForm; export default SignInForm;
// Custom styles for text fields in sign up
const textFieldStyles = {
"& .MuiOutlinedInput-root": {
"& fieldset": {
borderColor: "#4687BA",
"&:hover": {
borderColor: "#4687BA",
},
},
"&.Mui-focused fieldset": {
borderColor: "#4687BA",
},
},
"& .MuiInputAdornment-positionEnd": {
cursor: "pointer",
},
"& .MuiFormLabel-root": {
color: "#4687BA",
},
"&:hover .MuiFormLabel-root": {
color: "#4687BA",
},
"&.Mui-focused .MuiFormLabel-root": {
color: "#4687BA",
},
"& .MuiInputBase-input": {
color: "#4687BA",
},
"&:hover .MuiInputBase-input": {
color: "#4687BA",
},
"&.Mui-focused .MuiInputBase-input": {
color: "#4687BA",
},
};
+1 -1
View File
@@ -215,7 +215,7 @@ const SignUpForm = () => {
<Button <Button
type="submit" type="submit"
fullWidth fullWidth
variant="contained" // variant="contained"
sx={{ sx={{
mt: 2, mt: 2,
textTransform: "capitalize", textTransform: "capitalize",
@@ -0,0 +1,38 @@
.favicon {
position: relative;
top: 5px;
max-width: 250px;
max-height: 250px;
width: 100%;
height: 100%;
}
.authenticationBox {
width: 100%;
min-height: 100vh;
position: relative;
padding: 1rem;
/* Image */
background-image: url("../../public//images/auth/cms_home.jpg");
background-size: cover;
background-repeat: no-repeat;
background-position: center center;
background-attachment: fixed;
}
.authenticationBox::before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
}
@media (min-width: 600px) {
.authenticationBox {
padding: 1rem;
}
}
+11 -2
View File
@@ -44,7 +44,12 @@ const Layout = ({ children }) => {
<meta name="viewport" content="initial-scale=1.0, width=device-width" /> <meta name="viewport" content="initial-scale=1.0, width=device-width" />
</Head> </Head>
<div className={`main-wrapper-content ${active ? "active" : ""}`}> <div
className={`main-wrapper-content ${active ? "active" : ""}`}
style={{
paddingLeft: isAuthenticationPage && "0",
}}
>
{!isAuthenticationPage && ( {!isAuthenticationPage && (
<> <>
<TopNavbar toggleActive={toggleActive} /> <TopNavbar toggleActive={toggleActive} />
@@ -52,7 +57,11 @@ const Layout = ({ children }) => {
</> </>
)} )}
<div className="main-content">{children}</div> <div
className={`main-content ${isAuthenticationPage ? "authBox" : ""}`}
>
{children}
</div>
{!isAuthenticationPage && <Footer />} {!isAuthenticationPage && <Footer />}
</div> </div>
+2 -2
View File
@@ -11,10 +11,10 @@ const AuthRoute = ({ children }) => {
const router = useRouter(); const router = useRouter();
useEffect(() => { useEffect(() => {
const isAuthenticated = true; // In a real application, this would be determined based on the user's authentication status. const isAuthenticated = false; // In a real application, this would be determined based on the user's authentication status.
if (!isAuthenticated) { if (!isAuthenticated) {
router.push("/auth/"); router.push("/auth/sign-in");
} }
}, [router]); }, [router]);
Binary file not shown.

After

Width:  |  Height:  |  Size: 443 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

+6
View File
@@ -13,6 +13,7 @@
--fontSize: 15px; --fontSize: 15px;
--transition: all ease .5s; --transition: all ease .5s;
--box-shadow: 0 0 20px 3px rgba(0, 0, 0, 0.05); --box-shadow: 0 0 20px 3px rgba(0, 0, 0, 0.05);
--mobile-auth-padding: 0;
} }
html, body { html, body {
@@ -817,12 +818,17 @@ img {
padding-right: 30px; padding-right: 30px;
} }
.main-wrapper-content .main-content.authBox{
padding: 0px !important;
}
@media only screen and (max-width: 767px) { @media only screen and (max-width: 767px) {
.main-wrapper-content .main-content { .main-wrapper-content .main-content {
padding-left: 15px !important; padding-left: 15px !important;
padding-right: 15px !important; padding-right: 15px !important;
} }
} }
@media only screen and (max-width: 1199px) { @media only screen and (max-width: 1199px) {
.main-wrapper-content { .main-wrapper-content {
padding: 0; padding: 0;