UNPKG

@daimo/pay

Version:

Seamless crypto payments. Onboard users from any chain, any coin into your app with one click.

29 lines (26 loc) 1.67 kB
import { jsx, jsxs } from 'react/jsx-runtime'; import { usePayContext } from '../../../hooks/usePayContext.js'; import { PageContent, ModalContent, ModalH1, ModalBody } from '../../Common/Modal/styles.js'; import { ExternalLinkIcon } from '../../../assets/icons.js'; import Button from '../../Common/Button/index.js'; import WalletPaymentSpinner from '../../Spinners/WalletPaymentSpinner/index.js'; const WaitingWallet = () => { const context = usePayContext(); const { paymentState } = context; const { selectedWallet, paymentWaitingMessage, selectedWalletDeepLink } = paymentState; const openWalletWindow = (url) => { window.open(url, "_blank"); }; if (!selectedWallet) { return jsx(PageContent, { children: " No wallet selected " }); } return (jsxs(PageContent, { children: [jsx(WalletPaymentSpinner, { logo: selectedWallet.icon, logoShape: selectedWallet.iconShape === "square" ? "squircle" : selectedWallet.iconShape || "squircle" }), jsxs(ModalContent, { style: { marginLeft: 24, marginRight: 24 }, children: [jsxs(ModalH1, { children: ["Continue in ", selectedWallet.shortName ?? selectedWallet.name] }), paymentWaitingMessage && (jsx(ModalBody, { style: { marginTop: 12, marginBottom: 12 }, children: paymentWaitingMessage }))] }), jsx(Button, { icon: jsx(ExternalLinkIcon, {}), onClick: () => { if (selectedWalletDeepLink) { openWalletWindow(selectedWalletDeepLink); } }, children: `Open ${selectedWallet.name}` })] })); }; export { WaitingWallet as default }; //# sourceMappingURL=index.js.map