enhancement(web): disable background scroll when IRC fullscreen view is active (#1112)

* enhancement(web): disable background scroll when IRC fullscreen view is active

* switch from add/remove to toggle.

* add missing unmount
This commit is contained in:
martylukyy 2023-09-11 20:31:00 +02:00 committed by GitHub
parent 28b13d6d24
commit 80aa0b6331
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -676,6 +676,15 @@ export const Events = ({ network, channel }: EventsProps) => {
setLogs([]);
}, [settings.scrollOnNewLog]);
useEffect(() => {
document.body.classList.toggle("overflow-hidden", isFullscreen);
return () => {
// Clean up by removing the class when the component unmounts
document.body.classList.remove("overflow-hidden");
};
}, [isFullscreen]);
return (
<div
className={classNames(