mirror of
https://github.com/bellingcat/ukraine-timemap.git
synced 2026-06-12 21:38:35 +03:00
Select only updateNarrative as action to pass to Toolbar
This commit is contained in:
committed by
Lachlan Kermode
parent
58aaadc5d4
commit
6dee9fee2f
@@ -36,17 +36,6 @@ class CardStack extends React.Component {
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
renderLocation() {
|
|
||||||
let locationName = copy[this.props.language].cardstack.unknown_location;
|
|
||||||
if (this.props.selected.length > 0) {
|
|
||||||
if (isNotNullNorUndefined(this.props.selected[0].location)) {
|
|
||||||
locationName = this.props.selected[0].location;
|
|
||||||
}
|
|
||||||
return (<p className="header-copy">in:<b>{` ${locationName}`}</b></p>)
|
|
||||||
}
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
renderCardStackHeader() {
|
renderCardStackHeader() {
|
||||||
const header_lang = copy[this.props.language].cardstack.header;
|
const header_lang = copy[this.props.language].cardstack.header;
|
||||||
|
|
||||||
|
|||||||
@@ -76,23 +76,17 @@ class Dashboard extends React.Component {
|
|||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
<Toolbar
|
||||||
|
onFilter={this.handleTagFilter}
|
||||||
|
onSelectNarrative={(narrative) => { this.props.actions.updateNarrative(narrative); }}
|
||||||
|
actions={this.props.actions}
|
||||||
|
/>
|
||||||
<Viewport
|
<Viewport
|
||||||
methods={{
|
methods={{
|
||||||
onSelect: this.handleSelect,
|
onSelect: this.handleSelect,
|
||||||
getCategoryColor: category => this.getCategoryColor(category)
|
getCategoryColor: category => this.getCategoryColor(category)
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Toolbar
|
|
||||||
onFilter={this.handleTagFilter}
|
|
||||||
actions={this.props.actions}
|
|
||||||
/>
|
|
||||||
<CardStack
|
|
||||||
onSelect={this.handleSelect}
|
|
||||||
onHighlight={this.handleHighlight}
|
|
||||||
onToggleCardstack={() => this.props.actions.updateSelected([])}
|
|
||||||
getNarrativeLinks={event => this.getNarrativeLinks(event)}
|
|
||||||
getCategoryColor={category => this.getCategoryColor(category)}
|
|
||||||
/>
|
|
||||||
<Timeline
|
<Timeline
|
||||||
methods={{
|
methods={{
|
||||||
onSelect: this.handleSelect,
|
onSelect: this.handleSelect,
|
||||||
@@ -100,15 +94,22 @@ class Dashboard extends React.Component {
|
|||||||
getCategoryColor: category => this.getCategoryColor(category)
|
getCategoryColor: category => this.getCategoryColor(category)
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
<NarrativeCard
|
||||||
|
onSelect={this.handleSelect}
|
||||||
|
onSelectNarrative={(narrative) => { this.props.actions.updateNarrative(narrative); }}
|
||||||
|
/>
|
||||||
|
<CardStack
|
||||||
|
onSelect={this.handleSelect}
|
||||||
|
onHighlight={this.handleHighlight}
|
||||||
|
onToggleCardstack={() => this.props.actions.updateSelected([])}
|
||||||
|
getNarrativeLinks={event => this.getNarrativeLinks(event)}
|
||||||
|
getCategoryColor={category => this.getCategoryColor(category)}
|
||||||
|
/>
|
||||||
<InfoPopUp
|
<InfoPopUp
|
||||||
ui={this.props.ui}
|
ui={this.props.ui}
|
||||||
app={this.props.app}
|
app={this.props.app}
|
||||||
toggle={() => this.props.actions.toggleInfoPopup()}
|
toggle={() => this.props.actions.toggleInfoPopup()}
|
||||||
/>
|
/>
|
||||||
<NarrativeCard
|
|
||||||
onSelect={this.handleSelect}
|
|
||||||
actions={this.props.actions}
|
|
||||||
/>
|
|
||||||
<Notification
|
<Notification
|
||||||
isNotification={this.props.app.flags.isNotification}
|
isNotification={this.props.app.flags.isNotification}
|
||||||
notifications={this.props.domain.notifications}
|
notifications={this.props.domain.notifications}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ class Toolbar extends React.Component {
|
|||||||
this.setState({
|
this.setState({
|
||||||
tabNum: -1
|
tabNum: -1
|
||||||
}, () => {
|
}, () => {
|
||||||
this.props.actions.updateNarrative(narrative);
|
this.props.onSelectNarrative(narrative);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ function updateNarrative(appState, action) {
|
|||||||
// Add some margin to the datetime extent
|
// Add some margin to the datetime extent
|
||||||
minDate = minDate - ((maxDate - minDate) / 20);
|
minDate = minDate - ((maxDate - minDate) / 20);
|
||||||
maxDate = maxDate + ((maxDate - minDate) / 20);
|
maxDate = maxDate + ((maxDate - minDate) / 20);
|
||||||
|
return appState;
|
||||||
return Object.assign({}, appState, {
|
return Object.assign({}, appState, {
|
||||||
narrative: action.narrative,
|
narrative: action.narrative,
|
||||||
filters: Object.assign({}, appState.filters, {
|
filters: Object.assign({}, appState.filters, {
|
||||||
|
|||||||
Reference in New Issue
Block a user