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.
 
 

103 linhas
4.0 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 CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline';
  15. import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png'
  16. const BackgroundHead = {
  17. backgroundImage: `url(${titleBackgroundImg})`,
  18. width: '100%',
  19. height: '100%',
  20. backgroundSize: 'contain',
  21. backgroundRepeat: 'no-repeat',
  22. backgroundColor: '#0C489E',
  23. backgroundPosition: 'right'
  24. }
  25. // ==============================|| DASHBOARD - DEFAULT ||============================== //
  26. const Index = () => {
  27. const intl = useIntl();
  28. const location = useLocation();
  29. const navigate = useNavigate()
  30. const [onReady, setOnReady] = React.useState(false);
  31. const showAccountLinkUpMessages = location?.state?.iAmSmartNewlyLinked === true;
  32. React.useEffect(() => {
  33. if ("iAmSmart" == location?.state?.loginMethod) {
  34. setOnReady(true);
  35. } else {
  36. //setOnReady(true);
  37. navigate('/dashboard');
  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={showAccountLinkUpMessages ? 'loginSuccessMessage1' : 'iAmSmartLoginSuccessHeading'} />
  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. <CheckCircleOutlineIcon color="success" sx={{ width: "200px", height: "200px" }} />
  63. {showAccountLinkUpMessages ? (
  64. <Grid item xs={12} md={12} >
  65. <Typography variant="h3" sx={{ ml: 8, mt: 4, mr: 8, textAlign: "center" }}>
  66. <div dangerouslySetInnerHTML={{ __html: intl.formatMessage({ id: 'loginSuccessMessage2' }) }} />
  67. </Typography>
  68. </Grid>
  69. ) : null}
  70. </center>
  71. </Grid>
  72. </Grid>
  73. {/*row 2*/}
  74. <Grid item xs={12} md={12} >
  75. <Grid container justifyContent="flex-start" alignItems="center" >
  76. <center>
  77. <Button
  78. component="span"
  79. variant="contained"
  80. size="large"
  81. sx={{ m: 4 }}
  82. onClick={() => {
  83. navigate("/dashboard");
  84. }}
  85. >
  86. <FormattedMessage id="loginSuccessMessage3" />
  87. </Button>
  88. </center>
  89. </Grid>
  90. </Grid>
  91. </Grid >
  92. );
  93. };
  94. export default Index;