refactor controls out of NarrativeCard

This commit is contained in:
Lachlan Kermode
2019-01-08 16:59:42 +00:00
parent 002447e707
commit 51d7dd8191
5 changed files with 78 additions and 45 deletions

View File

@@ -9,15 +9,13 @@ import LoadingOverlay from './presentational/LoadingOverlay'
import Map from './Map.jsx'
import Toolbar from './Toolbar.jsx'
import CardStack from './CardStack.jsx'
import NarrativeCard from './presentational/NarrativeCard.js'
import NarrativeControls from './presentational/NarrativeControls.js'
import InfoPopUp from './InfoPopup.jsx'
import Timeline from './Timeline.jsx'
import Notification from './Notification.jsx'
import { parseDate } from '../js/utilities'
import { injectNarrative } from '../js/utilities'
class Dashboard extends React.Component {
constructor(props) {
super(props)
@@ -119,13 +117,6 @@ class Dashboard extends React.Component {
getCategoryColor: category => this.getCategoryColor(category)
}}
/>
<NarrativeCard
methods={{
onNext: () => this.moveInNarrative(1),
onPrev: () => this.moveInNarrative(-1),
onSelectNarrative: this.setNarrative
}}
/>
<CardStack
onViewSource={this.handleViewSource}
onSelect={this.handleSelect}
@@ -134,6 +125,13 @@ class Dashboard extends React.Component {
getNarrativeLinks={event => this.getNarrativeLinks(event)}
getCategoryColor={category => this.getCategoryColor(category)}
/>
<NarrativeControls
methods={{
onNext: () => this.moveInNarrative(1),
onPrev: () => this.moveInNarrative(-1),
onSelectNarrative: this.setNarrative
}}
/>
<InfoPopUp
ui={ui}
app={app}