mirror of
https://github.com/bellingcat/ukraine-timemap.git
synced 2026-06-12 05:18:34 +03:00
lint fixes
This commit is contained in:
@@ -264,7 +264,7 @@ export const SELECT_NARRATIVE_EVENT = 'SELECT_NARRATIVE_EVENT'
|
||||
export function selectNarrativeEvent (idx) {
|
||||
return {
|
||||
type: SELECT_NARRATIVE_EVENT,
|
||||
idx
|
||||
idx
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -163,8 +163,8 @@ class Card extends React.Component {
|
||||
/>
|
||||
) : null
|
||||
}
|
||||
|
||||
render () {
|
||||
|
||||
render () {
|
||||
const { isSelected, idx } = this.props
|
||||
|
||||
return (
|
||||
@@ -172,7 +172,7 @@ class Card extends React.Component {
|
||||
className={`event-card ${isSelected ? 'selected' : ''}`}
|
||||
id={`event-card-${idx}`}
|
||||
ref={this.props.innerRef}
|
||||
onClick={(e) => {this.props.onClick(idx);} }
|
||||
onClick={(e) => { this.props.onClick(idx) }}
|
||||
>
|
||||
{this.renderMain()}
|
||||
{this.state.isOpen ? this.renderExtra() : null}
|
||||
|
||||
@@ -10,7 +10,7 @@ import copy from '../common/data/copy.json'
|
||||
class CardStack extends React.Component {
|
||||
constructor () {
|
||||
super()
|
||||
this.onCardClick = this.onCardClick.bind(this)
|
||||
this.onCardClick = this.onCardClick.bind(this)
|
||||
this.refs = {}
|
||||
this.refCardStack = React.createRef()
|
||||
this.refCardStackContent = React.createRef()
|
||||
@@ -64,7 +64,7 @@ class CardStack extends React.Component {
|
||||
this.refs[idx] = thisRef
|
||||
return (<Card
|
||||
event={event}
|
||||
idx={idx}
|
||||
idx={idx}
|
||||
ref={thisRef}
|
||||
sourceError={this.props.sourceError}
|
||||
language={this.props.language}
|
||||
@@ -78,13 +78,13 @@ class CardStack extends React.Component {
|
||||
onHighlight={this.props.onHighlight}
|
||||
onSelect={this.props.onSelect}
|
||||
features={this.props.features}
|
||||
onClick={this.onCardClick}
|
||||
onClick={this.onCardClick}
|
||||
/>)
|
||||
})
|
||||
}
|
||||
|
||||
onCardClick (idx) {
|
||||
this.props.actions.selectNarrativeEvent(idx)
|
||||
this.props.actions.selectNarrativeEvent(idx)
|
||||
}
|
||||
|
||||
renderSelectedCards () {
|
||||
@@ -135,7 +135,7 @@ class CardStack extends React.Component {
|
||||
renderNarrativeContent () {
|
||||
return (
|
||||
<div id='card-stack-content' className='card-stack-content'
|
||||
ref={this.refCardStackContent}
|
||||
ref={this.refCardStackContent}
|
||||
>
|
||||
<ul>
|
||||
{this.renderNarrativeCards()}
|
||||
|
||||
@@ -207,7 +207,7 @@ class Map extends React.Component {
|
||||
|
||||
onSelectNarrativeEvent (idx) {
|
||||
console.log(idx)
|
||||
this.props.actions.selectNarrativeEvent(idx)
|
||||
this.props.actions.selectNarrativeEvent(idx)
|
||||
}
|
||||
|
||||
renderEvents () {
|
||||
|
||||
@@ -14,7 +14,7 @@ function MapEvents ({
|
||||
svg,
|
||||
locations,
|
||||
eventRadius,
|
||||
onSelectNarrative
|
||||
onSelectNarrative
|
||||
}) {
|
||||
function getCoordinatesForPercent (radius, percent) {
|
||||
const x = radius * Math.cos(2 * Math.PI * percent)
|
||||
@@ -112,7 +112,7 @@ function MapEvents ({
|
||||
// in narrative mode, only render events in narrative
|
||||
// TODO: move this to a selector
|
||||
// Gets around if block scope
|
||||
var narrativeIdx = false;
|
||||
var narrativeIdx = false
|
||||
|
||||
if (narrative) {
|
||||
const { steps } = narrative
|
||||
@@ -123,8 +123,8 @@ function MapEvents ({
|
||||
return null
|
||||
} else {
|
||||
// choose the first event at a given location
|
||||
const locationEventId = eventsInNarrative[0].id;
|
||||
const narrativeIdxObj = steps.find(s => s.id == locationEventId)
|
||||
const locationEventId = eventsInNarrative[0].id
|
||||
const narrativeIdxObj = steps.find(s => s.id === locationEventId)
|
||||
narrativeIdx = steps.indexOf(narrativeIdxObj)
|
||||
}
|
||||
}
|
||||
@@ -136,7 +136,7 @@ function MapEvents ({
|
||||
</React.Fragment>
|
||||
)
|
||||
|
||||
const isSelected = selected.reduce((acc, event) => {
|
||||
const isSelected = selected.reduce((acc, event) => {
|
||||
return acc || (event.latitude === location.latitude && event.longitude === location.longitude)
|
||||
}, false)
|
||||
|
||||
@@ -144,7 +144,7 @@ function MapEvents ({
|
||||
<g
|
||||
className={`location-event ${narrative ? 'no-hover' : ''}`}
|
||||
transform={`translate(${x}, ${y})`}
|
||||
onClick={(!narrative) ? () => onSelect(location.events) : () => {onSelectNarrative(narrativeIdx); onSelect(location.events)}}
|
||||
onClick={(!narrative) ? () => onSelect(location.events) : () => { onSelectNarrative(narrativeIdx); onSelect(location.events) }}
|
||||
>
|
||||
{renderLocationSlicesByCategory(location)}
|
||||
{extraRender ? extraRender() : null}
|
||||
|
||||
@@ -122,13 +122,13 @@ function decrementNarrativeCurrent (appState, action) {
|
||||
}
|
||||
|
||||
function selectNarrativeEvent (appState, action) {
|
||||
appState.narrativeState.current = action.idx
|
||||
appState.narrativeState.current = action.idx
|
||||
|
||||
return {
|
||||
...appState,
|
||||
narrativeState: {
|
||||
current: appState.narrativeState.current
|
||||
}
|
||||
current: appState.narrativeState.current
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user