redux action infrastructure

This commit is contained in:
Lachlan Kermode
2018-12-17 15:56:46 +00:00
parent 45c41dc352
commit 795acac7ca
5 changed files with 34 additions and 8 deletions

View File

@@ -19,6 +19,7 @@ class Dashboard extends React.Component {
constructor(props) {
super(props);
this.handleViewSource = this.handleViewSource.bind(this)
this.handleHighlight = this.handleHighlight.bind(this);
this.handleSelect = this.handleSelect.bind(this);
this.handleSelectNarrative = this.handleSelectNarrative.bind(this);
@@ -46,6 +47,11 @@ class Dashboard extends React.Component {
return this.eventsById[eventId];
}
handleViewSource(source) {
console.log('handleViewSource: to implement in Dashboard.jsx')
this.props.actions.updateSource(source)
}
handleSelect(selected) {
if (selected) {
let eventsToSelect = selected.map(event => this.getEventById(event.id));
@@ -108,6 +114,7 @@ class Dashboard extends React.Component {
: ''
}
<CardStack
onViewSource={this.handleViewSource}
onSelect={this.handleSelect}
onHighlight={this.handleHighlight}
onToggleCardstack={() => this.props.actions.updateSelected([])}