From 412de96cfd77fb91d614d207bc84ee3a770fff87 Mon Sep 17 00:00:00 2001 From: NikolaBorislavovHristov Date: Thu, 16 May 2019 15:29:47 +0300 Subject: [PATCH] Router position/size fixed --- src/navigation/Router/Router.js | 4 +++- src/navigation/Router/styles.less | 37 ++++++++++++++++++------------- 2 files changed, 25 insertions(+), 16 deletions(-) diff --git a/src/navigation/Router/Router.js b/src/navigation/Router/Router.js index 2eb5e0226..d7d974564 100644 --- a/src/navigation/Router/Router.js +++ b/src/navigation/Router/Router.js @@ -1,9 +1,11 @@ const React = require('react'); const PropTypes = require('prop-types'); +const classnames = require('classnames'); const PathToRegexp = require('path-to-regexp'); const UrlUtils = require('url'); const { RoutesContainerProvider } = require('../RoutesContainerContext'); const Route = require('./Route'); +const styles = require('./styles'); const Router = React.memo(({ className, homePath, ...props }) => { const onPathNotMatch = React.useRef(props.onPathNotMatch); @@ -96,7 +98,7 @@ const Router = React.memo(({ className, homePath, ...props }) => { }, []); return ( - + { views .filter(({ routeConfig }) => routeConfig !== null) diff --git a/src/navigation/Router/styles.less b/src/navigation/Router/styles.less index 62388a70c..9c11ecebb 100644 --- a/src/navigation/Router/styles.less +++ b/src/navigation/Router/styles.less @@ -1,34 +1,41 @@ -.route-container { +.router-container { position: relative; z-index: 0; - width: 100%; - height: 100%; - overflow: hidden; - &:not(:last-child) { - display: none; - } - - .route-content { + .route-container { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 0; - } + overflow: hidden; - .modals-container { - width: 0; - height: 0; + &:not(:last-child) { + display: none; + } - >* { + .route-content { position: absolute; top: 0; right: 0; bottom: 0; left: 0; - z-index: 1; + z-index: 0; + } + + .modals-container { + width: 0; + height: 0; + + >* { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1; + } } } } \ No newline at end of file