Skip to content

Commit 13c7d4c

Browse files
authored
feat/add disabledBackgroundColor API for Button (#899)
* feat/add disabledBackgroundColor API for Button * clean code
1 parent 1e86e5f commit 13c7d4c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/components/button/index.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ export type ButtonPropTypes = TouchableOpacityProps &
6060
* Color of the button background
6161
*/
6262
backgroundColor?: string;
63+
/**
64+
* Color of the disabled button background
65+
*/
66+
disabledBackgroundColor?: string;
6367
/**
6468
* Size of the button [large, medium, small, xSmall]
6569
*/
@@ -250,12 +254,12 @@ class Button extends PureComponent<Props, ButtonState> {
250254

251255
getBackgroundColor() {
252256
const {backgroundColor: themeBackgroundColor, modifiers} = this.props;
253-
const {disabled, outline, link, backgroundColor: propsBackgroundColor} = this.props;
257+
const {disabled, outline, link, disabledBackgroundColor, backgroundColor: propsBackgroundColor} = this.props;
254258
const {backgroundColor: stateBackgroundColor} = modifiers;
255259

256260
if (!outline && !link) {
257261
if (disabled) {
258-
return ThemeManager.CTADisabledColor;
262+
return disabledBackgroundColor || ThemeManager.CTADisabledColor;
259263
}
260264

261265
return propsBackgroundColor || stateBackgroundColor || themeBackgroundColor || Colors.blue30;

0 commit comments

Comments
 (0)