Last active
July 12, 2017 12:35
-
-
Save adammark/d618cc1d9e595a58c65fd5be10900858 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
var Stars = function (props) { | |
var rating = props.rating || 0; // rating from 0 to 5, inclusive, in increments of 0.5 | |
var label = props.label || null; // a label to describe the contents (for accessibility) | |
var src = "./img/stars_" + rating + ".svg"; | |
return <img src={src} width="78" height="13" aria-label={label} data-tooltip={label}/>; | |
}; | |
module.exports = Stars; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment