This commit is contained in:
Malai Raja
2023-11-27 19:09:26 +05:30
parent 7113ac0681
commit b3371d3bc0
20 changed files with 3176 additions and 2314 deletions

2
.env
View File

@@ -27,3 +27,5 @@ REACT_APP_AWS_APP_CLIENT_ID=
REACT_APP_AUTH0_CLIENT_ID= REACT_APP_AUTH0_CLIENT_ID=
REACT_APP_AUTH0_DOMAIN= REACT_APP_AUTH0_DOMAIN=
DISABLE_ESLINT_PLUGIN=true

BIN
public/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@@ -1,16 +0,0 @@
<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M1.63954 13.3644L3.95187 11.052L3.95428 11.0496H8.30453L6.5736 12.7806L6.12669 13.2275L4.35415 15L4.57368 15.2201L14.5039 25.1498L24.6537 15L22.8805 13.2275L22.7557 13.102L20.7033 11.0496H25.0535L25.0559 11.052L26.8683 12.8644L29.0039 15L14.5039 29.5L0.00390625 15L1.63954 13.3644ZM14.5039 0.5L22.8823 8.87842H18.5321L14.5039 4.85024L10.4757 8.87842H6.12548L14.5039 0.5Z" fill="#096DD9"/>
<path d="M4.35477 15.0002L6.12731 13.2276L6.57422 12.7807L4.84389 11.0498H3.9549L3.95249 11.0522L1.64016 13.3645L3.85961 15.5731L4.35477 15.0002Z" fill="url(#paint0_linear_112102_1824)"/>
<path d="M22.8814 13.2276L24.6545 15.0002L24.479 15.1757L24.4796 15.1763L26.8691 12.8646L25.0568 11.0522L25.0544 11.0498H24.8783L22.7565 13.1022L22.8814 13.2276Z" fill="url(#paint1_linear_112102_1824)"/>
<path d="M3.9497 11.0498L3.95211 11.0522L6.12693 13.2276L14.5041 21.6043L25.0586 11.0498H3.9497Z" fill="#1890FF"/>
<defs>
<linearGradient id="paint0_linear_112102_1824" x1="5.62978" y1="11.5889" x2="2.57161" y2="14.6471" gradientUnits="userSpaceOnUse">
<stop stop-color="#023B95"/>
<stop offset="0.9637" stop-color="#096CD9" stop-opacity="0"/>
</linearGradient>
<linearGradient id="paint1_linear_112102_1824" x1="23.2722" y1="11.6281" x2="25.7451" y2="14.4382" gradientUnits="userSpaceOnUse">
<stop stop-color="#023B95"/>
<stop offset="1" stop-color="#096DD9" stop-opacity="0"/>
</linearGradient>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -2,7 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.svg" /> <link rel="icon" href="%PUBLIC_URL%/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" /> <meta name="theme-color" content="#000000" />
<meta name="description" content="Web site created using create-react-app" /> <meta name="description" content="Web site created using create-react-app" />
@@ -17,7 +17,7 @@
work correctly both with client-side routing and a non-root public URL. work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`. Learn how to configure a non-root public URL by running `npm run build`.
--> -->
<title>Mantis React Admin Dashboard</title> <title>Nearle Express</title>
<link rel="preconnect" href="https://fonts.gstatic.com" /> <link rel="preconnect" href="https://fonts.gstatic.com" />
<link <link

View File

@@ -6,29 +6,40 @@ import Locales from 'components/Locales';
import ScrollTop from 'components/ScrollTop'; import ScrollTop from 'components/ScrollTop';
import Snackbar from 'components/@extended/Snackbar'; import Snackbar from 'components/@extended/Snackbar';
import Notistack from 'components/third-party/Notistack'; import Notistack from 'components/third-party/Notistack';
import { useNavigate } from 'react-router';
import { useEffect } from 'react';
// auth-provider // auth-provider
import { JWTProvider as AuthProvider } from 'contexts/JWTContext'; // import { JWTProvider as AuthProvider } from 'contexts/JWTContext';
// ==============================|| APP - THEME, ROUTER, LOCAL ||============================== // // ==============================|| APP - THEME, ROUTER, LOCAL ||============================== //
const App = () => ( const App = () =>{
let navigate=useNavigate()
// useEffect(()=>{
// if (!localStorage.getItem("firstname")) {
// navigate('/login')
// }
// },[])
return <>
<ThemeCustomization> <ThemeCustomization>
{/* <RTLLayout> */} {/* <RTLLayout> */}
<Locales> <Locales>
<ScrollTop> <ScrollTop>
<AuthProvider> {/* <AuthProvider> */}
<> <>
<Notistack> <Notistack>
<Routes /> <Routes />
<Snackbar /> <Snackbar />
</Notistack> </Notistack>
</> </>
</AuthProvider> {/* </AuthProvider> */}
</ScrollTop> </ScrollTop>
</Locales> </Locales>
{/* </RTLLayout> */} {/* </RTLLayout> */}
</ThemeCustomization> </ThemeCustomization>
); </>
}
export default App; export default App;

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@@ -20,6 +20,7 @@ const initialState = {
isLoggedIn: false, isLoggedIn: false,
isInitialized: false, isInitialized: false,
user: null user: null
}; };
const verifyToken = (serviceToken) => { const verifyToken = (serviceToken) => {
@@ -52,30 +53,31 @@ export const JWTProvider = ({ children }) => {
useEffect(() => { useEffect(() => {
const init = async () => { const init = async () => {
try { console.log(verifyToken)
const serviceToken = window.localStorage.getItem('serviceToken'); // try {
if (serviceToken && verifyToken(serviceToken)) { // const serviceToken = window.localStorage.getItem('serviceToken');
setSession(serviceToken); // if (serviceToken && verifyToken(serviceToken)) {
const response = await axios.get('/api/account/me'); // setSession(serviceToken);
const { user } = response.data; // const response = await axios.get('/api/account/me');
dispatch({ // const { user } = response.data;
type: LOGIN, // dispatch({
payload: { // type: LOGIN,
isLoggedIn: true, // payload: {
user // isLoggedIn: true,
} // user
}); // }
} else { // });
dispatch({ // } else {
type: LOGOUT // dispatch({
}); // type: LOGOUT
} // });
} catch (err) { // }
console.error(err); // } catch (err) {
dispatch({ // console.error(err);
type: LOGOUT // dispatch({
}); // type: LOGOUT
} // });
// }
}; };
init(); init();

View File

@@ -26,7 +26,7 @@ const DrawerContent = () => {
}} }}
> >
<Navigation /> <Navigation />
{drawerOpen && !matchDownMD && <NavCard />} {/* {drawerOpen && !matchDownMD && <NavCard />} */}
</SimpleBar> </SimpleBar>
); );
}; };

View File

@@ -11,6 +11,8 @@ import Logo from 'components/logo';
import { MenuOrientation } from 'config'; import { MenuOrientation } from 'config';
import useConfig from 'hooks/useConfig'; import useConfig from 'hooks/useConfig';
import logo from 'assets/images/logo-nearle.png'
import logo1 from 'assets/images/logo-sm.png'
// ==============================|| DRAWER HEADER ||============================== // // ==============================|| DRAWER HEADER ||============================== //
const DrawerHeader = ({ open }) => { const DrawerHeader = ({ open }) => {
@@ -32,7 +34,14 @@ const DrawerHeader = ({ open }) => {
paddingLeft: isHorizontal ? { xs: '24px', lg: '0' } : open ? '24px' : 0 paddingLeft: isHorizontal ? { xs: '24px', lg: '0' } : open ? '24px' : 0
}} }}
> >
<Logo isIcon={!open} sx={{ width: open ? 'auto' : 35, height: 35 }} /> {/* <Logo isIcon={!open} sx={{ width: open ? 'auto' : 35, height: 35 }} /> */}
{(open) &&
<img src={logo} width='160px' height='45px' alt='logo'/>
}
{(!open) &&
<img src={logo1} width='40px' alt='logo'/>
}
</DrawerHeaderStyled> </DrawerHeaderStyled>
); );
}; };

View File

@@ -6,11 +6,13 @@ import { List, ListItemButton, ListItemIcon, ListItemText } from '@mui/material'
// assets // assets
import { EditOutlined, ProfileOutlined, LogoutOutlined, UserOutlined, WalletOutlined } from '@ant-design/icons'; import { EditOutlined, ProfileOutlined, LogoutOutlined, UserOutlined, WalletOutlined } from '@ant-design/icons';
import { useNavigate } from 'react-router';
// ==============================|| HEADER PROFILE - PROFILE TAB ||============================== // // ==============================|| HEADER PROFILE - PROFILE TAB ||============================== //
const ProfileTab = ({ handleLogout }) => { const ProfileTab = ({ handleLogout }) => {
const [selectedIndex, setSelectedIndex] = useState(0); const [selectedIndex, setSelectedIndex] = useState(0);
const navigate=useNavigate();
const handleListItemClick = (event, index) => { const handleListItemClick = (event, index) => {
setSelectedIndex(index); setSelectedIndex(index);
}; };
@@ -42,7 +44,12 @@ const ProfileTab = ({ handleLogout }) => {
</ListItemIcon> </ListItemIcon>
<ListItemText primary="Billing" /> <ListItemText primary="Billing" />
</ListItemButton> </ListItemButton>
<ListItemButton selected={selectedIndex === 2} onClick={handleLogout}> <ListItemButton selected={selectedIndex === 2}
// onClick={handleLogout}
onClick={()=>{
navigate('/login')
}}
>
<ListItemIcon> <ListItemIcon>
<LogoutOutlined /> <LogoutOutlined />
</ListItemIcon> </ListItemIcon>

View File

@@ -15,7 +15,7 @@ import Transitions from 'components/@extended/Transitions';
import IconButton from 'components/@extended/IconButton'; import IconButton from 'components/@extended/IconButton';
import { ThemeMode } from 'config'; import { ThemeMode } from 'config';
import useAuth from 'hooks/useAuth'; // import useAuth from 'hooks/useAuth';
// assets // assets
import avatar1 from 'assets/images/users/avatar-1.png'; import avatar1 from 'assets/images/users/avatar-1.png';
@@ -49,7 +49,7 @@ const Profile = () => {
const theme = useTheme(); const theme = useTheme();
const navigate = useNavigate(); const navigate = useNavigate();
const { logout, user } = useAuth(); // const { logout, user } = useAuth();
const handleLogout = async () => { const handleLogout = async () => {
try { try {
await logout(); await logout();
@@ -105,7 +105,9 @@ const Profile = () => {
> >
<Stack direction="row" spacing={2} alignItems="center" sx={{ p: 0.5 }}> <Stack direction="row" spacing={2} alignItems="center" sx={{ p: 0.5 }}>
<Avatar alt="profile user" src={avatar1} size="xs" /> <Avatar alt="profile user" src={avatar1} size="xs" />
<Typography variant="subtitle1">{user?.name}</Typography> <Typography variant="subtitle1">
{/* {user?.name} */}
</Typography>
</Stack> </Stack>
</ButtonBase> </ButtonBase>
<Popper <Popper
@@ -147,7 +149,9 @@ const Profile = () => {
<Stack direction="row" spacing={1.25} alignItems="center"> <Stack direction="row" spacing={1.25} alignItems="center">
<Avatar alt="profile user" src={avatar1} sx={{ width: 32, height: 32 }} /> <Avatar alt="profile user" src={avatar1} sx={{ width: 32, height: 32 }} />
<Stack> <Stack>
<Typography variant="h6">{user?.name}</Typography> <Typography variant="h6">
{/* {user?.name} */}
</Typography>
<Typography variant="body2" color="textSecondary"> <Typography variant="body2" color="textSecondary">
UI/UX Designer UI/UX Designer
</Typography> </Typography>

View File

@@ -1,7 +1,7 @@
import { useMemo } from 'react'; import { useMemo } from 'react';
// material-ui // material-ui
import { Box, useMediaQuery } from '@mui/material'; import { Box, useMediaQuery ,Stack} from '@mui/material';
// project import // project import
import Search from './Search'; import Search from './Search';
@@ -21,7 +21,10 @@ const HeaderContent = () => {
return ( return (
<> <>
{!matchesXs && <Search />} {/* {!matchesXs && <Search />} */}
<Stack
width='100%'
direction='row' justifyContent='flex-end' spacing={2} alignItems='center'>
{!matchesXs && megaMenu} {!matchesXs && megaMenu}
{matchesXs && <Box sx={{ width: '100%', ml: 1 }} />} {matchesXs && <Box sx={{ width: '100%', ml: 1 }} />}
@@ -29,6 +32,7 @@ const HeaderContent = () => {
<Message /> <Message />
{!matchesXs && <Profile />} {!matchesXs && <Profile />}
{matchesXs && <MobileSection />} {matchesXs && <MobileSection />}
</Stack>
</> </>
); );
}; };

View File

@@ -35,35 +35,35 @@ const other = {
type: 'group', type: 'group',
children: [ children: [
{ {
id: 'sample-page', id: 'dashboard',
title: <FormattedMessage id="sample-page" />, title: <FormattedMessage id="Dashboard" />,
type: 'item', type: 'item',
url: '/sample-page', url: '/dashboard',
icon: icons.ChromeOutlined icon: icons.ChromeOutlined
}, },
{ // {
id: 'documentation', // id: 'documentation',
title: <FormattedMessage id="documentation" />, // title: <FormattedMessage id="documentation" />,
type: 'item', // type: 'item',
url: 'https://links.codedthemes.com/BQFrl', // url: 'https://links.codedthemes.com/BQFrl',
icon: icons.QuestionOutlined, // icon: icons.QuestionOutlined,
external: true, // external: true,
target: true, // target: true,
chip: { // chip: {
label: 'gitbook', // label: 'gitbook',
color: 'secondary', // color: 'secondary',
size: 'small' // size: 'small'
} // }
}, // },
{ // {
id: 'roadmap', // id: 'roadmap',
title: <FormattedMessage id="roadmap" />, // title: <FormattedMessage id="roadmap" />,
type: 'item', // type: 'item',
url: 'https://links.codedthemes.com/RXnKQ', // url: 'https://links.codedthemes.com/RXnKQ',
icon: icons.DeploymentUnitOutlined, // icon: icons.DeploymentUnitOutlined,
external: true, // external: true,
target: true // target: true
} // }
] ]
}; };

View File

@@ -0,0 +1,10 @@
const Dashboard=()=>{
return <>
<h1>Dashboard</h1>
</>
}
export default Dashboard;

494
src/pages/nearle/login.js Normal file
View File

@@ -0,0 +1,494 @@
import { useState, useEffect } from 'react'
// import { useSelector } from 'react-redux';
// import AuthWrapper from 'sections/auth/AuthWrapper';
import {
Box, Grid, Card,
CardContent,
// CardHeader,
Stack,
// Divider,
// InputLabel,
// OutlinedInput,
TextField,
Button,
Typography,
CardHeader,
Container,
Link
} from '@mui/material'
import { useTheme } from '@mui/material/styles';
import AnimateButton from 'components/@extended/AnimateButton';
import logo from 'assets/images/logo-nearle.png'
import axios from 'axios'
import { useNavigate } from 'react-router-dom'
// import { openSnackbar } from 'store/reducers/snackbar';
// import { useDispatch } from 'react-redux';
import Loader from 'components/Loader';
import { enqueueSnackbar } from 'notistack';
const Login = () => {
const theme = useTheme();
const [username, setUsername] = useState('');
const [password, setPassword] = useState('');
const [alertmessage, setAlertmessage] = useState('');
const [checkusername, setCheckusername] = useState(false);
// const [toast, setToast] = useState(false);
const [loading, setLoading] = useState(false);
let navigate = useNavigate();
// let dispatch = useDispatch();
const [submitting, setSubmitting] = useState(false)
// let loginuserid = useSelector((state)=>state.logininfo);
// useEffect(() => {
// if (alertmessage) {
// dispatch(
// openSnackbar({
// open: true,
// message: alertmessage,
// variant: 'alert',
// anchorOrigin: { vertical: 'top', horizontal: 'right' },
// alert: {
// // variant:'info',
// color: 'error',
// }
// })
// )
// }
// }, [toast])
useEffect(() => {
if (localStorage.getItem("firstname") || localStorage.getItem("appuserid")) {
navigate('/dashboard')
}
console.log(alertmessage)
}, [])
const usernamecheck = async (e) => {
e.preventDefault();
setUsername(e.target.value)
if (e.target.value) {
try {
// await axios.post(`${process.env.REACT_APP_URL}/auth/login`, {
// "authname": e.target.value
// })
await axios.post(`${process.env.REACT_APP_URL2}/users/login`, {
"authname": e.target.value,
"configid":3,
// "password":'admi'
})
.then((res) => {
console.log(res.data);
if (res.data.userinfo.authname === e.target.value) {
setUsername(e.target.value);
setCheckusername(false);
}
// if (res.data.authname === e.target.value) {
// setUsername(e.target.value);
// setCheckusername(false);
// }
}).catch((err) => {
if (err.response.data.message === 'No user found') {
setCheckusername(true);
}
})
} catch (err) {
console.log(err)
}
}
}
const loginsend = async () => {
// e.preventDefault();
setLoading(true)
if (password && username) {
setSubmitting(true)
try {
await axios.post(`${process.env.REACT_APP_URL2}/users/login`, {
"authname": username,
"configid":3,
"password": password
}).then((res) => {
console.log(res.data)
if (res.data.userinfo.authname === username) {
// setAlertmessage('login Successfull');
setLoading(false)
// dispatch(
// openSnackbar({
// open: true,
// message: 'login Successfull',
// variant: 'alert',
// anchorOrigin: { vertical: 'top', horizontal: 'right' },
// alert: {
// color: 'success'
// }
// })
// )
enqueueSnackbar('login Successfull', {
variant: 'success', anchorOrigin: { vertical: 'top', horizontal: 'right' },
autoHideDuration: 3000
})
setUsername('');
setPassword('');
localStorage.setItem("firstname", res.data.userinfo.firstname);
localStorage.setItem("appuserid", res.data.userinfo.userid);
localStorage.setItem("roleid", res.data.userinfo.roleid);
navigate('/dashboard', { state: { firstname: res.data.userinfo.firstname } });
setSubmitting(false)
}
}).catch((err) => {
console.log(err);
setAlertmessage('Invalid Data');
opentoast('Invalid Data');
setLoading(false)
setSubmitting(false)
})
} catch (err) {
console.log(err)
setLoading(false)
setSubmitting(false)
}
} else {
// let el2 = document.getElementById('toastid');
// el2.classList.add('d-block');
// el2.classList.remove('d-none');
setAlertmessage('Fill All required fields');
opentoast('Fill All required fields');
setLoading(false)
}
}
// const handleClose = () => {
// setToast(false)
// }
const opentoast = (message) => {
// setToast(true)
// setTimeout(() => {
// // handleClose();
// setToast(false)
// }, 2000);
enqueueSnackbar(message, {
variant: 'error', anchorOrigin: { vertical: 'top', horizontal: 'right' },
autoHideDuration: 2000
})
}
return <>
{/* <AuthWrapper> */}
<Box sx={{ minHeight: '100vh' }}>
{(loading) &&
<Loader />
}
{/* <AuthBackground /> */}
<Grid
container
direction="column"
justifyContent="flex-start"
sx={{
minHeight: '100vh'
}}
>
<Grid item xs={12}
sx={{ ml: 3, mt: 3 }}
>
<img src={logo} alt='legendary'
width='200px'
/>
</Grid>
<Grid item xs={12}>
<Grid
item
xs={12}
container
justifyContent="center"
alignItems="center"
sx={{ minHeight: { xs: 'calc(100vh - 210px)', sm: 'calc(100vh - 134px)', md: 'calc(100vh - 112px)' } }}
>
<Grid item>
{/* <AuthCard>{children}</AuthCard> */}
<Box sx={{
maxWidth: { xs: 400, lg: 475 },
margin: { xs: 2.5, md: 3 },
'& > *': {
flexGrow: 1,
flexBasis: '50%'
}
}} >
<Card sx={{
position: 'relative',
border: '1px solid',
borderRadius: 1,
borderColor: theme.palette.divider,
boxShadow: 'inherit',
p: 2,
width: '100%'
}}>
{/* <CardHeader title={<Typography variant="h4">Login</Typography>} /> */}
{/* <Divider sx={{ borderStyle: 'dashed' }} /> */}
{/* <h1>eee</h1> */}
{/* <CardHeader> */}
<Grid container
spacing={3}
>
<Grid item xs={12}>
<Stack direction="row" justifyContent="flex-start" alignItems="baseline"
sx={{ mb: { xs: -0.5, sm: 0.5 } }}
>
<CardHeader
title={<Typography variant="h3">Login</Typography>}
/>
</Stack>
</Grid>
{/* <Grid item xs={12}>
<AuthLogin isDemo={isLoggedIn} />
</Grid> */}
</Grid>
<CardContent>
<form noValidate
onSubmit={(e) => { e.preventDefault() }}
>
<Grid container
spacing={2}
>
<Grid item xs={12}>
{/* <Stack spacing={1}> */}
{/* <InputLabel htmlFor="email-login">Email Address</InputLabel>
<OutlinedInput
id="email-login"
type="email"
value={values.email}
name="email"
onBlur={handleBlur}
onChange={handleChange}
placeholder="Enter email address"
fullWidth
id="username1"
label="E-mail Address"
variant="outlined"
autoComplete='email'
required
onChange={usernamecheck}
error={checkusername}
error={Boolean(touched.email && errors.email)}
/>
{touched.email && errors.email && (
<FormHelperText error id="standard-weight-helper-text-email-login">
{errors.email}
</FormHelperText>
)} */}
<TextField
margin="normal"
fullWidth
id="username1" label="E-mail Address" variant="outlined" autoComplete='email' required
onChange={usernamecheck}
error={checkusername}
/>
<TextField
margin="normal"
fullWidth
required
autoComplete="current-password"
onChange={(e) => setPassword(e.target.value)}
type='password' id="password1" label="Password" variant="outlined" />
{/* </Stack> */}
</Grid>
<Grid item xs={12}>
{/* <Stack spacing={0}> */}
{/* <InputLabel htmlFor="password-login">Password</InputLabel> */}
{/* <OutlinedInput
fullWidth
// error={Boolean(touched.password && errors.password)}
// id="-password-login"
// type={showPassword ? 'text' : 'password'}
// value={values.password}
// name="password"
// onBlur={handleBlur}
// onChange={handleChange}
// endAdornment={
// <InputAdornment position="end">
// <IconButton
// aria-label="toggle password visibility"
// onClick={handleClickShowPassword}
// onMouseDown={handleMouseDownPassword}
// edge="end"
// color="secondary"
// >
// {showPassword ? <EyeOutlined /> : <EyeInvisibleOutlined />}
// </IconButton>
// </InputAdornment>
// }
placeholder="Enter password"
// margin="normal"
// fullWidth
required
autoComplete="current-password"
onChange={(e) => setPassword(e.target.value)}
type='password' id="password1"
/> */}
{/* {touched.password && errors.password && (
<FormHelperText error id="standard-weight-helper-text-password-login">
{errors.password}
</FormHelperText>
)} */}
{/* </Stack> */}
<Link href="#" variant="h6" >
Forgot password?
</Link>
</Grid>
{/* <Grid item xs={12} sx={{ mt: -1 }}>
<Stack direction="row" justifyContent="space-between" alignItems="center" spacing={2}>
<FormControlLabel
control={
<Checkbox
checked={checked}
onChange={(event) => setChecked(event.target.checked)}
name="checked"
color="primary"
size="small"
/>
}
label={<Typography variant="h6">Keep me sign in</Typography>}
/>
<Link variant="h6" component={RouterLink} to={isDemo ? '/auth/forgot-password' : '/forgot-password'} color="text.primary">
Forgot Password?
</Link>
</Stack>
</Grid> */}
{/* {errors.submit && (
<Grid item xs={12}>
<FormHelperText error>{errors.submit}</FormHelperText>
</Grid>
)} */}
<Grid item xs={12}>
{/* <AnimateButton> */}
<AnimateButton>
<Button
disabled={submitting}
onClick={()=>{
// loginsend()
navigate('/dashboard')
}}
fullWidth size="large" type="submit" variant="contained" color="primary">
Login
</Button>
</AnimateButton>
{/* </AnimateButton> */}
</Grid>
</Grid>
{/* </Grid> */}
</form>
</CardContent>
{/* </CardHeader> */}
</Card>
</Box>
</Grid>
</Grid>
</Grid>
<Grid item xs={12}
// sx={{ m: 3, mt: 1 }}
>
{/* <AuthFooter /> */}
<Container maxWidth="xl">
<Stack
direction={{ sx: 'column', md: 'row' }}
justifyContent={{ sx: 'center', md: 'space-between' }}
spacing={2}
// textAlign={{ sx: 'center', md: 'inherit' }}
alignItems={{ sx: 'center', md: 'inherit' }}
width='100%'
>
<Stack direction='row' justifyContent='center' spacing={1}>
<Typography variant="subtitle2" color="secondary" component="span" sx={{ display: 'flex' }}>&copy; All rights reserved
{/* <Typography variant="subtitle2" href="#mantis-privacy" target="_blank" underline="hover" sx={{ml:1}}>Privacy Policy</Typography> */}
</Typography>
</Stack>
<Stack direction={{ sx: 'column', md: 'row' }} spacing={{ sx: 1, md: 3 }}
textAlign={{ sx: 'center', md: 'inherit' }}
alignItems={{ sx: 'center', md: 'inherit' }}
// width='100%'
>
<Typography
variant="subtitle2"
color="secondary"
component={Link}
href="#"
// target="_blank"
underline="hover"
textAlign='center'
>
Terms and Conditions
</Typography>
<Typography
variant="subtitle2"
color="secondary"
component={Link}
href="#"
// target="_blank"
underline="hover"
textAlign='center'
>
Privacy Policy
</Typography>
{/* <Typography
variant="subtitle2"
color="secondary"
component={Link}
href="#"
// target="_blank"
underline="hover"
textAlign='center'
>
CA Privacy Notice
</Typography> */}
</Stack>
</Stack>
</Container>
</Grid>
</Grid>
</Box >
{/* </AuthWrapper> */}
</>
}
export default Login;

View File

@@ -1,17 +1,17 @@
import { lazy } from 'react'; // import { lazy } from 'react';
// project import // project import
import GuestGuard from 'utils/route-guard/GuestGuard'; // import GuestGuard from 'utils/route-guard/GuestGuard';
import CommonLayout from 'layout/CommonLayout'; import CommonLayout from 'layout/CommonLayout';
import Loadable from 'components/Loadable'; // import Loadable from 'components/Loadable';
// render - login // render - login
const AuthLogin = Loadable(lazy(() => import('pages/auth/login'))); // const AuthLogin = Loadable(lazy(() => import('pages/auth/login')));
const AuthRegister = Loadable(lazy(() => import('pages/auth/register'))); // const AuthRegister = Loadable(lazy(() => import('pages/auth/register')));
const AuthForgotPassword = Loadable(lazy(() => import('pages/auth/forgot-password'))); // const AuthForgotPassword = Loadable(lazy(() => import('pages/auth/forgot-password')));
const AuthCheckMail = Loadable(lazy(() => import('pages/auth/check-mail'))); // const AuthCheckMail = Loadable(lazy(() => import('pages/auth/check-mail')));
const AuthResetPassword = Loadable(lazy(() => import('pages/auth/reset-password'))); // const AuthResetPassword = Loadable(lazy(() => import('pages/auth/reset-password')));
const AuthCodeVerification = Loadable(lazy(() => import('pages/auth/code-verification'))); // const AuthCodeVerification = Loadable(lazy(() => import('pages/auth/code-verification')));
// ==============================|| AUTH ROUTING ||============================== // // ==============================|| AUTH ROUTING ||============================== //
@@ -21,39 +21,39 @@ const LoginRoutes = {
{ {
path: '/', path: '/',
element: ( element: (
<GuestGuard> // <GuestGuard>
<CommonLayout /> <CommonLayout />
</GuestGuard> // </GuestGuard>
), ),
children: [ children: [
{ // {
path: '/', // path: '/',
element: <AuthLogin /> // element: <AuthLogin />
}, // },
{ // {
path: 'login', // path: 'login',
element: <AuthLogin /> // element: <AuthLogin />
}, // },
{ // {
path: 'register', // path: 'register',
element: <AuthRegister /> // element: <AuthRegister />
}, // },
{ // {
path: 'forgot-password', // path: 'forgot-password',
element: <AuthForgotPassword /> // element: <AuthForgotPassword />
}, // },
{ // {
path: 'check-mail', // path: 'check-mail',
element: <AuthCheckMail /> // element: <AuthCheckMail />
}, // },
{ // {
path: 'reset-password', // path: 'reset-password',
element: <AuthResetPassword /> // element: <AuthResetPassword />
}, // },
{ // {
path: 'code-verification', // path: 'code-verification',
element: <AuthCodeVerification /> // element: <AuthCodeVerification />
} // }
] ]
} }
] ]

View File

@@ -4,7 +4,7 @@ import { lazy } from 'react';
import MainLayout from 'layout/MainLayout'; import MainLayout from 'layout/MainLayout';
import CommonLayout from 'layout/CommonLayout'; import CommonLayout from 'layout/CommonLayout';
import Loadable from 'components/Loadable'; import Loadable from 'components/Loadable';
import AuthGuard from 'utils/route-guard/AuthGuard'; // import AuthGuard from 'utils/route-guard/AuthGuard';
// pages routing // pages routing
const MaintenanceError = Loadable(lazy(() => import('pages/maintenance/404'))); const MaintenanceError = Loadable(lazy(() => import('pages/maintenance/404')));
@@ -14,6 +14,10 @@ const MaintenanceComingSoon = Loadable(lazy(() => import('pages/maintenance/comi
// render - sample page // render - sample page
const SamplePage = Loadable(lazy(() => import('pages/extra-pages/sample-page'))); const SamplePage = Loadable(lazy(() => import('pages/extra-pages/sample-page')));
const Login = Loadable(lazy(() => import('pages/nearle/login')));
const Dashboard = Loadable(lazy(() => import('pages/nearle/dashboard')));
// ==============================|| MAIN ROUTING ||============================== // // ==============================|| MAIN ROUTING ||============================== //
@@ -23,17 +27,26 @@ const MainRoutes = {
{ {
path: '/', path: '/',
element: ( element: (
<AuthGuard> // <AuthGuard>
<MainLayout /> <MainLayout />
</AuthGuard> // </AuthGuard>
), ),
children: [ children: [
{ {
path: 'sample-page', path: 'sample-page',
element: <SamplePage /> element: <SamplePage />
} },
{
path: 'dashboard',
element: <Dashboard />
},
] ]
}, },
{
path:'/login',
element:<Login />
},
{ {
path: '/maintenance', path: '/maintenance',
element: <CommonLayout />, element: <CommonLayout />,

View File

@@ -3,8 +3,11 @@ import { REGISTER, LOGIN, LOGOUT } from './actions';
// initial state // initial state
export const initialState = { export const initialState = {
isLoggedIn: false, // isLoggedIn: false,
isInitialized: false, // isInitialized: false,
// user: null
isLoggedIn: true,
isInitialized: true,
user: null user: null
}; };

4687
yarn.lock

File diff suppressed because it is too large Load Diff