diff --git a/pages/content-ui/src/App.tsx b/pages/content-ui/src/App.tsx index bdc6a6d..a68f553 100644 --- a/pages/content-ui/src/App.tsx +++ b/pages/content-ui/src/App.tsx @@ -1,7 +1,4 @@ import { availableApps } from '@extension/shared/lib/constants/apps'; - -// import { useEffect } from 'react'; -// import { Button } from '@extension/ui'; import { useStorage } from '@extension/shared'; import { zenStorage, ZenTimerState } from '@extension/storage'; import { useEffect, useMemo } from 'react'; @@ -22,5 +19,18 @@ export default function App() { return zenSettings?.timerState === ZenTimerState.Focus && zenSettings?.blockedApps.includes(currentAppName); }, [zenSettings]); + useEffect(() => { + if (shouldBlock) { + document.documentElement.style.setProperty('overflow', 'hidden', 'important'); + } else { + document.documentElement.style.setProperty('overflow', 'auto', 'important'); + } + + // Cleanup when component unmounts + return () => { + document.documentElement.style.setProperty('overflow', 'auto', 'important'); + }; + }, [shouldBlock]); + return