Skip to content

Instantly share code, notes, and snippets.

@tmikeschu
Last active July 17, 2017 18:13
Show Gist options
  • Save tmikeschu/e9791a1b3740f3e15e0e02e47b53baf2 to your computer and use it in GitHub Desktop.
Save tmikeschu/e9791a1b3740f3e15e0e02e47b53baf2 to your computer and use it in GitHub Desktop.
// 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