UNPKG

@coin-voyage/paykit

Version:

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

19 lines (18 loc) 1.19 kB
import { jsx as _jsx } from "react/jsx-runtime"; import { AnimatePresence, motion } from "framer-motion"; import { isWalletConnectConnector } from "../../utils"; import usePayContext from "../contexts/pay"; import Alert from "../ui/Alert"; import { contentVariants } from "../ui/Modal"; 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 (_jsx(AnimatePresence, { children: isQrCode ? (_jsx(motion.div, { initial: "initial", animate: "animate", exit: "exit", variants: contentVariants, children: _jsx(ConnectWithQRCode, {}) }, "QRCODE")) : (_jsx(motion.div, { initial: "initial", animate: "animate", exit: "exit", variants: contentVariants, children: _jsx(ConnectWithInjector, {}) })) })); }