Skip to content

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}

<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.

3 participants