Skip to content
This repository was archived by the owner on Sep 16, 2020. It is now read-only.

Commit 61f9930

Browse files
RodrigoAngeloValentinisilentcloud
authored andcommitted
fix textStyle warning (#290)
1 parent 641ef4a commit 61f9930

File tree

5 files changed

+2888
-65
lines changed

5 files changed

+2888
-65
lines changed

dist/NativeButton.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ var NativeButton = (0, _createReactClass2.default)({
4242

4343

4444
propTypes: _extends({}, _reactNative.TouchableWithoutFeedback.propTypes, {
45-
textStyle: _propTypes.any,
46-
disabledStyle: _propTypes.object,
45+
textStyle: _propTypes2.default.object,
46+
disabledStyle: _propTypes2.default.object,
4747
children: _propTypes2.default.node.isRequired,
4848
underlayColor: _propTypes2.default.string,
49-
background: _propTypes.any
49+
background: _propTypes2.default.any
5050
}),
5151

5252
statics: {
@@ -123,4 +123,4 @@ var NativeButton = (0, _createReactClass2.default)({
123123
}
124124
});
125125

126-
exports.default = NativeButton;
126+
exports.default = NativeButton;

dist/index.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ var SwipeoutBtn = (0, _createReactClass2.default)({
4343
color: _propTypes2.default.string,
4444
component: _propTypes2.default.node,
4545
onPress: _propTypes2.default.func,
46-
text: _propTypes2.default.string,
46+
text: _propTypes2.default.node,
4747
type: _propTypes2.default.string,
4848
underlayColor: _propTypes2.default.string
4949
},
@@ -87,10 +87,10 @@ var SwipeoutBtn = (0, _createReactClass2.default)({
8787
width: btn.width
8888
}]);
8989

90-
var styleSwipeoutBtnText = [_styles2.default.swipeoutBtnText];
90+
var styleSwipeoutBtnText = _extends({}, _styles2.default.swipeoutBtnText);
9191

9292
// apply text color
93-
if (btn.color) styleSwipeoutBtnText.push([{ color: btn.color }]);
93+
if (btn.color) styleSwipeoutBtnText = _extends({}, styleSwipeoutBtnText, { color: btn.color });
9494

9595
return _react2.default.createElement(
9696
_NativeButton2.default,
@@ -338,9 +338,11 @@ var Swipeout = (0, _createReactClass2.default)({
338338
var _this3 = this;
339339

340340
this.refs.swipeoutContent.measure(function (ox, oy, width, height) {
341+
var btnWidth = _this3.props.buttonWidth || width / 5;
342+
341343
_this3.setState({
342-
btnWidth: width / 5,
343-
btnsRightWidth: _this3.props.right ? width / 5 * _this3.props.right.length : 0
344+
btnWidth: btnWidth,
345+
btnsRightWidth: _this3.props.right ? btnWidth * _this3.props.right.length : 0
344346
}, function () {
345347
_this3._tweenContent('contentPos', -_this3.state.btnsRightWidth);
346348
_this3._callOnOpen();
@@ -358,9 +360,11 @@ var Swipeout = (0, _createReactClass2.default)({
358360
var _this4 = this;
359361

360362
this.refs.swipeoutContent.measure(function (ox, oy, width, height) {
363+
var btnWidth = _this4.props.buttonWidth || width / 5;
364+
361365
_this4.setState({
362-
btnWidth: width / 5,
363-
btnsLeftWidth: _this4.props.left ? width / 5 * _this4.props.left.length : 0
366+
btnWidth: btnWidth,
367+
btnsLeftWidth: _this4.props.left ? btnWidth * _this4.props.left.length : 0
364368
}, function () {
365369
_this4._tweenContent('contentPos', _this4.state.btnsLeftWidth);
366370
_this4._callOnOpen();
@@ -401,7 +405,7 @@ var Swipeout = (0, _createReactClass2.default)({
401405
};
402406
var styleContentPos = {
403407
content: {
404-
transform: [{ translateX: this._rubberBandEasing(posX, limit) }],
408+
transform: [{ translateX: this._rubberBandEasing(posX, limit) }]
405409
}
406410
};
407411

0 commit comments

Comments
 (0)