Skip to content

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

Merged
merged 6 commits into from
Mar 26, 2023
Merged

New colors screen #2510

merged 6 commits into from
Mar 26, 2023

Conversation

adids1221
Copy link
Contributor

Description

New colors screen.

Changelog

New colors screen.

@adids1221 adids1221 marked this pull request as ready for review March 5, 2023 14:28
@Inbal-Tish Inbal-Tish changed the title New colors screen, same as private screen New colors screen Mar 14, 2023
@adids1221 adids1221 requested a review from Inbal-Tish March 16, 2023 09:00
constructor(props) {
super(props);

this.extraColors = this.props.extraColors;
Copy link
Collaborator

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 || []),
Copy link
Collaborator

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

Copy link
Contributor Author

@adids1221 adids1221 Mar 16, 2023

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.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes

@Inbal-Tish
Copy link
Collaborator

@adids1221 Looks good. 2 little comments

@adids1221 adids1221 requested a review from Inbal-Tish March 16, 2023 10:06
@Inbal-Tish Inbal-Tish merged commit db666e2 into master Mar 26, 2023
@adids1221 adids1221 deleted the infra/colors_screen branch April 17, 2023 08:27
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.

2 participants