UNPKG

@coin-voyage/paykit

Version:

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

17 lines (16 loc) 803 B
import { jsx as _jsx } from "react/jsx-runtime"; import { isWalletConnectConnector } from "../../utils"; import usePayContext from "../contexts/pay"; import Alert from "../ui/Alert"; import ConnectWithInjector from "./ConnectWithInjector"; import ConnectWithQRCode from "./ConnectWithQRCode"; export default function ConnectUsing() { const context = usePayContext(); const wallet = context.paymentState.selectedWallet; if (!wallet) { return _jsx(Alert, { children: "Wallet not found" }); } // If cannot be scanned, display injector flow, which if extension is not installed will show CTA to install it const isQrCode = isWalletConnectConnector(wallet?.id) && wallet?.getWalletDeeplink; return isQrCode ? _jsx(ConnectWithQRCode, {}) : _jsx(ConnectWithInjector, {}); }