diff --git a/src/components/App.tsx b/src/components/App.tsx index cbac0261740f35b23684353b4f816214aac16635..a10aae6e00371a584daee0e59c902bcfa7ac4d5e 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -22,7 +22,8 @@ type AppState = { class App extends React.Component<{}, AppState> { width = window.innerWidth; - isSideBarSet = false; + isTimelineView = false; + constructor(props: {}) { super(props); this.state = { @@ -53,10 +54,7 @@ class App extends React.Component<{}, AppState> { this.showOrHideSideBars(); } }); - if (!this.isSideBarSet) { - console.log("showOrHideSideBars"); - this.showOrHideSideBars(); - } + this.showOrHideSideBars(); } setDarkTheme(toSet: boolean) { @@ -89,7 +87,7 @@ class App extends React.Component<{}, AppState> { } showOrHideSideBars() { - if (window.innerWidth <= 1024) { + if (window.innerWidth <= 1024 || this.isTimelineView) { this.setState({ toggledLeft: false, toggledRight: false, @@ -149,13 +147,11 @@ class App extends React.Component<{}, AppState> { toggledLeft={this.state.toggledLeft} toggledRight={this.state.toggledRight} initTimelineSideBar={() => { - this.setState({ - toggledLeft: false, - toggledRight: false, - }); - this.isSideBarSet = true; + this.isTimelineView = true; + this.showOrHideSideBars(); }} revertTimelineSideBar={() => { + this.isTimelineView = false; this.showOrHideSideBars(); }} onOverlayClick={(e) => { diff --git a/src/components/pages/Timeline/index.tsx b/src/components/pages/Timeline/index.tsx index 5eb64241b553eb104f094d44825a2f7d58e92098..3347c1f34817acb4f479af7ba518a7e94503292f 100644 --- a/src/components/pages/Timeline/index.tsx +++ b/src/components/pages/Timeline/index.tsx @@ -9,7 +9,6 @@ class Timeline extends React.Component<TimelineProps, {}> { componentDidMount() {; this.props.initSideBar(); - console.log("mounted"); } componentWillUnmount() {