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

Add react-svg-piechart #24

Merged
merged 2 commits into from
Aug 15, 2018
Merged

Add react-svg-piechart #24

merged 2 commits into from
Aug 15, 2018

Conversation

Tuhaj
Copy link
Member

@Tuhaj Tuhaj commented Jun 20, 2018

No description provided.

Copy link
Contributor

@kgajowy kgajowy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks nice - I would love to see any tooltips over those charts when hovering. Enlarge 'effect' rocks! :)

import Colors from '../../styles/Colors';

const Participants = props => {
const VOTES_NEEDED = 40;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as this is a render method, you are re-declaring const meant in each rendering. What do you think to move out the VOTES_NEEDED and Chart Data out of this function?

import PieChart from 'react-svg-piechart';
import Colors from '../../styles/Colors';

const Participants = props => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A general rule of thumb is - if you are using any object more than once, destruct it! (you may want to take a look at fb's react's example there

In Participants we have it twice, so we can improve it by declaring:
const Participants = ({likes}) => { ... }

return (<StyledParticipants>
<PieChart
data={chartData}
// If you need expand on hover (or touch) effect
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[opinion/minor] I believe that props are more like self-explandatory - thus no additional comments are necessary

@Tuhaj Tuhaj merged commit 9a27582 into feature/trainers Aug 15, 2018
@Tuhaj Tuhaj deleted the feature/piechart branch August 15, 2018 10:24
Tuhaj pushed a commit that referenced this pull request Aug 15, 2018
* Add react-svg-piechart

* Update after CR
Tuhaj pushed a commit that referenced this pull request Aug 15, 2018
* chore: update Trainer component and add tests

* chore: add TrainersList tests

* Disable lint for redux devtools extension

* chore: update argument naming to be more meaningful

* Add react-svg-piechart (#24)

* Add react-svg-piechart

* Update after CR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants