From 05f1cd52732b1fc57e13ea41239fbc10299a0e01 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 10 Dec 2018 15:46:33 +0300 Subject: ReactDOM.createPortal --- vnext/src/App.js | 97 ++++++++++++++++++++++++++------------------------------ 1 file changed, 45 insertions(+), 52 deletions(-) (limited to 'vnext/src/App.js') diff --git a/vnext/src/App.js b/vnext/src/App.js index 0764281a..e59fdb40 100644 --- a/vnext/src/App.js +++ b/vnext/src/App.js @@ -20,6 +20,8 @@ import cookies from 'react-cookies'; import { me } from './api'; +const app = document.getElementById('app'); + export default class App extends React.Component { constructor(props) { super(props); @@ -91,16 +93,18 @@ export default class App extends React.Component { toggleSidebar = () => { let width = this.sidebar.current.style.width; this.sidebar.current.style.width = width === '248px' ? '0' : '248px'; + let leftMargin = this.state.appMarginLeft === 'inherit' ? '250px' : 'inherit'; this.setState({ - appMarginLeft: this.state.appMarginLeft === 'inherit' ? '250px' : 'inherit' + appMarginLeft: leftMargin }); + app.style.marginLeft = leftMargin; } render() { const user = this.state.visitor; return ( <> -
+
@@ -138,56 +142,45 @@ export default class App extends React.Component {
-
-
- - } /> - } /> - - - } /> - - - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - -
- -
- +
+ + } /> + } /> + + + } /> + + + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + +
+ ); -- cgit v1.2.3