mirror of
https://github.com/bellingcat/ukraine-timemap.git
synced 2026-06-13 05:48:36 +03:00
make USE_CATEGORIES optional
This commit is contained in:
@@ -16,6 +16,7 @@ import Notification from './Notification.jsx'
|
||||
import StaticPage from './StaticPage'
|
||||
import TemplateCover from './TemplateCover'
|
||||
|
||||
import colors from '../common/global'
|
||||
import { binarySearch } from '../common/utilities'
|
||||
import { isMobile } from 'react-device-detect'
|
||||
|
||||
@@ -87,6 +88,8 @@ class Dashboard extends React.Component {
|
||||
}
|
||||
|
||||
getCategoryColor (category) {
|
||||
if (!this.props.features.USE_CATEGORIES) { return colors.fallbackEventColor }
|
||||
|
||||
const cat = this.props.ui.style.categories[category]
|
||||
if (cat) {
|
||||
return cat
|
||||
@@ -168,7 +171,7 @@ class Dashboard extends React.Component {
|
||||
methods={{
|
||||
onSelect: ev => this.handleSelect(ev, 0),
|
||||
onUpdateTimerange: actions.updateTimeRange,
|
||||
getCategoryColor: category => this.getCategoryColor(category)
|
||||
getCategoryColor: this.getCategoryColor
|
||||
}}
|
||||
/>
|
||||
<CardStack
|
||||
@@ -177,7 +180,7 @@ class Dashboard extends React.Component {
|
||||
onHighlight={this.handleHighlight}
|
||||
onToggleCardstack={() => actions.updateSelected([])}
|
||||
getNarrativeLinks={event => this.getNarrativeLinks(event)}
|
||||
getCategoryColor={category => this.getCategoryColor(category)}
|
||||
getCategoryColor={this.getCategoryColor}
|
||||
/>
|
||||
<NarrativeControls
|
||||
narrative={app.narrative ? {
|
||||
|
||||
Reference in New Issue
Block a user