-
Notifications
You must be signed in to change notification settings - Fork 734
Separate icon color passed in Button from icon style #3180
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
@@ -124,6 +124,17 @@ class Button extends PureComponent<Props, ButtonState> { | |||
return color; | |||
} | |||
|
|||
getIconColor(): string | undefined { | |||
const {disabled} = this.props; | |||
let tintColor = this.getLabelColor(); |
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.
That ignores the tintColor passed in iconStyle, no?
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.
no, passing iconStyle is always prioritized and it's include in the getIconStyle
method
getIconColor is basically responsible for our logic that returns the icon 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.
Wait. You mean it is prioritized in the Icon component because you now override the style with props.style, right?
* Separate icon color passed in Button from icon style * Update snapshot tests * Add more examples and tests for icon color in Button
Description
Separate the icon color we pass in Button from the icon style object.
This allows up to pass iconColor to the
tintColor
prop and allow the user to override it color properlyChangelog
Fix issue with Button's icon color not being overridden when passing
iconProps
/iconStyle
Additional info