From 1c1db00bce8340d8ce3e3b210c2a7fd1a2bae956 Mon Sep 17 00:00:00 2001 From: Jason Chuang Date: Fri, 14 Nov 2025 18:56:09 +0800 Subject: [PATCH] update lego banner, disappear after 7 Dec --- src/pages/authentication/AuthWrapper.js | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) 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' }} />