UNPKG

@0xfutbol/id

Version:

React component library with shared providers for 0xFutbol ID

38 lines (37 loc) 1.83 kB
'use strict';var jsxRuntime=require('react/jsx-runtime'),React=require('react'),index=require('./index-gEYw6hWC.js');require('@0xfutbol/id-sign'),require('react-use'),require('@0xfutbol/constants'),require('thirdweb'),require('@matchain/matchid-sdk-react'),require('@tanstack/react-query'),require('@matchain/matchid-sdk-react/index.css'),require('react-dom');/** * @internal */ function ExternalWalletConnectUI(props) { const { onBack, done, wallet, walletInfo, onGetStarted, locale } = props; const [errorConnecting, setErrorConnecting] = React.useState(false); const connect = React.useCallback(() => { setErrorConnecting(false); wallet .connect({ client: props.client, chain: props.chain, }) .then(() => { done(); }) .catch((e) => { console.error(e); setErrorConnecting(true); }); }, [props.client, wallet, props.chain, done]); const scanStarted = React.useRef(false); React.useEffect(() => { if (scanStarted.current) { return; } scanStarted.current = true; connect(); }, [connect]); return (jsxRuntime.jsx(index.cK, { locale: { getStartedLink: locale.getStartedLink, instruction: locale.connectionScreen.instruction, tryAgain: locale.connectionScreen.retry, inProgress: locale.connectionScreen.inProgress, failed: locale.connectionScreen.failed, }, onBack: onBack, walletName: walletInfo.name, walletId: wallet.id, errorConnecting: errorConnecting, onRetry: connect, onGetStarted: onGetStarted, client: props.client, size: props.size })); }exports.default=ExternalWalletConnectUI;//# sourceMappingURL=CoinbaseSDKConnection-zZ8jFjMI.js.map