UNPKG

@olo/pay-react-native

Version:
40 lines (39 loc) 1.38 kB
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } // Copyright © 2022 Olo Inc. All rights reserved. // This software is made available under the Olo Pay SDK License (See LICENSE.md file) import { Platform, requireNativeComponent, StyleSheet } from 'react-native'; import React, { useCallback } from 'react'; const NativeButton = requireNativeComponent('DigitalWalletButton'); export const DigitalWalletButton = ({ onPress, disabled, applePayConfig, googlePayConfig, styles, ...props }) => { const onPressEventHandler = useCallback(_ => { onPress === null || onPress === void 0 || onPress(); }, [onPress]); return /*#__PURE__*/React.createElement(NativeButton, _extends({ style: [defaultStyles.nativeCard, styles], onClickedEvent: onPressEventHandler, googlePayConfig: googlePayConfig, applePayConfig: applePayConfig, isEnabled: !disabled }, props)); }; const defaultStyles = StyleSheet.create({ nativeCard: { minWidth: 80, ...Platform.select({ android: { minHeight: 40 }, default: { minHeight: 30 } }) } }); //# sourceMappingURL=DigitalWalletButton.js.map