diff --git a/packages/mobile/src/components/buttons/default-button.tsx b/packages/mobile/src/components/buttons/default-button.tsx index 6b51b26924..95c4d077e7 100644 --- a/packages/mobile/src/components/buttons/default-button.tsx +++ b/packages/mobile/src/components/buttons/default-button.tsx @@ -6,12 +6,24 @@ import { GestureResponderEvent, } from "react-native"; import { Button } from "react-native-elements"; -import { bw1, flex1, br1, px4, sf, buttonFont1, py3 } from "../../styles"; +import { + bw1, + flex1, + br1, + px4, + sf, + buttonFont1, + py3, + fcWhite, + bgcPrimary200, +} from "../../styles"; type DefalutButtonProps = { containerStyle?: StyleProp[]; buttonStyle?: StyleProp[]; titleStyle?: StyleProp[]; + disabledStyle?: StyleProp[]; + disabledTitleStyle?: StyleProp[]; disabled?: boolean; loading?: boolean; title: string; @@ -20,8 +32,10 @@ type DefalutButtonProps = { export const DefaultButton: FunctionComponent = ({ containerStyle = [], - buttonStyle = [], titleStyle = [], + buttonStyle = [], + disabledStyle = [], + disabledTitleStyle = [], title, disabled, loading, @@ -33,9 +47,11 @@ export const DefaultButton: FunctionComponent = ({ buttonStyle={sf([bw1, br1, px4, py3, ...buttonStyle])} titleStyle={sf([buttonFont1, ...titleStyle])} title={title} + disabled={disabled} + disabledStyle={sf([bgcPrimary200, ...disabledStyle])} + disabledTitleStyle={sf([fcWhite, ...disabledTitleStyle])} onPress={onPress} loading={loading} - disabled={disabled} /> ); }; diff --git a/packages/mobile/src/components/buttons/white-button.tsx b/packages/mobile/src/components/buttons/white-button.tsx index 4fb4302639..6d02f1604e 100644 --- a/packages/mobile/src/components/buttons/white-button.tsx +++ b/packages/mobile/src/components/buttons/white-button.tsx @@ -23,12 +23,18 @@ import { bgcWhite, buttonFont1, py3, + bcPrimary200, + fcPrimary200, + bcSecondary200, + fcSecondary200, } from "../../styles"; type WhiteButtonProps = { containerStyle?: StyleProp[]; buttonStyle?: StyleProp[]; titleStyle?: StyleProp[]; + disabledStyle?: StyleProp[]; + disabledTitleStyle?: StyleProp[]; disabled?: boolean; loading?: boolean; color?: "primary" | "secondary" | "error" | "warning"; @@ -40,6 +46,8 @@ export const WhiteButton: FunctionComponent = ({ containerStyle = [], buttonStyle = [], titleStyle = [], + disabledStyle = [], + disabledTitleStyle = [], title, color, disabled, @@ -61,6 +69,21 @@ export const WhiteButton: FunctionComponent = ({ } })(); + const [disabledBorderColor, disabledFontColor] = (() => { + switch (color) { + case "primary": + return [bcPrimary200, fcPrimary200]; + case "secondary": + return [bcSecondary200, fcSecondary200]; + case "warning": + return [bcWarining, fcWarining]; + case "error": + return [bcError, fcError]; + default: + return [bcPrimary, fcPrimary]; + } + })(); + return (