UNPKG

@coin-voyage/paykit

Version:

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

25 lines (24 loc) 1.14 kB
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useAccount, useAccountDisconnect } from "@coin-voyage/crypto/hooks"; import { useMethodOptions } from "../../../hooks/useMethodOptions"; import usePayContext from "../../contexts/pay"; import { PageContent } from "../../ui/Modal/styles"; import OptionsList from "../../ui/OptionsList"; import { OrderHeader } from "../../ui/OrderHeader"; import PoweredByFooter from "../../ui/PoweredByFooter"; export default function SelectMethod() { const { paymentState } = usePayContext(); const disconnect = useAccountDisconnect(); const { account } = useAccount({ selectedWallet: paymentState.selectedWallet, chainType: paymentState.connectorChainType, }); const handleClick = () => { disconnect(account); }; const { options, isLoading } = useMethodOptions({ mode: paymentState.payOrder?.mode, onClick: handleClick, }); return (_jsxs(PageContent, { children: [_jsx(OrderHeader, {}), _jsx(OptionsList, { requiredSkeletons: 3, options: options, isLoading: isLoading }), _jsx(PoweredByFooter, {})] })); }