Last active
July 17, 2017 18:13
-
-
Save tmikeschu/e9791a1b3740f3e15e0e02e47b53baf2 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/SideWrapper/Legend/Legend.jsx | |
import React from 'react' | |
... | |
import Category from './Category/Category' | |
import { categoryIcons } from '../../category_data' | |
const Legend = ({ categories, date, toggleFlags }) => { | |
const legendCategories = categories.map((category, i) => ( | |
<Category key={i} category={category} /> | |
)) | |
return ( | |
<article className="legend"> | |
<h4>Legend</h4> | |
<ul> | |
... | |
<li> | |
<span> | |
<img src={categoryIcons["cycling"]} alt="cyclist"/> | |
</span> → That's Us! ( as of {date} ) | |
</li> | |
<li> | |
<span> | |
<img src={categoryIcons["endOfDay"]} alt="flag" onClick={toggleFlags} /> | |
</span> → Day-to-Day (click flag to hide/show flag markers) | |
</li> | |
{ legendCategories } | |
</ul> | |
</article> | |
) | |
} | |
... | |
export default Legend |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment