|
|
@@ -1,11 +1,12 @@ |
|
|
import PropTypes from 'prop-types'; |
|
|
import PropTypes from 'prop-types'; |
|
|
import { Box, Grid, Typography } from '@mui/material'; |
|
|
|
|
|
// import { Stack } from '@mui/material'; |
|
|
|
|
|
|
|
|
import { Box, Grid, Typography, Dialog, DialogContent, IconButton, useMediaQuery } from '@mui/material'; |
|
|
|
|
|
import CloseIcon from '@mui/icons-material/Close'; |
|
|
import Loadable from 'components/Loadable'; |
|
|
import Loadable from 'components/Loadable'; |
|
|
import { lazy } from 'react'; |
|
|
|
|
|
|
|
|
import { lazy, useState } from 'react'; |
|
|
import { FormattedMessage, useIntl } from "react-intl"; |
|
|
import { FormattedMessage, useIntl } from "react-intl"; |
|
|
import { checkSysEnv } from "utils/Utils"; |
|
|
import { checkSysEnv } from "utils/Utils"; |
|
|
import backbroundImg from 'assets/images/bg_ml.jpg'; |
|
|
import backbroundImg from 'assets/images/bg_ml.jpg'; |
|
|
|
|
|
import lgceImg from 'assets/images/2025_lgce.jpg'; // <-- your popup image |
|
|
import 'assets/style/loginStyles.css'; |
|
|
import 'assets/style/loginStyles.css'; |
|
|
|
|
|
|
|
|
const AuthCard = Loadable(lazy(() => import('./AuthCardCustom'))); |
|
|
const AuthCard = Loadable(lazy(() => import('./AuthCardCustom'))); |
|
|
@@ -18,38 +19,95 @@ const BackgroundHead = { |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
const AuthWrapper = ({ children }) => { |
|
|
const AuthWrapper = ({ children }) => { |
|
|
// Move useIntl inside component |
|
|
|
|
|
const intl = useIntl(); |
|
|
const intl = useIntl(); |
|
|
|
|
|
const isSmall = useMediaQuery('(max-width:600px)'); |
|
|
|
|
|
const [openPopup, setOpenPopup] = useState(true); |
|
|
|
|
|
|
|
|
|
|
|
const handleClosePopup = () => { |
|
|
|
|
|
setOpenPopup(false); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
return ( |
|
|
<Box sx={{ minHeight: '87vh' }}> |
|
|
<Box sx={{ minHeight: '87vh' }}> |
|
|
|
|
|
{/* Popup */} |
|
|
|
|
|
<Dialog |
|
|
|
|
|
open={openPopup} |
|
|
|
|
|
onClose={handleClosePopup} |
|
|
|
|
|
aria-labelledby="election-promo-title" |
|
|
|
|
|
maxWidth="md" |
|
|
|
|
|
PaperProps={{ |
|
|
|
|
|
sx: { |
|
|
|
|
|
borderRadius: 2, |
|
|
|
|
|
overflow: 'hidden', |
|
|
|
|
|
boxShadow: 6 |
|
|
|
|
|
} |
|
|
|
|
|
}} |
|
|
|
|
|
> |
|
|
|
|
|
<Box sx={{ position: 'relative' }}> |
|
|
|
|
|
<IconButton |
|
|
|
|
|
aria-label="Close" |
|
|
|
|
|
onClick={handleClosePopup} |
|
|
|
|
|
sx={{ |
|
|
|
|
|
position: 'absolute', |
|
|
|
|
|
top: 6, |
|
|
|
|
|
right: 6, |
|
|
|
|
|
zIndex: 1, |
|
|
|
|
|
bgcolor: 'rgba(255,255,255,0.8)', |
|
|
|
|
|
'&:hover': { bgcolor: 'rgba(255,255,255,1)' } |
|
|
|
|
|
}} |
|
|
|
|
|
> |
|
|
|
|
|
<CloseIcon /> |
|
|
|
|
|
</IconButton> |
|
|
|
|
|
<DialogContent sx={{ p: 0 }}> |
|
|
|
|
|
<Box |
|
|
|
|
|
component="img" |
|
|
|
|
|
src={lgceImg} |
|
|
|
|
|
alt={intl.formatMessage({ id: 'lgce_alt', defaultMessage: '2025 Legislative Council General Election' })} |
|
|
|
|
|
title={intl.formatMessage({ id: 'lgce_title', defaultMessage: '2025 Legislative Council General Election' })} |
|
|
|
|
|
sx={{ |
|
|
|
|
|
display: 'block', |
|
|
|
|
|
width: isSmall ? '92vw' : '720px', |
|
|
|
|
|
height: 'auto', |
|
|
|
|
|
maxWidth: '92vw' |
|
|
|
|
|
}} |
|
|
|
|
|
/> |
|
|
|
|
|
</DialogContent> |
|
|
|
|
|
</Box> |
|
|
|
|
|
</Dialog> |
|
|
|
|
|
|
|
|
|
|
|
{/* Page content */} |
|
|
<div style={BackgroundHead}> |
|
|
<div style={BackgroundHead}> |
|
|
<Grid |
|
|
<Grid |
|
|
container |
|
|
container |
|
|
direction="row" |
|
|
direction="row" |
|
|
justifyContent="space-between" |
|
|
justifyContent="space-between" |
|
|
alignItems="center" |
|
|
alignItems="center" |
|
|
sx={{ |
|
|
|
|
|
minHeight: '87vh' |
|
|
|
|
|
}} |
|
|
|
|
|
|
|
|
sx={{ minHeight: '87vh' }} |
|
|
> |
|
|
> |
|
|
<Grid item xs={12} md={8} lg={8} xl={8} > |
|
|
|
|
|
<Grid container direction="column" |
|
|
|
|
|
|
|
|
<Grid item xs={12} md={8} lg={8} xl={8}> |
|
|
|
|
|
<Grid |
|
|
|
|
|
container |
|
|
|
|
|
direction="column" |
|
|
justifyContent="flex-start" |
|
|
justifyContent="flex-start" |
|
|
alignItems="flex-start" |
|
|
alignItems="flex-start" |
|
|
// spacing={2} |
|
|
|
|
|
sx={{ minHeight: { md: 'calc(87vh)' } }} |
|
|
sx={{ minHeight: { md: 'calc(87vh)' } }} |
|
|
> |
|
|
> |
|
|
<Grid item xs={12} sx={{ ml: 4,}}> |
|
|
|
|
|
|
|
|
<Grid item xs={12} sx={{ ml: 4 }}> |
|
|
<Typography style={{ textAlign: "flex-start" }}> |
|
|
<Typography style={{ textAlign: "flex-start" }}> |
|
|
<div style={{ padding: 12 }} dangerouslySetInnerHTML={{ __html: intl.formatMessage({ id: "homePageHeaderMessage" }) }} /> |
|
|
|
|
|
|
|
|
<div |
|
|
|
|
|
style={{ padding: 12 }} |
|
|
|
|
|
dangerouslySetInnerHTML={{ __html: intl.formatMessage({ id: "homePageHeaderMessage" }) }} |
|
|
|
|
|
/> |
|
|
</Typography> |
|
|
</Typography> |
|
|
</Grid> |
|
|
</Grid> |
|
|
<Grid container direction="column" |
|
|
|
|
|
justifyContent="flex-start" |
|
|
|
|
|
alignItems="center" |
|
|
|
|
|
spacing={2} |
|
|
|
|
|
sx={{ minHeight: { md: 'calc(50vh)' } }} |
|
|
|
|
|
|
|
|
<Grid |
|
|
|
|
|
container |
|
|
|
|
|
direction="column" |
|
|
|
|
|
justifyContent="flex-start" |
|
|
|
|
|
alignItems="center" |
|
|
|
|
|
spacing={2} |
|
|
|
|
|
sx={{ minHeight: { md: 'calc(50vh)' } }} |
|
|
> |
|
|
> |
|
|
<Grid item xs={12} sx={{ ml: 4, mt: 12, display: { xs: 'none', sm: 'block' } }}> |
|
|
<Grid item xs={12} sx={{ ml: 4, mt: 12, display: { xs: 'none', sm: 'block' } }}> |
|
|
<Typography style={{ textAlign: "center", fontSize: "1.8rem" }}> |
|
|
<Typography style={{ textAlign: "center", fontSize: "1.8rem" }}> |
|
|
@@ -61,24 +119,24 @@ const AuthWrapper = ({ children }) => { |
|
|
<Typography style={{ textAlign: "center", fontSize: "1.8rem" }}> |
|
|
<Typography style={{ textAlign: "center", fontSize: "1.8rem" }}> |
|
|
<FormattedMessage id="PNSPS_fullname" /> |
|
|
<FormattedMessage id="PNSPS_fullname" /> |
|
|
</Typography> |
|
|
</Typography> |
|
|
{ |
|
|
|
|
|
checkSysEnv() !== '' ? |
|
|
|
|
|
<Typography style={{ color: 'red', textAlign: "center", fontSize: "1.8rem" }}> |
|
|
|
|
|
User Acceptance Test Environment |
|
|
|
|
|
</Typography> |
|
|
|
|
|
: "" |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
{checkSysEnv() !== '' ? ( |
|
|
|
|
|
<Typography style={{ color: 'red', textAlign: "center", fontSize: "1.8rem" }}> |
|
|
|
|
|
User Acceptance Test Environment |
|
|
|
|
|
</Typography> |
|
|
|
|
|
) : ( |
|
|
|
|
|
"" |
|
|
|
|
|
)} |
|
|
</Grid> |
|
|
</Grid> |
|
|
|
|
|
|
|
|
</Grid> |
|
|
</Grid> |
|
|
</Grid> |
|
|
</Grid> |
|
|
</Grid> |
|
|
</Grid> |
|
|
|
|
|
|
|
|
<Grid item xs={12} md={4} lg={4} xl={4}> |
|
|
<Grid item xs={12} md={4} lg={4} xl={4}> |
|
|
<Grid |
|
|
<Grid |
|
|
container |
|
|
container |
|
|
justifyContent="center" |
|
|
justifyContent="center" |
|
|
alignItems="center" |
|
|
alignItems="center" |
|
|
sx={{ minHeight: { xs: 'calc(90vh - 134px)', md: 'calc(90vh - 112px)' }, }} |
|
|
|
|
|
|
|
|
sx={{ minHeight: { xs: 'calc(90vh - 134px)', md: 'calc(90vh - 112px)' } }} |
|
|
> |
|
|
> |
|
|
<Grid item xs={12} md={11} lg={11} xl={11}> |
|
|
<Grid item xs={12} md={11} lg={11} xl={11}> |
|
|
<AuthCard>{children}</AuthCard> |
|
|
<AuthCard>{children}</AuthCard> |
|
|
|