diff --git a/src/components/Card.jsx b/src/components/Card.jsx
index ee269d5..7829616 100644
--- a/src/components/Card.jsx
+++ b/src/components/Card.jsx
@@ -1,28 +1,28 @@
-import copy from '../js/data/copy.json';
+import copy from '../js/data/copy.json'
import {
isNotNullNorUndefined,
parseDate,
formatterWithYear
-} from '../js/utilities';
-import React from 'react';
+} from '../js/utilities'
+import React from 'react'
-import Spinner from './presentational/Spinner';
-import CardTimestamp from './presentational/CardTimestamp';
-import CardLocation from './presentational/CardLocation';
-import CardCaret from './presentational/CardCaret';
-import CardTags from './presentational/CardTags';
-import CardSummary from './presentational/CardSummary';
-import CardSource from './presentational/CardSource';
-import CardCategory from './presentational/CardCategory';
-import CardNarrative from './presentational/CardNarrative';
+import Spinner from './presentational/Spinner'
+import CardTimestamp from './presentational/CardTimestamp'
+import CardLocation from './presentational/CardLocation'
+import CardCaret from './presentational/CardCaret'
+import CardTags from './presentational/CardTags'
+import CardSummary from './presentational/CardSummary'
+import CardSource from './presentational/CardSource'
+import CardCategory from './presentational/CardCategory'
+import CardNarrative from './presentational/CardNarrative'
class Card extends React.Component {
constructor(props) {
- super(props);
+ super(props)
this.state = {
isHighlighted: false
- };
+ }
}
toggle() {
@@ -30,24 +30,24 @@ class Card extends React.Component {
isHighlighted: !this.state.isHighlighted
}, () => {
if (!this.state.isHighlighted) {
- this.props.onHighlight(this.props.event);
+ this.props.onHighlight(this.props.event)
} else {
- this.props.onHighlight(null);
+ this.props.onHighlight(null)
}
- });
+ })
}
makeTimelabel(timestamp) {
- if (timestamp === null) return null;
- const parsedTimestamp = parseDate(timestamp);
- const timelabel = formatterWithYear(parsedTimestamp);
- return timelabel;
+ if (timestamp === null) return null
+ const parsedTimestamp = parseDate(timestamp)
+ const timelabel = formatterWithYear(parsedTimestamp)
+ return timelabel
}
renderCategory() {
- const categoryTitle = copy[this.props.language].cardstack.category;
- const categoryLabel = this.props.event.category;
- const color = this.props.getCategoryColor(this.props.event.category);
+ const categoryTitle = copy[this.props.language].cardstack.category
+ const categoryLabel = this.props.event.category
+ const color = this.props.getCategoryColor(this.props.event.category)
return (
{this.renderSummary()}
- );
+ )
}
renderContent() {
@@ -180,8 +180,8 @@ class Card extends React.Component {
{this.renderContent()}
{this.renderCaret()}
- );
+ )
}
}
-export default Card;
+export default Card
diff --git a/src/components/CardStack.jsx b/src/components/CardStack.jsx
index 6c04976..f25e68a 100644
--- a/src/components/CardStack.jsx
+++ b/src/components/CardStack.jsx
@@ -1,44 +1,47 @@
-import React from 'react';
+import React from 'react'
import { connect } from 'react-redux'
import * as selectors from '../selectors'
-import Card from './Card.jsx';
-import copy from '../js/data/copy.json';
+import Card from './Card.jsx'
+import copy from '../js/data/copy.json'
import {
isNotNullNorUndefined
-} from '../js/utilities.js';
+} from '../js/utilities.js'
class CardStack extends React.Component {
-
- constructor(props) {
- super(props);
+ renderCards(events) {
+ return events.map(event => (
+