@daimo/pay
Version:
Seamless crypto payments. Onboard users from any chain, any coin into your app with one click.
50 lines (47 loc) • 1.84 kB
JavaScript
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 /* @__PURE__ */ jsx(PageContent, { children: " No wallet selected " });
}
return /* @__PURE__ */ jsxs(PageContent, { children: [
/* @__PURE__ */ jsx(
WalletPaymentSpinner,
{
logo: selectedWallet.icon,
logoShape: selectedWallet.iconShape === "square" ? "squircle" : selectedWallet.iconShape || "squircle"
}
),
/* @__PURE__ */ jsxs(ModalContent, { style: { marginLeft: 24, marginRight: 24 }, children: [
/* @__PURE__ */ jsxs(ModalH1, { children: [
"Continue in ",
selectedWallet.shortName ?? selectedWallet.name
] }),
paymentWaitingMessage && /* @__PURE__ */ jsx(ModalBody, { style: { marginTop: 12, marginBottom: 12 }, children: paymentWaitingMessage })
] }),
/* @__PURE__ */ jsx(
Button,
{
icon: /* @__PURE__ */ jsx(ExternalLinkIcon, {}),
onClick: () => {
if (selectedWalletDeepLink) {
openWalletWindow(selectedWalletDeepLink);
}
},
children: `Open ${selectedWallet.name}`
}
)
] });
};
export { WaitingWallet as default };
//# sourceMappingURL=index.js.map