From 6d845c755ada20a6edd14917cd67e5bfa33192cb Mon Sep 17 00:00:00 2001 From: Mathias Desloges Date: Sat, 28 Oct 2017 20:58:05 +0200 Subject: [PATCH] fix screen sizing (css issue) --- src/lib/ScreenManager.css | 6 +++++- src/lib/ScreenManager.js | 41 +++++++++++++++++++++------------------ 2 files changed, 27 insertions(+), 20 deletions(-) diff --git a/src/lib/ScreenManager.css b/src/lib/ScreenManager.css index 02912d0..d59fa70 100644 --- a/src/lib/ScreenManager.css +++ b/src/lib/ScreenManager.css @@ -16,7 +16,11 @@ will-change:transform; } - +.screen-inner { + position: absolute; + width: 100%; + height: 100%; +} .splash { z-index: 1000; diff --git a/src/lib/ScreenManager.js b/src/lib/ScreenManager.js index 7ab27fd..179390c 100644 --- a/src/lib/ScreenManager.js +++ b/src/lib/ScreenManager.js @@ -73,6 +73,8 @@ export class ScreenManager extends Component { const hideNavbarPath = pages.filter( r => r.props.hideNavbar ).map(r => r.props.path) const navbarScreenInfos = pages.filter(r => !r.props.noNavbar).map(r => ({ name: r.props.name, path: r.props.path })) + const isCurrentScreenAnimated = notAnimatedScreens.findIndex(screen => screen.props.path === location.pathname) === -1 + const renderForbidden = (screen) => { if (screen) { if (screen.props.redirectTo) { @@ -106,25 +108,26 @@ export class ScreenManager extends Component { renderScreens(notAnimatedScreens) } - - = 0 ? "right" : "left")}> - -
- - { - renderScreens(animatedScreens) - } - -
-
-
- { hideNavbarPath.indexOf(location.pathname) === -1 && navbars.map((navbar, k) => { - return React.cloneElement(navbar, { pages: navbarScreenInfos, key: k }) + { + isCurrentScreenAnimated ? ( + = 0 ? "right" : "left")}> + +
+ + { + renderScreens(animatedScreens) + } + +
+
+
+ ): null }{ hideNavbarPath.indexOf(location.pathname) === -1 && navbars.map((navbar, k) => { + return React.cloneElement(navbar, { pages: navbarScreenInfos, key: k, location }) }) } { this.state.renderSplash ? (