diff --git a/src/pages/authentication/AuthWrapper.js b/src/pages/authentication/AuthWrapper.js index 83a95e3..9f0c57c 100644 --- a/src/pages/authentication/AuthWrapper.js +++ b/src/pages/authentication/AuthWrapper.js @@ -1,5 +1,5 @@ import PropTypes from 'prop-types'; -import { Box, Grid, Typography, Dialog, DialogContent, IconButton, useMediaQuery } from '@mui/material'; +import { Box, Grid, Typography, Dialog, DialogContent, IconButton } from '@mui/material'; import CloseIcon from '@mui/icons-material/Close'; import Loadable from 'components/Loadable'; import { lazy, useState } from 'react'; @@ -20,17 +20,18 @@ const BackgroundHead = { const AuthWrapper = ({ children }) => { const intl = useIntl(); - const isSmall = useMediaQuery('(max-width:600px)'); - const [openPopup, setOpenPopup] = useState(true); -const handleClosePopup = () => { - setOpenPopup(false); -}; + // --- Date control --- + const today = new Date(); + const showUntil = new Date("2025-12-08T00:00:00"); // 8 Dec 2025 and onwards = hide popup + const [openPopup, setOpenPopup] = useState(today < showUntil); + const handleClosePopup = () => { + setOpenPopup(false); + }; return ( - {/* Popup */} { title={intl.formatMessage({ id: 'lgce_title', defaultMessage: '2025 Legislative Council General Election' })} sx={{ display: 'block', - width: isSmall ? '92vw' : '720px', - height: 'auto', - maxWidth: '92vw' + width: '100%', + maxWidth: '720px', + height: 'auto' }} />