Merge pull request #806 from ONLYOFFICE/bugfix/fixed-main-height

Bugfix/fixed main height
This commit is contained in:
Alexey Safronov 2022-09-08 14:57:11 +03:00 committed by GitHub
commit 9c1f380191
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 21 deletions

View File

@ -142,7 +142,7 @@ const Layout = (props) => {
// }
const bannerHeight = isBannerVisible ? 80 : 0;
let vh = (windowHeight - 48 - bannerHeight) * 0.01;
let vh = (windowHeight - bannerHeight) * 0.01;
document.documentElement.style.setProperty("--vh", `${vh}px`);
setContentHeight(height);
};
@ -186,6 +186,6 @@ export default inject(({ auth, bannerStore }) => {
return {
isTabletView: auth.settingsStore.isTabletView,
setIsTabletView: auth.settingsStore.setIsTabletView,
isBannerVisible: bannerStore.isBannerVisible,
isBannerVisible: false, // bannerStore.isBannerVisible, TODO: use isBannerVisible from bannerStore after fix
};
})(observer(Layout));

View File

@ -19,30 +19,11 @@ const StyledMain = styled.main`
`;
const Main = React.memo((props) => {
// const orientationChanged = React.useCallback(() => {
// if (isIOS && !isFirefox) {
// let vh = (window.innerHeight - 48) * 0.01;
// document.documentElement.style.setProperty("--vh", `${vh}px`);
// }
// }, []);
// React.useEffect(() => {
// orientationChanged();
// if (isIOS && !isFirefox) {
// window.addEventListener("resize", orientationChanged);
// }
// return () => window.removeEventListener("resize", orientationChanged);
// }, []);
//console.log("Main render");
return <StyledMain className="main" {...props} />;
});
/*Main.defaultProps = {
fullscreen: false
};*/
Main.displayName = "Main";
export default Main;