From b4d8c09dd10daaecefc0b1c1ddaed3a000556134 Mon Sep 17 00:00:00 2001 From: Sol Date: Mon, 27 Jul 2020 14:19:37 +0100 Subject: [PATCH] rename variables --- src/components/Card.jsx | 2 +- src/components/CardStack.jsx | 3 +-- src/components/Layout.js | 12 ++++++------ src/components/Map.jsx | 2 +- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/components/Card.jsx b/src/components/Card.jsx index b13b9c2..fbce6eb 100644 --- a/src/components/Card.jsx +++ b/src/components/Card.jsx @@ -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={this.props.onClick} > {this.renderMain()} {this.state.isOpen ? this.renderExtra() : null} diff --git a/src/components/CardStack.jsx b/src/components/CardStack.jsx index a128346..a3dc5a0 100644 --- a/src/components/CardStack.jsx +++ b/src/components/CardStack.jsx @@ -61,7 +61,6 @@ class CardStack extends React.Component { this.refs[idx] = thisRef return ( this.props.onSelectNarrativeStep(idx)} />) }) } diff --git a/src/components/Layout.js b/src/components/Layout.js index 0160a0b..accbc00 100644 --- a/src/components/Layout.js +++ b/src/components/Layout.js @@ -35,7 +35,7 @@ class Dashboard extends React.Component { this.getCategoryColor = this.getCategoryColor.bind(this) this.findEventIdx = this.findEventIdx.bind(this) this.onKeyDown = this.onKeyDown.bind(this) - this.selectNarrativeEvent = this.selectNarrativeEvent.bind(this) + this.selectNarrativeStep = this.selectNarrativeStep.bind(this) } componentDidMount () { @@ -182,15 +182,15 @@ class Dashboard extends React.Component { if (amt === 1) { const idx = current + 1 - this.selectNarrativeEvent(idx) + this.selectNarrativeStep(idx) } if (amt === -1) { const idx = current - 1 - this.selectNarrativeEvent(idx) + this.selectNarrativeStep(idx) } } - selectNarrativeEvent (idx) { + selectNarrativeStep (idx) { const { narrative } = this.props.app if (narrative === null) return @@ -276,7 +276,7 @@ class Dashboard extends React.Component { onSelect: ev => this.handleSelect(ev, 1), onSelectNarrative: this.setNarrative, getCategoryColor: this.getCategoryColor, - onSelectNarrativeEvent: this.selectNarrativeEvent + onSelectNarrativeStep: this.selectNarrativeStep }} /> actions.updateSelected([])} getNarrativeLinks={event => this.getNarrativeLinks(event)} getCategoryColor={this.getCategoryColor} - onSelectNarrativeEvent={this.selectNarrativeEvent} + onSelectNarrativeStep={this.selectNarrativeStep} /> 0} diff --git a/src/components/Map.jsx b/src/components/Map.jsx index 1e70b74..6e1ae04 100644 --- a/src/components/Map.jsx +++ b/src/components/Map.jsx @@ -214,7 +214,7 @@ class Map extends React.Component { selected={this.props.app.selected} narrative={this.props.app.narrative} onSelect={this.props.methods.onSelect} - onSelectNarrative={this.props.methods.onSelectNarrativeEvent} + onSelectNarrative={this.props.methods.onSelectNarrativeStep} getCategoryColor={this.props.methods.getCategoryColor} eventRadius={this.props.ui.eventRadius} />