Skip to content

Commit d47a361

Browse files
committed
Add gradientLocation, Update tests and Update version
1 parent 54e9692 commit d47a361

7 files changed

Lines changed: 24 additions & 20 deletions

File tree

__tests__/__snapshots__/ButtonComponent.test.js.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ exports[`renders correctly 1`] = `
3737
4284928890,
3838
]
3939
}
40-
end={
40+
endPoint={
4141
Object {
4242
"x": 1,
4343
"y": 1,
4444
}
4545
}
4646
locations={null}
47-
start={
47+
startPoint={
4848
Object {
4949
"x": 0.5,
5050
"y": 1,

__tests__/__snapshots__/CircleButton.test.js.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ exports[`Circle Button renders CircleButton correctly with multi states 1`] = `
3737
4284928890,
3838
]
3939
}
40-
end={
40+
endPoint={
4141
Object {
4242
"x": 1,
4343
"y": 1,
4444
}
4545
}
4646
locations={null}
47-
start={
47+
startPoint={
4848
Object {
4949
"x": 0.5,
5050
"y": 1,
@@ -195,14 +195,14 @@ exports[`Circle Button renders CircleButton correctly with one state 1`] = `
195195
4284928890,
196196
]
197197
}
198-
end={
198+
endPoint={
199199
Object {
200200
"x": 1,
201201
"y": 1,
202202
}
203203
}
204204
locations={null}
205-
start={
205+
startPoint={
206206
Object {
207207
"x": 0.5,
208208
"y": 1,

__tests__/__snapshots__/RectangleButton.test.js.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ exports[`Circle Button renders RectangleButton correctly with multi states 1`] =
3737
4284928890,
3838
]
3939
}
40-
end={
40+
endPoint={
4141
Object {
4242
"x": 1,
4343
"y": 1,
4444
}
4545
}
4646
locations={null}
47-
start={
47+
startPoint={
4848
Object {
4949
"x": 0.5,
5050
"y": 1,
@@ -193,14 +193,14 @@ exports[`Circle Button renders RectangleButton correctly with one state 1`] = `
193193
4284928890,
194194
]
195195
}
196-
end={
196+
endPoint={
197197
Object {
198198
"x": 1,
199199
"y": 1,
200200
}
201201
}
202202
locations={null}
203-
start={
203+
startPoint={
204204
Object {
205205
"x": 0.5,
206206
"y": 1,

__tests__/__snapshots__/RoundButton.test.js.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ exports[`Circle Button renders RoundButton correctly with multi states 1`] = `
3737
4284928890,
3838
]
3939
}
40-
end={
40+
endPoint={
4141
Object {
4242
"x": 1,
4343
"y": 1,
4444
}
4545
}
4646
locations={null}
47-
start={
47+
startPoint={
4848
Object {
4949
"x": 0.5,
5050
"y": 1,
@@ -195,14 +195,14 @@ exports[`Circle Button renders RoundButton correctly with one state 1`] = `
195195
4284928890,
196196
]
197197
}
198-
end={
198+
endPoint={
199199
Object {
200200
"x": 1,
201201
"y": 1,
202202
}
203203
}
204204
locations={null}
205-
start={
205+
startPoint={
206206
Object {
207207
"x": 0.5,
208208
"y": 1,

dist/ButtonComponent.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ type:_propTypes2.default.string,
1212
shape:_propTypes2.default.string,
1313
gradientStart:_propTypes2.default.object,
1414
gradientEnd:_propTypes2.default.object,
15+
gradientLocation:_propTypes2.default.array,
1516
disabledGradientStart:_propTypes2.default.object,
1617
disabledGradientEnd:_propTypes2.default.object,
1718
disabledOpacity:_propTypes2.default.number,
@@ -30,6 +31,7 @@ shape:'round',
3031
backgroundColors:['#4DC7A4','#66D37A'],
3132
gradientStart:{x:0.5,y:1},
3233
gradientEnd:{x:1,y:1},
34+
gradientLocation:null,
3335
disabledGradientStart:{x:0,y:0},
3436
disabledGradientEnd:{x:0,y:0},
3537
disabledOpacity:0.5,
@@ -110,7 +112,7 @@ progressWidth:this.props.progressWidth,
110112
progressTintColor:this.props.progressTintColor,
111113
progressBackgroundColor:this.props.progressBackgroundColor,
112114
progressStyle:this.props.progressStyle,
113-
textInsideProgress:this.props.textInsideProgress,__source:{fileName:_jsxFileName,lineNumber:94}});
115+
textInsideProgress:this.props.textInsideProgress,__source:{fileName:_jsxFileName,lineNumber:96}});
114116

115117

116118
}else{
@@ -119,7 +121,7 @@ _react2.default.createElement(_Button2.default,{
119121
textStyle:this.props.textStyle||textStyle,
120122
imageStyle:this.props.imageStyle||imageStyle,
121123
text:this.props.text,
122-
image:this.props.image,__source:{fileName:_jsxFileName,lineNumber:118}});
124+
image:this.props.image,__source:{fileName:_jsxFileName,lineNumber:120}});
123125

124126

125127
}
@@ -161,15 +163,15 @@ start:disabled?disabledGradientStart:gradientStart,
161163
end:disabled?disabledGradientEnd:gradientEnd,
162164
colors:backgroundColors,
163165
collapsable:false,
164-
style:[styles.button,shapeStyle,buttonStyle,disabledStyle],__source:{fileName:_jsxFileName,lineNumber:159}},
166+
style:[styles.button,shapeStyle,buttonStyle,disabledStyle],__source:{fileName:_jsxFileName,lineNumber:161}},
165167

166168
this.renderButton({textStyle:styles.text}));
167169

168170

169171
}else{
170172
var border=type==='border'&&styles.border;
171173
content=
172-
_react2.default.createElement(_reactNative.View,{style:[styles.button,border,shapeStyle,buttonStyle,disabledStyle],__source:{fileName:_jsxFileName,lineNumber:172}},
174+
_react2.default.createElement(_reactNative.View,{style:[styles.button,border,shapeStyle,buttonStyle,disabledStyle],__source:{fileName:_jsxFileName,lineNumber:174}},
173175
this.renderButton({textStyle:styles.secondaryText}));
174176

175177

@@ -187,7 +189,7 @@ styles.container,
187189
width:buttonWidth,
188190
height:buttonHeight},
189191

190-
style],__source:{fileName:_jsxFileName,lineNumber:179}},
192+
style],__source:{fileName:_jsxFileName,lineNumber:181}},
191193

192194

193195
content));

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-button-component",
3-
"version": "0.2.26",
3+
"version": "0.2.27",
44
"description": "A Beautiful, Customizable React Native Button component for iOS & Android",
55
"main": "dist/index.js",
66
"scripts": {

src/ButtonComponent.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const propTypes = {
1212
shape: PropTypes.string,
1313
gradientStart: PropTypes.object,
1414
gradientEnd: PropTypes.object,
15+
gradientLocation: PropTypes.array,
1516
disabledGradientStart: PropTypes.object,
1617
disabledGradientEnd: PropTypes.object,
1718
disabledOpacity: PropTypes.number,
@@ -30,6 +31,7 @@ const defaultProps = {
3031
backgroundColors: ['#4DC7A4', '#66D37A'],
3132
gradientStart: { x: 0.5, y: 1 },
3233
gradientEnd: { x: 1, y: 1 },
34+
gradientLocation: null,
3335
disabledGradientStart: { x: 0, y: 0 },
3436
disabledGradientEnd: { x: 0, y: 0 },
3537
disabledOpacity: 0.5,

0 commit comments

Comments
 (0)