UNPKG

@daimo/pay

Version:

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

36 lines (33 loc) 1.58 kB
import { jsx, Fragment, jsxs } from 'react/jsx-runtime'; import { PageContent, ModalContent, ModalBody } from '../../Common/Modal/styles.js'; import CustomQRCode from '../../Common/CustomQRCode/index.js'; import useLocales from '../../../hooks/useLocales.js'; import { usePayContext } from '../../../hooks/usePayContext.js'; import { useWallet } from '../../../wallets/useWallets.js'; const DownloadApp = () => { const { pendingConnectorId } = usePayContext(); const wallet = useWallet(pendingConnectorId ?? ""); const locales = useLocales({ CONNECTORNAME: wallet?.name }); if (!wallet) return /* @__PURE__ */ jsx(Fragment, { children: "Wallet not found" }); const downloads = { ios: wallet.downloadUrls?.ios, android: wallet.downloadUrls?.android, redirect: wallet.downloadUrls?.download }; const bodycopy = downloads.ios && downloads.android ? locales.downloadAppScreen_iosAndroid : downloads.ios ? locales.downloadAppScreen_ios : locales.downloadAppScreen_android; return /* @__PURE__ */ jsx(PageContent, { children: /* @__PURE__ */ jsxs(ModalContent, { style: { paddingBottom: 4, gap: 14 }, children: [ downloads.redirect && /* @__PURE__ */ jsx(CustomQRCode, { value: downloads.redirect }), !downloads.redirect && /* @__PURE__ */ jsx(Fragment, { children: "No download link available" }), /* @__PURE__ */ jsx( ModalBody, { style: { fontSize: 15, lineHeight: "20px", padding: "0 12px" }, children: bodycopy } ) ] }) }); }; export { DownloadApp as default }; //# sourceMappingURL=index.js.map