[Glitch] fix: Prevent content scrolling behind main menu (part 1)

Port c6dddbb66e to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
diondiondion
2025-06-25 14:12:49 +02:00
committed by Claire
parent 9e5b9433f8
commit 0156ed6641
7 changed files with 83 additions and 37 deletions

View File

@@ -21,7 +21,6 @@ import {
IgnoreNotificationsModal,
AnnualReportModal,
} from 'flavours/glitch/features/ui/util/async-components';
import { getScrollbarWidth } from 'flavours/glitch/utils/scrollbar';
import BundleContainer from '../containers/bundle_container';
@@ -98,16 +97,6 @@ export default class ModalRoot extends PureComponent {
backgroundColor: null,
};
componentDidUpdate () {
if (this.props.type) {
document.body.classList.add('with-modals--active');
document.documentElement.style.marginRight = `${getScrollbarWidth()}px`;
} else {
document.body.classList.remove('with-modals--active');
document.documentElement.style.marginRight = '0';
}
}
setBackgroundColor = color => {
this.setState({ backgroundColor: color });
};