-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trend #110
base: master
Are you sure you want to change the base?
Trend #110
Conversation
|
||
const foundIndex = result.indexOf(Math.max(...result)); | ||
|
||
return playersCollection[foundIndex].vote; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some feedback, this is business code, let's extract it to the define-trend.business.ts
Instead of using map and filter, why not using redux and do this in one go
If you use reduce in the proper way you can create an struct like. {xs: 3, s: 4}
@@ -180,6 +181,12 @@ const ShowVotingResultsComponent: React.FC<ShowVotingResultsProps> = props => { | |||
<div className={classes.containerComponent}> | |||
<TablePlayerComponent playersCollection={playerVotingStatus} /> | |||
</div> | |||
<div className={classes.containerComponent}> | |||
<h2 className={classes.title}>Trend</h2> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't move this title inside TablePlayerTrendComponent
as TablePlayerComponent
? Please check TablePlayerComponent
that use Typography and headingLevel prop to change heading components by props
</TableRow> | ||
</TableHead> | ||
<TableBody className={classes.body}> | ||
<TableRow key={1}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we don't have a map, we don't need to use key
prop
Added trend functionality. When votes are tailed, it shows the preferred option.