mirror of
https://github.com/bellingcat/ukraine-timemap.git
synced 2026-06-12 13:28:36 +03:00
Add color categories correct shade to card
This commit is contained in:
@@ -41,8 +41,10 @@ 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.event.category || 'other';
|
||||
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;
|
||||
|
||||
return (
|
||||
|
||||
@@ -22,6 +22,7 @@ class CardStack extends React.Component {
|
||||
event={event}
|
||||
language={this.props.language}
|
||||
tools={this.props.tools}
|
||||
style={this.props.style}
|
||||
isLoading={this.props.isLoading}
|
||||
getNarrativeLinks={this.props.getNarrativeLinks}
|
||||
getCategoryGroup={this.props.getCategoryGroup}
|
||||
@@ -96,8 +97,9 @@ class CardStack extends React.Component {
|
||||
function mapStateToProps(state) {
|
||||
return {
|
||||
selected: state.app.selected,
|
||||
language: state.app.selected,
|
||||
language: state.app.language,
|
||||
tools: state.ui.tools,
|
||||
style: state.ui.style,
|
||||
isCardstack: state.ui.flags.isCardstack,
|
||||
isLoading: state.ui.flags.isFetchingEvents
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ const CardCategory = ({ categoryTitle, categoryLabel, colorType }) => (
|
||||
<div className="event-card-section category">
|
||||
<h4>{categoryTitle}</h4>
|
||||
<p>
|
||||
<span className={`color-category ${colorType}`}/>
|
||||
<span className='color-category' style={{ background: colorType }}/>
|
||||
{categoryLabel}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user