@0xfutbol/id
Version:
React component library with shared providers for 0xFutbol ID
38 lines (37 loc) • 1.81 kB
JavaScript
import {jsx}from'react/jsx-runtime';import {useState,useCallback,useRef,useEffect}from'react';import {bj as ConnectingScreen}from'./index-BJCJzM2_.js';import'@0xfutbol/id-sign';import'react-use';import'@0xfutbol/constants';import'thirdweb';import'@matchain/matchid-sdk-react';import'@tanstack/react-query';import'@matchain/matchid-sdk-react/index.css';import'react-dom';/**
* @internal
*/
function ExternalWalletConnectUI(props) {
const { onBack, done, wallet, walletInfo, onGetStarted, locale } = props;
const [errorConnecting, setErrorConnecting] = useState(false);
const connect = 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 = useRef(false);
useEffect(() => {
if (scanStarted.current) {
return;
}
scanStarted.current = true;
connect();
}, [connect]);
return (jsx(ConnectingScreen, { 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 }));
}export{ExternalWalletConnectUI as default};//# sourceMappingURL=CoinbaseSDKConnection-CxsvBplJ.js.map