narrative movement fully redux-ized

This commit is contained in:
Lachlan Kermode
2019-01-03 17:17:50 +00:00
parent 1126d54def
commit 58b37105f5
3 changed files with 96 additions and 76 deletions

View File

@@ -33,15 +33,16 @@ class MapEvents extends React.Component {
})
if (this.props.narrative) {
// TODO: logic to display narratives in Map
// const { byId } = this.props.narrative
// const eventsInNarrative = events.filter(e => byId.hasOwnProperty(e.id))
// if (eventsInNarrative.length <= 0) {
// styleProps = {
// ...styleProps,
// fillOpacity: 0.1
// }
// }
const { steps } = this.props.narrative
const onlyIfInNarrative = e => steps.map(s => s.id).includes(e.id)
const eventsInNarrative = events.filter(onlyIfInNarrative)
if (eventsInNarrative.length <= 0) {
styleProps = {
...styleProps,
fillOpacity: 0.1
}
}
}
return (