Skip to content

TextFiled Presenter getColorByState fix #2290

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 2 commits into from
Oct 19, 2022
Merged

Conversation

adids1221
Copy link
Contributor

Description

TextFiled Presenter getColorByState fix, new util function isDesignToken.

Changelog

TextFiled Presenter getColorByState fix, new util function isDesignToken.

…o check if the color that passed is design token
Copy link
Contributor

@lidord-wix lidord-wix left a comment

Choose a reason for hiding this comment

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

Small comment :)
Also, it would be great if you'll add 2-3 simple tests for this new method.

@@ -290,6 +293,9 @@ export class Colors {
const colorB = colorStringValue(colorBValue);
return _.toLower(colorA) === _.toLower(colorB);
}
isDesignToken(color?: DesignToken) {
return !!color?.semantic || !!color?.resource_paths;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return !!color?.semantic || !!color?.resource_paths;
return color?.semantic || color?.resource_paths;

@lidord-wix lidord-wix merged commit 3f5583e into master Oct 19, 2022
adids1221 added a commit that referenced this pull request Oct 20, 2022
* TextFiled Presenter getColorByState fix, new function isDesignToken to check if the color that passed is design token

* Fixed review notes, added test to colors.spec file
@adids1221 adids1221 deleted the fix/TextField_presenter branch November 16, 2022 08:47
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