UNPKG

react-native-tab-view

Version:
2 lines 2.01 kB
import _extends from"@babel/runtime/helpers/extends";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";import _inherits from"@babel/runtime/helpers/inherits";var _jsxFileName="/Users/satya/Workspace/Projects/react-native-tab-view/src/TouchableItem.tsx";import*as React from'react';import{TouchableNativeFeedback,TouchableOpacity,Platform,View}from'react-native';var LOLLIPOP=21;var TouchableItem=function(_React$Component){_inherits(TouchableItem,_React$Component);function TouchableItem(){_classCallCheck(this,TouchableItem);return _possibleConstructorReturn(this,_getPrototypeOf(TouchableItem).apply(this,arguments));}_createClass(TouchableItem,[{key:"render",value:function render(){var _this$props=this.props,style=_this$props.style,pressOpacity=_this$props.pressOpacity,pressColor=_this$props.pressColor,borderless=_this$props.borderless,children=_this$props.children,rest=_objectWithoutProperties(_this$props,["style","pressOpacity","pressColor","borderless","children"]);if(Platform.OS==='android'&&Platform.Version>=LOLLIPOP){return React.createElement(TouchableNativeFeedback,_extends({},rest,{background:TouchableNativeFeedback.Ripple(pressColor,borderless),__source:{fileName:_jsxFileName,lineNumber:42}}),React.createElement(View,{style:style,__source:{fileName:_jsxFileName,lineNumber:46}},React.Children.only(children)));}else{return React.createElement(TouchableOpacity,_extends({},rest,{style:style,activeOpacity:pressOpacity,__source:{fileName:_jsxFileName,lineNumber:51}}),children);}}}]);return TouchableItem;}(React.Component);TouchableItem.defaultProps={pressColor:'rgba(255, 255, 255, .4)'};export{TouchableItem as default}; //# sourceMappingURL=TouchableItem.js.map