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.
 
 

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