UNPKG

react-native-popup-dialog

Version:
1 lines 2 kB
Object.defineProperty(exports,"__esModule",{value:true});var _jsxFileName='src/components/DialogButton.js';var _react=require('react');var _react2=_interopRequireDefault(_react);var _reactNative=require('react-native');var _Constants=require('../constants/Constants');function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}var babelPluginFlowReactPropTypes_proptype_DialogButtonProps=require('../type').babelPluginFlowReactPropTypes_proptype_DialogButtonProps||require('prop-types').any;var isAndroid=_reactNative.Platform.OS==='android';var styles=_reactNative.StyleSheet.create({button:{flex:1,width:'100%',justifyContent:'center',alignItems:'center',paddingTop:16,paddingBottom:16},border:{borderLeftColor:'#CCD0D5',borderLeftWidth:1/_reactNative.PixelRatio.get()},text:{fontWeight:isAndroid?'400':'500',fontFamily:isAndroid?'sans-serif-medium':'System',fontSize:isAndroid?19:16,color:'#044DE0'},disable:{color:'#C5C6C5'}});function DialogButton(_ref){var text=_ref.text,activeOpacity=_ref.activeOpacity,align=_ref.align,onPress=_ref.onPress,style=_ref.style,textStyle=_ref.textStyle,disabled=_ref.disabled,bordered=_ref.bordered;var buttonAlign={alignSelf:_Constants.Positions[align]};var disable=disabled?styles.disable:null;var border=bordered?styles.border:null;return _react2.default.createElement(_reactNative.TouchableHighlight,{underlayColor:'#F1F2F2',onPress:onPress,disabled:disabled,activeOpacity:activeOpacity,style:[styles.button,buttonAlign,border,style],__source:{fileName:_jsxFileName,lineNumber:49}},_react2.default.createElement(_reactNative.Text,{style:[styles.text,disable,textStyle],__source:{fileName:_jsxFileName,lineNumber:56}},text));}DialogButton.propTypes=babelPluginFlowReactPropTypes_proptype_DialogButtonProps===require('prop-types').any?{}:babelPluginFlowReactPropTypes_proptype_DialogButtonProps;DialogButton.defaultProps={activeOpacity:0.6,disabled:false,bordered:false,align:'center',style:null,textStyle:null};exports.default=DialogButton;