Last active
July 17, 2017 18:13
-
-
Save tmikeschu/d49a5406fe1ea0d9f6303b40cc62fdd2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// src/App/Map/Legend/Legend.jsx | |
import React, { Component } from 'react' | |
import Category from './Category/Category' | |
import { categoryIcons } from '../category_data' | |
export default class Legend extends Component { | |
categoryIcons() { | |
return categoryIcons | |
} | |
render() { | |
const legendCategories = this.props.categories.map((category, i) => { | |
return( | |
<Category key={i} category={category} /> | |
) | |
}) | |
return ( | |
<article className="legend"> | |
<h4>Legend</h4> | |
<ul> | |
... | |
<li> | |
<span> | |
<img src={this.categoryIcons()["cycling"]} alt="cyclist"/> | |
</span> → That's Us! ( as of {this.props.date} ) | |
</li> | |
<li> | |
<span> | |
<img src={this.categoryIcons()["endOfDay"]} alt="flag"/> | |
</span> → Day-to-Day | |
</li> | |
{ legendCategories } | |
</ul> | |
</article> | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment