Created
December 15, 2018 14:40
-
-
Save productioncoder/e0133c97963e199ff392b0735ab59c82 to your computer and use it in GitHub Desktop.
Youtube in React: Rating component skeleton
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
import React from 'react'; | |
import './Rating.scss'; | |
import {Icon, Progress} from "semantic-ui-react"; | |
export function Rating() { | |
let progress = null; | |
if (props.likeCount && props.dislikeCount) { | |
const percent = 100 * (props.likeCount / (props.likeCount + props.dislikeCount)); | |
progress = <Progress className='progress' percent={percent} size='tiny'/>; | |
} | |
/* return (...) */ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment