Created
September 9, 2017 13:09
-
-
Save DZuz14/8a382c47f8c845b57a15ce0e7ea5e2f3 to your computer and use it in GitHub Desktop.
Controls
This file contains 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
/** | |
* Displays count and houses the increment and decrement buttons | |
*/ | |
const Controls = ({ id, increment, decrement, count }) => { | |
return ( | |
<div className="controls"> | |
<div data-id={id} className="minus" onClick={e => decrement(e.target.getAttribute("data-id"))}> | |
- | |
</div> | |
<div className="counter"> | |
{count} | |
</div> | |
<div data-id={id} className="plus" onClick={e => increment(e.target.getAttribute("data-id")) }> | |
+ | |
</div> | |
</div> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment