Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Trend #110

wants to merge 3 commits into from

Conversation

jsagardoy
Copy link

Added trend functionality. When votes are tailed, it shows the preferred option.


const foundIndex = result.indexOf(Math.max(...result));

return playersCollection[foundIndex].vote;
Copy link
Member

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>
Copy link
Member

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}>
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants