From 45fbeeb6c0f062c1afe0884141dd338265f9587c Mon Sep 17 00:00:00 2001 From: Spicer Matthews Date: Tue, 16 Jan 2024 20:23:12 -0800 Subject: [PATCH] Added overflow hidden to landing page --- src/pages/index.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/pages/index.js b/src/pages/index.js index 5f76695c..bc147a3e 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -478,6 +478,19 @@ const Index = ({ data: fallbackData, userAgent }) => { const showAchievements = showMockAchievements() const enableBackgroundImages = showBackgroundImages() + // No scolling on this home page. + useEffect(() => { + // Add the style when the component mounts + // eslint-disable-next-line no-undef + document.body.style.overflow = 'hidden' + + // Revert back to the initial style when the component unmounts + return () => { + // eslint-disable-next-line no-undef + document.body.style.overflow = '' + } + }, []) + // Determine which ad units we'll show only once, on mount, // because the ads have already been fetched and won't change. const [adUnits, setAdUnits] = useState([])