diff --git a/src/components/notification/Notification.js b/src/components/notification/Notification.js index aefb09a2..95f965b4 100644 --- a/src/components/notification/Notification.js +++ b/src/components/notification/Notification.js @@ -31,6 +31,7 @@ if (isBrowser) { const Notification = ({ slot, user, onOpenLeaderboard }) => { const [show, setShow] = useState(true) const [height, setHeight] = useState(0) + const [showModal, setShowModal] = useState(false) const [openWidget, setOpenWidget] = useState(false) const [iframeUrl, setIframeUrl] = useState('') const [notification, setNotification] = useState('') @@ -84,9 +85,17 @@ const Notification = ({ slot, user, onOpenLeaderboard }) => { if (event.data.show) { setShow(true) setHeight(event.data.height) + + if (event.data.slot === 'modal-center') { + setShowModal(true) + } } else { setShow(false) setHeight(0) + + if (event.data.slot === 'modal-center') { + setShowModal(false) + } } // Did we get a new iframe URL? @@ -126,7 +135,7 @@ const Notification = ({ slot, user, onOpenLeaderboard }) => { return ( <> - {show && ( + {show && (slot === 'top-right' || slot === 'top-center') && (