From 2b14cf9d4bb61cb2cfffbea2a8dfe808ea73eee9 Mon Sep 17 00:00:00 2001 From: Raffaele Decarli Date: Thu, 6 Aug 2020 12:26:31 +0200 Subject: [PATCH] added buttonStyle prop --- .gitignore | 1 + index.d.ts | 1 + index.js | 4 ++++ package.json | 5 +++-- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index e45b559..949aca4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ example/ node_modules/ +.idea diff --git a/index.d.ts b/index.d.ts index 7bfe404..a3866df 100644 --- a/index.d.ts +++ b/index.d.ts @@ -24,6 +24,7 @@ declare module "react-native-switch-selector" { selectedColor?: string; buttonMargin?: number; buttonColor?: string; + buttonStyle?: object; textColor?: string; backgroundColor?: string; borderColor?: string; diff --git a/index.js b/index.js index 5dbcfdf..ca76e20 100644 --- a/index.js +++ b/index.js @@ -142,6 +142,7 @@ export default class SwitchSelector extends Component { bold, disabled, buttonMargin, + buttonStyle, options, } = this.props; @@ -246,6 +247,7 @@ export default class SwitchSelector extends Component { borderRadius, margin: buttonMargin, }, + buttonStyle, styles.animated, ]} /> @@ -280,6 +282,7 @@ SwitchSelector.defaultProps = { bold: false, buttonMargin: 0, buttonColor: '#BCD635', + buttonStyle: {}, returnObject: false, animationDuration: 100, disabled: false, @@ -310,6 +313,7 @@ SwitchSelector.propTypes = { bold: PropTypes.bool, buttonMargin: PropTypes.number, buttonColor: PropTypes.string, + buttonStyle: PropTypes.object, returnObject: PropTypes.bool, animationDuration: PropTypes.number, disabled: PropTypes.bool, diff --git a/package.json b/package.json index 96ad823..468f33e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-switch-selector", - "version": "2.0.4", + "version": "2.0.5", "description": "Switch Selector to React Native.", "main": "index.js", "scripts": { @@ -16,7 +16,8 @@ ], "contributors": [ "Lucas Santana Carneiro (https://github.com/jkdrangel)", - "Cassio Silva de Sá Santos (https://github.com/ssscassio)" + "Cassio Silva de Sá Santos (https://github.com/ssscassio)", + "Raffaele Decarli (https://github.com/LazyRecon)" ], "license": "MIT", "bugs": {