-
Notifications
You must be signed in to change notification settings - Fork 734
New colors screen #2510
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
New colors screen #2510
Conversation
constructor(props) { | ||
super(props); | ||
|
||
this.extraColors = this.props.extraColors; |
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.
if you're in the c'tor you don't need the 'this' before props, they are passed as a parameter. By the way, you don't need a c'tor at all as you can get the props using 'this' (as you did here).
onTokenPress = value => { | ||
const systemColorName = Colors.getSystemColorByHex(Colors[value].toString(), [ | ||
...SYSTEM_COLORS, | ||
...(this.extraColors || []), |
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.
Did you check if it crashes when you spread undefined? If it is, you can set the empty array as the const default to avoid this condition... it will look and read better
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.
@Inbal-Tish Yes, I checked for crashes, this is why I used the condition inside the spread here.
Do you mean something like this?
const {extraColors=[]} = this.props
inside the relevant function.
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.
Yes
@adids1221 Looks good. 2 little comments |
Description
New colors screen.
Changelog
New colors screen.