Skip to content

Commit

Permalink
narrative: leave narrative
Browse files Browse the repository at this point in the history
Clicking on "Leave the narrative & explore the data yourself" completely
leaves the narrative and goes to the dataset page.
  • Loading branch information
joverlee521 committed Feb 1, 2020
1 parent 645dbe2 commit cd5cf77
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/components/narrative/MobileNarrativeDisplay.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 = () => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/narrative/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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;
Expand Down

0 comments on commit cd5cf77

Please sign in to comment.