diff --git a/src/components/main/index.js b/src/components/main/index.js index 909286abc..f8179df87 100644 --- a/src/components/main/index.js +++ b/src/components/main/index.js @@ -128,7 +128,9 @@ class Main extends React.Component { navBarHandler={() => {this.setState({sidebarOpen: !this.state.sidebarOpen});}} /> - {this.props.narrativeIsLoaded ? renderNarrativeToggle(this.props.dispatch, this.props.displayNarrative) : null} + {this.props.narrativeIsLoaded && !this.props.panelsToDisplay.includes("EXPERIMENTAL_MainDisplayMarkdown") ? + renderNarrativeToggle(this.props.dispatch, this.props.displayNarrative) : null + } {this.props.displayNarrative ? null : } {this.props.panelsToDisplay.includes("tree") ? : null} {this.props.panelsToDisplay.includes("map") ? : null} diff --git a/src/components/narrative/MobileNarrativeDisplay.js b/src/components/narrative/MobileNarrativeDisplay.js index bb13a9a95..3bc6fdd64 100644 --- a/src/components/narrative/MobileNarrativeDisplay.js +++ b/src/components/narrative/MobileNarrativeDisplay.js @@ -4,7 +4,6 @@ import React from "react"; import { connect } from "react-redux"; import queryString from "query-string"; import { changePage, EXPERIMENTAL_showMainDisplayMarkdown } from "../../actions/navigation"; -import { TOGGLE_NARRATIVE } from "../../actions/types"; import { linkStyles, MobileBannerTop, @@ -61,7 +60,7 @@ class MobileNarrativeDisplay extends React.Component { }; this.exitNarrativeMode = () => { - this.props.dispatch({type: TOGGLE_NARRATIVE, display: false}); + this.props.dispatch(changePage({ path: this.props.blocks[0].dataset, query: true })); }; this.goToNextPage = () => { diff --git a/src/components/narrative/index.js b/src/components/narrative/index.js index 921ee92d0..5699b677b 100644 --- a/src/components/narrative/index.js +++ b/src/components/narrative/index.js @@ -14,7 +14,7 @@ import { } from './styles'; import ReactPageScroller from "./ReactPageScroller"; import { changePage, EXPERIMENTAL_showMainDisplayMarkdown } from "../../actions/navigation"; -import { CHANGE_URL_QUERY_BUT_NOT_REDUX_STATE, TOGGLE_NARRATIVE } from "../../actions/types"; +import { CHANGE_URL_QUERY_BUT_NOT_REDUX_STATE } from "../../actions/types"; import { narrativeNavBarHeight } from "../../util/globals"; /* regarding refs: https://reactjs.org/docs/refs-and-the-dom.html#exposing-dom-refs-to-parent-components */ @@ -41,7 +41,7 @@ class Narrative extends React.Component { super(props); this.state = {showingEndOfNarrativePage: false}; this.exitNarrativeMode = () => { - this.props.dispatch({type: TOGGLE_NARRATIVE, display: false}); + this.props.dispatch(changePage({ path: this.props.blocks[0].dataset, query: true })); }; this.changeAppStateViaBlock = (reactPageScrollerIdx) => { const idx = reactPageScrollerIdx-1;