|
- // material-ui
- import {
- Grid,
- Typography,
- Stack,
- Button
- } from '@mui/material';
- import * as React from "react";
- import { FormattedMessage } from "react-intl";
- import { useLocation } from "react-router-dom";
- import { useNavigate } from "react-router-dom";
- import Loadable from 'components/Loadable';
- const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent')));
-
- import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png'
- const BackgroundHead = {
- backgroundImage: `url(${titleBackgroundImg})`,
- width: '100%',
- height: '100%',
- backgroundSize: 'contain',
- backgroundRepeat: 'no-repeat',
- backgroundColor: '#0C489E',
- backgroundPosition: 'right'
- }
-
- // ==============================|| DASHBOARD - DEFAULT ||============================== //
-
- const Index = () => {
- const location = useLocation();
- const navigate = useNavigate()
- const [onReady, setOnReady] = React.useState(false);
-
- React.useEffect(() => {
- if("iAmSmart"==location.state.loginMethod){
- setOnReady(true);
- }else{
- navigate('/dashboard');
- }
- }, []);
-
- return (
- !onReady ?
- <Grid container sx={{ minHeight: '87vh', mb: 3 }} direction="column" justifyContent="center" alignItems="center">
- <Grid item>
- <LoadingComponent />
- </Grid>
- </Grid>
- :
- <Grid container sx={{ minHeight: '110vh', backgroundColor: '#fff' }} direction="column" justifyContent="flex-start" alignItems="center" >
- <Grid item xs={12} width="100%">
- <div style={BackgroundHead} width="100%">
- <Stack direction="row" height='70px'>
- <Typography ml={15} color='#FFF' variant="h4" sx={{ pt: 2 }}>
- <FormattedMessage id="loginSuccessMessage1" />
- </Typography>
- </Stack>
- </div>
- </Grid>
- {/*row 1*/}
- <Grid item xs={12} md={12} >
- <Grid container justifyContent="flex-start" alignItems="center" >
- <center>
- <Grid item xs={12} md={12} >
- <Typography variant="h3" sx={{ ml: 8, mt: 4, mr: 8, textAlign: "center" }}>
- <FormattedMessage id="loginSuccessMessage2" />
- </Typography>
- </Grid>
- </center>
- </Grid>
- </Grid>
- {/*row 2*/}
- <Grid item xs={12} md={12} >
- <Grid container justifyContent="flex-start" alignItems="center" >
- <center>
- <Button
- component="span"
- variant="contained"
- size="large"
- sx={{ m: 4 }}
- onClick={() => { navigate("/dashboard"); }}
- >
- <FormattedMessage id="loginSuccessMessage3" />
- </Button>
- </center>
- </Grid>
- </Grid>
- </Grid >
-
-
- );
- };
-
- export default Index;
|