Skip to content

Commit b665aec

Browse files
Button - change isFilled by background color (#3670)
* Refactor Button component to determine filled state based on background color * Remove unused isOutline method * Fix Button component disabled state check for outline and link types --------- Co-authored-by: Inbal Tish <[email protected]>
1 parent c4a35a8 commit b665aec

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/components/button/index.tsx

+2-7
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,13 @@ class Button extends PureComponent<Props, ButtonState> {
6161
}
6262
};
6363

64-
get isOutline() {
65-
const {outline, outlineColor} = this.props;
66-
return Boolean(outline || outlineColor);
67-
}
68-
6964
get isLink() {
7065
const {link, hyperlink} = this.props;
7166
return link || hyperlink;
7267
}
7368

7469
get isFilled() {
75-
return !this.isOutline && !this.isLink;
70+
return this.getBackgroundColor() !== 'transparent';
7671
}
7772

7873
get isIconButton() {
@@ -116,7 +111,7 @@ class Button extends PureComponent<Props, ButtonState> {
116111
color = backgroundColor === 'transparent' ? undefined : Colors.$iconDefaultLight;
117112
}
118113

119-
if (disabled && (isLink || outline)) {
114+
if (disabled && !this.isFilled) {
120115
return Colors.$textDisabled;
121116
}
122117

0 commit comments

Comments
 (0)