Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand All @@ -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 |
Expand Down
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ declare module "react-native-switch-selector" {
imageStyle?: ImageStyle | RegisteredStyle<ImageStyle>;
style?: ViewStyle | RegisteredStyle<ViewStyle>;
returnObject?: boolean;
activeOpacity?: number;
disabled?: boolean;
disableValueChangeOnPress?: boolean;
}
Expand Down
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ export default class SwitchSelector extends Component {
height,
bold,
disabled,
activeOpacity,
buttonMargin,
options,
} = this.props;
Expand All @@ -152,6 +153,7 @@ export default class SwitchSelector extends Component {

return (
<TouchableOpacity
activeOpacity={activeOpacity}
key={index}
disabled={disabled}
style={[
Expand Down Expand Up @@ -282,6 +284,7 @@ SwitchSelector.defaultProps = {
buttonColor: '#BCD635',
returnObject: false,
animationDuration: 100,
activeOpacity: 0.2,
disabled: false,
disableValueChangeOnPress: false,
initial: -1,
Expand Down Expand Up @@ -312,6 +315,7 @@ SwitchSelector.propTypes = {
buttonColor: PropTypes.string,
returnObject: PropTypes.bool,
animationDuration: PropTypes.number,
activeOpacity: PropTypes.number,
disabled: PropTypes.bool,
disableValueChangeOnPress: PropTypes.bool,
initial: PropTypes.number,
Expand Down