mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-01-13 08:47:55 -05:00
* Update browser compiler * Argument parsing tests require CommonJS environment * JSX section in the docs * Breaking change note for < and > operators * Fix JSX example * Try CoffeeScript improvements: set the hash automatically, remove ‘link’ button, automatically save code in localStorage * Fix the code editors’ handling of tab-indented code * Fix JSX example to work with React * Compiled, not rendered
10 lines
386 B
CoffeeScript
10 lines
386 B
CoffeeScript
renderStarRating = ({ rating, maxStars }) ->
|
|
<aside title={"Rating: #{rating} of #{maxStars} stars"}>
|
|
{for wholeStar in [0...Math.floor(rating)]
|
|
<Star className="wholeStar" key={wholeStar} />}
|
|
{if rating % 1 isnt 0
|
|
<Star className="halfStar" />}
|
|
{for emptyStar in [Math.ceil(rating)...maxStars]
|
|
<Star className="emptyStar" key={emptyStar} />}
|
|
</aside>
|