|
|
@@ -0,0 +1,78 @@ |
|
|
|
import { Grid,Typography, Stack, } from '@mui/material'; |
|
|
|
import { useState, useEffect, lazy } from "react"; |
|
|
|
|
|
|
|
import * as HttpUtils from "utils/HttpUtils"; |
|
|
|
import { PRIVACY_POLICY_PATH } from "utils/ApiPathConst"; |
|
|
|
import Loadable from 'components/Loadable'; |
|
|
|
import { useIntl, FormattedMessage } from "react-intl"; |
|
|
|
|
|
|
|
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' |
|
|
|
} |
|
|
|
|
|
|
|
const LoadingComponent = Loadable(lazy(() => import('pages/extra-pages/LoadingComponent'))); |
|
|
|
|
|
|
|
const PrivacyPolicy = () => { |
|
|
|
const intl = useIntl(); |
|
|
|
const { locale } = intl; |
|
|
|
const [onReady, setOnReady] = useState(false); |
|
|
|
const [record, setRecord] = useState({}); |
|
|
|
const [content, setContent] = useState(""); |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
setOnReady(true); |
|
|
|
HttpUtils.get({ |
|
|
|
url: PRIVACY_POLICY_PATH, |
|
|
|
onSuccess: (responseData) => { |
|
|
|
setRecord(responseData); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, []); |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
if (locale === 'zh-CN') { |
|
|
|
setContent(record.cn); |
|
|
|
} else if (locale === 'zh-HK') { |
|
|
|
setContent(record.zh); |
|
|
|
} else { |
|
|
|
setContent(record.en); |
|
|
|
} |
|
|
|
}, [locale, record]); |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
!onReady ? |
|
|
|
<Grid container sx={{ minHeight: '87vh', mb: 3 }} direction="column" justifyContent="center" alignItems="center"> |
|
|
|
<Grid item> |
|
|
|
<LoadingComponent /> |
|
|
|
</Grid> |
|
|
|
</Grid> |
|
|
|
: |
|
|
|
( |
|
|
|
<Grid container justifyContent="center" alignItems="center" > |
|
|
|
<Grid item xs={12}> |
|
|
|
<div style={BackgroundHead}> |
|
|
|
<Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> |
|
|
|
<Typography ml={15} color='#FFF' variant="h4" sx={{ display: { xs: 'none', sm: 'none', md: 'block', pt: 2 } }}> |
|
|
|
<FormattedMessage id="privacyPolicy" /> |
|
|
|
</Typography> |
|
|
|
</Stack> |
|
|
|
</div> |
|
|
|
</Grid> |
|
|
|
<Grid item xs={10} md={5}> |
|
|
|
<div style={{ padding: 12 }} dangerouslySetInnerHTML={{ __html: content }} /> |
|
|
|
</Grid> |
|
|
|
</Grid> |
|
|
|
) |
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
export default PrivacyPolicy; |