-
-
Notifications
You must be signed in to change notification settings - Fork 114
ColorPicker => MultiColorPicker #625
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
Conversation
|
Behaviour looks good, 💃 from me subject to @dmt0 's code review |
| ColorPicker.propTypes = { | ||
| onColorChange: PropTypes.func.isRequired, | ||
| selectedColor: PropTypes.string, | ||
| selectedColor: PropTypes.any, |
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?
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.
There's a handy construct for this:
PropTypes.oneOfType([PropTypes.string, PropTypes.number])
| } | ||
|
|
||
| setColor(color) { | ||
| this.props.updatePlot(color); |
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 not just pass updatePlot as a prop?
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.
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 |
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.
parentState only has one variable, why not just have parentSelectedConstantColorOptions?
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.
I'm using parent state to pass MarkerColor state, it has more than one variable.
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.
I'm not seeing other variables
No description provided.