UNPKG

@dynamic-labs/sdk-react-core

Version:

A React SDK for implementing wallet web3 authentication and authorization to your website.

131 lines (126 loc) 8.1 kB
'use client' 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _tslib = require('../../../../_virtual/_tslib.cjs'); var jsxRuntime = require('react/jsx-runtime'); var reactI18next = require('react-i18next'); var walletBook = require('@dynamic-labs/wallet-book'); require('react'); require('../../context/DynamicContext/DynamicContext.cjs'); require('../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs'); require('@dynamic-labs/sdk-api-core'); require('../../shared/logger.cjs'); require('@dynamic-labs/iconic'); require('@dynamic-labs/wallet-connector-core'); var ViewContext = require('../../context/ViewContext/ViewContext.cjs'); require('@dynamic-labs/utils'); require('../../utils/constants/colors.cjs'); require('../../utils/constants/values.cjs'); require('../../shared/consts/index.cjs'); require('../../events/dynamicEvents.cjs'); require('../../context/CaptchaContext/CaptchaContext.cjs'); require('../../context/ErrorContext/ErrorContext.cjs'); require('@dynamic-labs/multi-wallet'); require('react-international-phone'); require('../../store/state/nonce/nonce.cjs'); var pixelToRem = require('../../utils/functions/pixelToRem/pixelToRem.cjs'); require('../../store/state/projectSettings/projectSettings.cjs'); require('../../config/ApiEndpoint.cjs'); require('../../store/state/user/user.cjs'); require('../../locale/locale.cjs'); require('../../store/state/dynamicContextProps/dynamicContextProps.cjs'); require('../../store/state/primaryWalletId/primaryWalletId.cjs'); require('../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs'); require('../../context/AccessDeniedContext/AccessDeniedContext.cjs'); require('../../context/AccountExistsContext/AccountExistsContext.cjs'); require('../../context/UserWalletsContext/UserWalletsContext.cjs'); require('../../store/state/authMode/authMode.cjs'); require('../../context/VerificationContext/VerificationContext.cjs'); require('react-dom'); require('../../utils/functions/compareChains/compareChains.cjs'); require('../Passkey/utils/findPrimaryEmbeddedChain/findPrimaryEmbeddedChain.cjs'); require('../../context/ThemeContext/ThemeContext.cjs'); require('../../utils/hooks/useUserUpdateRequest/useUpdateUser/userFieldsSchema.cjs'); require('bs58'); require('@dynamic-labs/types'); require('../../context/SocialRedirectContext/SocialRedirectContext.cjs'); require('../../context/LoadingContext/LoadingContext.cjs'); require('../../context/WalletContext/WalletContext.cjs'); require('../../utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.cjs'); require('yup'); require('../../context/MockContext/MockContext.cjs'); require('../CollectUserDataView/useFields.cjs'); require('../../context/FieldsStateContext/FieldsStateContext.cjs'); require('../../context/UserFieldEditorContext/UserFieldEditorContext.cjs'); require('@dynamic-labs/rpc-providers'); require('../../store/state/walletOptions/walletOptions.cjs'); var classNames = require('../../utils/functions/classNames/classNames.cjs'); require('../../components/Accordion/components/AccordionItem/AccordionItem.cjs'); require('../../components/Alert/Alert.cjs'); var Typography = require('../../components/Typography/Typography.cjs'); require('../../components/ShadowDOM/ShadowDOM.cjs'); var TypographyButton = require('../../components/TypographyButton/TypographyButton.cjs'); var IconWithSpinner = require('../../components/IconWithSpinner/IconWithSpinner.cjs'); require('../../components/IconButton/IconButton.cjs'); require('../../components/InlineWidget/InlineWidget.cjs'); require('../../components/Input/Input.cjs'); require('../../components/IsBrowser/IsBrowser.cjs'); require('../../components/MenuList/Dropdown/Dropdown.cjs'); require('../../components/OverlayCard/OverlayCard.cjs'); require('../../components/Transition/ZoomTransition/ZoomTransition.cjs'); require('../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs'); require('../../components/Transition/OpacityTransition/OpacityTransition.cjs'); require('../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs'); require('../../components/Popper/Popper/Popper.cjs'); require('../../components/Popper/PopperContext/PopperContext.cjs'); require('react-focus-lock'); require('qrcode'); require('formik'); require('../../utils/hooks/useSubdomainCheck/useSubdomainCheck.cjs'); require('../../context/WalletGroupContext/WalletGroupContext.cjs'); require('../../context/IpConfigurationContext/IpConfigurationContext.cjs'); require('../../context/ConnectWithOtpContext/ConnectWithOtpContext.cjs'); require('../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs'); require('@hcaptcha/react-hcaptcha'); require('../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs'); require('../../context/FooterAnimationContext/index.cjs'); require('../../context/ErrorContext/hooks/useErrorText/useErrorText.cjs'); require('../../context/PasskeyContext/PasskeyContext.cjs'); require('../../widgets/DynamicWidget/helpers/convertExchangeKeyAndProviderEnum.cjs'); require('../../store/state/sendBalances.cjs'); require('../../store/state/connectorsInitializing/connectorsInitializing.cjs'); require('../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.cjs'); require('../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs'); require('../TransactionConfirmationView/TransactionConfirmationView.cjs'); require('../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs'); require('../../context/OnrampContext/OnrampContext.cjs'); require('../../widgets/DynamicWidget/views/ReceiveWalletFunds/ReceiveWalletFunds.cjs'); require('../../../index.cjs'); require('../../store/state/tokenBalances.cjs'); require('../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs'); var useInternalDynamicContext = require('../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.cjs'); const WalletSignSpinnerView = () => { const { clearStackAndPushInitialView } = ViewContext.useViewContext(); const { t } = reactI18next.useTranslation(); const { setMultiWalletWidgetState, setSelectedWalletConnectorKey, selectedWalletConnector: walletConnector, } = useInternalDynamicContext.useInternalDynamicContext(); if (!walletConnector) { return null; } const { key, metadata } = walletConnector; const iconSize = 96; const handleClose = () => _tslib.__awaiter(void 0, void 0, void 0, function* () { clearStackAndPushInitialView(); setMultiWalletWidgetState('idle'); setSelectedWalletConnectorKey(null); yield (walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.endSession()); }); const icon = (jsxRuntime.jsx(walletBook.WalletIcon, { icon: metadata.icon, walletKey: key, style: { height: pixelToRem.pixelToRem(iconSize * IconWithSpinner.iconRatio), width: pixelToRem.pixelToRem(iconSize * IconWithSpinner.iconRatio), } })); return (jsxRuntime.jsxs("div", { className: 'wallet-sign-spinner__container', "data-testid": 'wallet-sign-spinner-view', children: [jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: icon, iconSize: iconSize, isSpinning: true }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', className: classNames.classNames('wallet-sign-spinner__copy'), copykey: 'dyn_wallet_transfer.sign.spinner.confirm_transfer', children: t('dyn_wallet_transfer.sign.spinner.confirm_transfer') }), jsxRuntime.jsx(TypographyButton.TypographyButton, { expanded: true, buttonPadding: 'large', buttonVariant: 'primary', buttonClassName: 'wallet-sign-spinner__button', onClick: () => handleClose(), typographyProps: { variant: 'button_primary', weight: 'medium', }, copykey: 'dyn_wallet_transfer.sign.spinner.cancel', children: t('dyn_wallet_transfer.sign.spinner.cancel') })] })); }; exports.WalletSignSpinnerView = WalletSignSpinnerView;