From 2459043aec5bd163511ae855d8112b3571796963 Mon Sep 17 00:00:00 2001 From: Vladimir Stalmakov Date: Wed, 7 Oct 2020 18:23:24 +0300 Subject: [PATCH] added parameter activeOpacity for TouchableOpacity --- README.md | 3 ++- index.d.ts | 1 + index.js | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b03bd83..a69066e 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ const options = [ | selectedColor | string | '#fff' | false | Color text of the item selected | | buttonMargin | number | 0 | false | Margin of the item selected to component | | buttonColor | string | '#BCD635' | false | Color bg of the item selected | -| textColor | string | '#000' | false | Color text of the not selecteds items | +| textColor | string | '#000' | false | Color text of the not selected items | | backgroundColor | string | '#ffffff' | false | Color bg of the component | | borderColor | string | '#c9c9c9' | false | Border Color of the component | | borderRadius | number | 50 | false | Border Radius of the component | @@ -96,6 +96,7 @@ const options = [ | selectedTextStyle | object | {} | false | Selected text style | | textContainerStyle | object | {} | false | Style for text (and icon) container (TouchableOpacity) | | selectedTextContainerStyle | object | {} | false | Style for selected text (and icon) container (TouchableOpacity) | +| activeOpacity | number | 0.2 | false | Target opacity of selected component (TouchableOpacity) | | imageStyle | object | {} | false | Image style | | style | object | {} | false | Container style | | returnObject | bool | false | false | Indicate if onPress function return an option instead of option.value | diff --git a/index.d.ts b/index.d.ts index 7bfe404..4c14e01 100644 --- a/index.d.ts +++ b/index.d.ts @@ -40,6 +40,7 @@ declare module "react-native-switch-selector" { imageStyle?: ImageStyle | RegisteredStyle; style?: ViewStyle | RegisteredStyle; returnObject?: boolean; + activeOpacity?: number; disabled?: boolean; disableValueChangeOnPress?: boolean; } diff --git a/index.js b/index.js index 5dbcfdf..8849e62 100644 --- a/index.js +++ b/index.js @@ -141,6 +141,7 @@ export default class SwitchSelector extends Component { height, bold, disabled, + activeOpacity, buttonMargin, options, } = this.props; @@ -152,6 +153,7 @@ export default class SwitchSelector extends Component { return (