Skip to content

Conversation

@VeraZab
Copy link
Contributor

@VeraZab VeraZab commented Aug 2, 2018

No description provided.

@VeraZab VeraZab requested review from dmt0 and nicolaskruchten August 2, 2018 02:23
@nicolaskruchten
Copy link
Contributor

Behaviour looks good, 💃 from me subject to @dmt0 's code review

ColorPicker.propTypes = {
onColorChange: PropTypes.func.isRequired,
selectedColor: PropTypes.string,
selectedColor: PropTypes.any,
Copy link
Contributor

Choose a reason for hiding this comment

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

why?

Copy link
Contributor

Choose a reason for hiding this comment

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

There's a handy construct for this:
PropTypes.oneOfType([PropTypes.string, PropTypes.number])

}

setColor(color) {
this.props.updatePlot(color);
Copy link
Contributor

Choose a reason for hiding this comment

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

why not just pass updatePlot as a prop?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is passed, from the connect wrapper, I just prefer having a separate function,
one setColor, one setColors, that's all

{label: _('Multiple'), value: 'multiple'},
];
const selectedConstantColorOption = this.props.parentState
? this.props.parentState.selectedConstantColorOption
Copy link
Contributor

Choose a reason for hiding this comment

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

parentState only has one variable, why not just have parentSelectedConstantColorOptions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm using parent state to pass MarkerColor state, it has more than one variable.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not seeing other variables

@VeraZab VeraZab merged commit d0dbdd6 into master Aug 2, 2018
@VeraZab VeraZab deleted the s-m-colors branch August 2, 2018 15:53
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.

4 participants