UNPKG

@oxyhq/services

Version:

OxyHQ Expo/React Native SDK — UI components, screens, and native features

108 lines (107 loc) 4.12 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _react = _interopRequireWildcard(require("react")); var _reactNative = require("react-native"); var _index = require("../index.js"); var _GroupedPillButtons = _interopRequireDefault(require("../internal/GroupedPillButtons.js")); var _paymentStyles = require("./paymentStyles.js"); var _constants = require("./constants.js"); var _jsxRuntime = require("react/jsx-runtime"); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); } const PaymentReviewStep = ({ amount, currency, paymentMethod, cardDetails, colors, animations, isPaying, onBack, onPay }) => { const styles = (0, _react.useMemo)(() => (0, _paymentStyles.createPaymentStyles)(colors), [colors]); const currencySymbol = (0, _constants.getCurrencySymbol)(currency); const { fadeAnim, slideAnim, scaleAnim } = animations; const selectedMethod = _constants.PAYMENT_METHODS.find(m => m.key === paymentMethod); return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Animated.View, { style: [styles.stepContainer, { opacity: fadeAnim, transform: [{ translateY: slideAnim }, { scale: scaleAnim }] }], accessibilityRole: "none", accessibilityLabel: "Review payment step", children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { style: styles.section, children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { style: styles.sectionTitle, children: "Review Payment" }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.GroupedSection, { items: [{ id: 'secure-payment', icon: 'shield-check', iconColor: colors.success || '#4BB543', title: 'Secure payment', subtitle: 'Your payment is protected by industry-standard encryption' }, { id: 'amount', icon: 'cash', iconColor: colors.primary, title: 'Amount', subtitle: `${currencySymbol} ${amount}` }, { id: 'payment-method', icon: selectedMethod?.icon, iconColor: colors.primary, title: 'Payment Method', subtitle: selectedMethod?.label }, ...(paymentMethod === 'card' ? [{ id: 'card-details', icon: 'card', iconColor: colors.primary, title: 'Card', subtitle: cardDetails.number.replace(/.(?=.{4})/g, '*') }] : []), ...(paymentMethod === 'oxy' ? [{ id: 'oxy-balance', icon: 'wallet', iconColor: colors.primary, title: 'Oxy Pay Account', subtitle: 'Balance: ⊜ 123.45' }] : []), ...(paymentMethod === 'faircoin' ? [{ id: 'faircoin-wallet', icon: 'qr-code', iconColor: colors.primary, title: 'FairCoin Wallet', subtitle: 'Paid via QR' }] : [])] })] }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GroupedPillButtons.default, { buttons: [{ text: 'Back', onPress: onBack, icon: 'arrow-back', variant: 'transparent' }, { text: isPaying ? 'Processing...' : 'Pay Now', onPress: onPay, icon: 'checkmark', variant: 'primary', loading: isPaying }], colors: colors })] }); }; var _default = exports.default = PaymentReviewStep; //# sourceMappingURL=PaymentReviewStep.js.map