Skip to content

Commit

Permalink
Added overflow hidden to landing page
Browse files Browse the repository at this point in the history
  • Loading branch information
Spicer Matthews committed Jan 17, 2024
1 parent b8df929 commit 45fbeeb
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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([])
Expand Down

0 comments on commit 45fbeeb

Please sign in to comment.