All components use getCategoryColor

This commit is contained in:
Franc Camps-Febrer
2018-12-03 14:50:38 +00:00
parent 0a6ba78389
commit b7c73ab9bd
6 changed files with 10 additions and 19 deletions

View File

@@ -41,17 +41,15 @@ class Card extends React.Component {
}
renderCategory() {
const eventCat = this.props.event.category || 'other';
const categoryTitle = copy[this.props.language].cardstack.category;
const colorType = this.props.style.categories[eventCat] || this.props.style.categories['other'];
console.log(eventCat, this.props.event.category, this.props.style.categories)
const categoryLabel = this.props.event.category;
const color = this.props.getCategoryColor(this.props.event.category);
return (
<CardCategory
categoryTitle={categoryTitle}
categoryLabel={categoryLabel}
colorType={colorType}
color={color}
/>
);
}