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 38e733f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,17 @@ 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
document.body.style.overflow = 'hidden'

Check failure on line 484 in src/pages/index.js

View workflow job for this annotation

GitHub Actions / test

'document' is not defined

// Revert back to the initial style when the component unmounts
return () => {
document.body.style.overflow = ''

Check failure on line 488 in src/pages/index.js

View workflow job for this annotation

GitHub Actions / test

'document' is not defined
}
}, [])

// 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 38e733f

Please sign in to comment.