Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 

94 linhas
3.4 KiB

  1. // material-ui
  2. import {
  3. Grid,
  4. Typography,
  5. Stack,
  6. Button
  7. } from '@mui/material';
  8. import * as React from "react";
  9. import { FormattedMessage } from "react-intl";
  10. import { useLocation } from "react-router-dom";
  11. import { useNavigate } from "react-router-dom";
  12. import Loadable from 'components/Loadable';
  13. const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent')));
  14. import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png'
  15. const BackgroundHead = {
  16. backgroundImage: `url(${titleBackgroundImg})`,
  17. width: '100%',
  18. height: '100%',
  19. backgroundSize: 'contain',
  20. backgroundRepeat: 'no-repeat',
  21. backgroundColor: '#0C489E',
  22. backgroundPosition: 'right'
  23. }
  24. // ==============================|| DASHBOARD - DEFAULT ||============================== //
  25. const Index = () => {
  26. const location = useLocation();
  27. const navigate = useNavigate()
  28. const [onReady, setOnReady] = React.useState(false);
  29. React.useEffect(() => {
  30. if("iAmSmart"==location.state.loginMethod){
  31. setOnReady(true);
  32. }else{
  33. navigate('/dashboard');
  34. }
  35. }, []);
  36. return (
  37. !onReady ?
  38. <Grid container sx={{ minHeight: '87vh', mb: 3 }} direction="column" justifyContent="center" alignItems="center">
  39. <Grid item>
  40. <LoadingComponent />
  41. </Grid>
  42. </Grid>
  43. :
  44. <Grid container sx={{ minHeight: '110vh', backgroundColor: '#fff' }} direction="column" justifyContent="flex-start" alignItems="center" >
  45. <Grid item xs={12} width="100%">
  46. <div style={BackgroundHead} width="100%">
  47. <Stack direction="row" height='70px'>
  48. <Typography ml={15} color='#FFF' variant="h4" sx={{ pt: 2 }}>
  49. <FormattedMessage id="loginSuccessMessage1" />
  50. </Typography>
  51. </Stack>
  52. </div>
  53. </Grid>
  54. {/*row 1*/}
  55. <Grid item xs={12} md={12} >
  56. <Grid container justifyContent="flex-start" alignItems="center" >
  57. <center>
  58. <Grid item xs={12} md={12} >
  59. <Typography variant="h3" sx={{ ml: 8, mt: 4, mr: 8, textAlign: "center" }}>
  60. <FormattedMessage id="loginSuccessMessage2" />
  61. </Typography>
  62. </Grid>
  63. </center>
  64. </Grid>
  65. </Grid>
  66. {/*row 2*/}
  67. <Grid item xs={12} md={12} >
  68. <Grid container justifyContent="flex-start" alignItems="center" >
  69. <center>
  70. <Button
  71. component="span"
  72. variant="contained"
  73. size="large"
  74. sx={{ m: 4 }}
  75. onClick={() => { navigate("/dashboard"); }}
  76. >
  77. <FormattedMessage id="loginSuccessMessage3" />
  78. </Button>
  79. </center>
  80. </Grid>
  81. </Grid>
  82. </Grid >
  83. );
  84. };
  85. export default Index;