Skip to content

Commit

Permalink
narratives: Refactor next button to new component
Browse files Browse the repository at this point in the history
Create a new class component for the next button in mobile narratives.
  • Loading branch information
kairstenfay committed Jan 29, 2020
1 parent 18a7f78 commit 01cc998
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/components/narrative/MobileNarrativeDisplay.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,19 @@ class MobileNarrativeDisplay extends React.Component {
{this.renderVizCards(this.state.contentHeight)}
{this.renderMainMarkdown()}
</MobileContentContainer>
<MobileBannerBottom height={bannerHeight} onClick={this.goToNextPage}>
<this.NextButton>
Next
</MobileBannerBottom>
</this.NextButton>
</>
);
}

NextButton = (props) => (
<MobileBannerBottom height={this.state.bannerHeight} onClick={this.goToNextPage}>
{props.children}
</MobileBannerBottom>
)

render() {

if (this.state.showingEndOfNarrativePage) {
Expand All @@ -180,9 +186,9 @@ class MobileNarrativeDisplay extends React.Component {
{this.renderVizCards(this.state.contentHeight)}
{this.renderMainMarkdown()}
</MobileContentContainer>
<MobileBannerBottom height={bannerHeight} onClick={this.goToNextPage}>
<this.NextButton>
Next
</MobileBannerBottom>
</this.NextButton>
</>
);
}
Expand Down

0 comments on commit 01cc998

Please sign in to comment.