You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

69 lines
2.5 KiB

  1. import { Grid, Typography, Stack, } from '@mui/material';
  2. import { useState, useEffect, lazy } from "react";
  3. import Loadable from 'components/Loadable';
  4. import { useIntl, FormattedMessage } from "react-intl";
  5. import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png'
  6. const BackgroundHead = {
  7. backgroundImage: `url(${titleBackgroundImg})`,
  8. width: '100%',
  9. height: '100%',
  10. backgroundSize: 'contain',
  11. backgroundRepeat: 'no-repeat',
  12. backgroundColor: '#0C489E',
  13. backgroundPosition: 'right'
  14. }
  15. const LoadingComponent = Loadable(lazy(() => import('pages/extra-pages/LoadingComponent')));
  16. const AboutUs_en = Loadable(lazy(() => import('pages/extra-pages/AboutUs/AboutUs_en')));
  17. const AboutUs_zh = Loadable(lazy(() => import('pages/extra-pages/AboutUs/AboutUs_zh')));
  18. const AboutUs_cn = Loadable(lazy(() => import('pages/extra-pages/AboutUs/AboutUs_cn')));
  19. const PrivacyPolicy = () => {
  20. const intl = useIntl();
  21. const { locale } = intl;
  22. const [onReady, setOnReady] = useState(false);
  23. const [content, setContent] = useState("");
  24. useEffect(() => {
  25. setOnReady(true);
  26. if (locale === 'zh-CN') {
  27. setContent(<><AboutUs_cn /></>);
  28. } else if (locale === 'zh-HK') {
  29. setContent(<><AboutUs_zh /></>);
  30. } else {
  31. setContent(<><AboutUs_en /></>);
  32. }
  33. }, [locale]);
  34. return (
  35. !onReady ?
  36. <Grid container sx={{ minHeight: '87vh', mb: 3 }} direction="column" justifyContent="center" alignItems="center">
  37. <Grid item>
  38. <LoadingComponent />
  39. </Grid>
  40. </Grid>
  41. :
  42. (
  43. <Grid container justifyContent="center" alignItems="center" >
  44. <Grid item xs={12}>
  45. <div style={BackgroundHead}>
  46. <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center">
  47. <Typography ml={15} color='#FFF' variant="h4" sx={{ display: { xs: 'none', sm: 'none', md: 'block', pt: 2 } }}>
  48. <FormattedMessage id="aboutUs" />
  49. </Typography>
  50. </Stack>
  51. </div>
  52. </Grid>
  53. <Grid item xs={10} md={8} lg={6}>
  54. {content}
  55. </Grid>
  56. </Grid>
  57. )
  58. );
  59. }
  60. export default PrivacyPolicy;