@dynamic-labs/sdk-react-core 0.17.0-RC.16 → 0.17.0-RC.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +37 -0
- package/package.cjs +2 -2
- package/package.js +2 -2
- package/package.json +8 -8
- package/src/index.cjs +8 -0
- package/src/index.js +5 -0
- package/src/lib/Main.cjs +2 -0
- package/src/lib/Main.js +2 -0
- package/src/lib/components/Accordion/components/AccordionItem/AccordionItem.cjs +2 -0
- package/src/lib/components/Accordion/components/AccordionItem/AccordionItem.js +2 -0
- package/src/lib/components/AnimatePresence/AnimatePresence.cjs +2 -0
- package/src/lib/components/AnimatePresence/AnimatePresence.js +2 -0
- package/src/lib/components/AppOriginTile/AppOriginTile.types.d.ts +1 -1
- package/src/lib/components/Divider/Divider.cjs +6 -1
- package/src/lib/components/Divider/Divider.d.ts +6 -2
- package/src/lib/components/Divider/Divider.js +6 -1
- package/src/lib/components/IconWithSpinner/IconWithSpinner.cjs +1 -0
- package/src/lib/components/IconWithSpinner/IconWithSpinner.js +1 -0
- package/src/lib/components/IconWithSpinner/Spinner/Spinner.cjs +1 -0
- package/src/lib/components/IconWithSpinner/Spinner/Spinner.js +1 -0
- package/src/lib/components/IconWithStatus/IconWithStatus.cjs +1 -0
- package/src/lib/components/IconWithStatus/IconWithStatus.js +1 -0
- package/src/lib/components/Input/Input.cjs +10 -6
- package/src/lib/components/Input/Input.js +10 -6
- package/src/lib/components/NetworkPicker/components/ActionList/ActionList.cjs +2 -0
- package/src/lib/components/NetworkPicker/components/ActionList/ActionList.js +2 -0
- package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.cjs +2 -0
- package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.js +2 -0
- package/src/lib/components/NetworkPicker/components/Network/Network.cjs +2 -0
- package/src/lib/components/NetworkPicker/components/Network/Network.js +2 -0
- package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.cjs +2 -0
- package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.js +2 -0
- package/src/lib/components/OTPVerificationView/OTPVerificationView.cjs +2 -0
- package/src/lib/components/OTPVerificationView/OTPVerificationView.js +2 -0
- package/src/lib/components/OverlayCard/OverlayCard.cjs +2 -0
- package/src/lib/components/OverlayCard/OverlayCard.js +2 -0
- package/src/lib/components/Portal/Portal.cjs +2 -0
- package/src/lib/components/Portal/Portal.js +2 -0
- package/src/lib/components/SendBalanceForm/SendBalanceForm.cjs +24 -0
- package/src/lib/components/SendBalanceForm/SendBalanceForm.d.ts +10 -0
- package/src/lib/components/SendBalanceForm/SendBalanceForm.js +22 -0
- package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.d.ts +16 -0
- package/src/lib/components/SendBalancePageLayout/components/TokenBalanceCard/TokenBalanceCard.d.ts +8 -0
- package/src/lib/components/SendBalancePageLayout/components/TokenBalanceCard/index.d.ts +1 -0
- package/src/lib/components/SendBalancePageLayout/components/index.d.ts +1 -0
- package/src/lib/components/SendBalancePageLayout/index.d.ts +2 -0
- package/src/lib/components/Tooltip/Tooltip.cjs +2 -0
- package/src/lib/components/Tooltip/Tooltip.js +2 -0
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.cjs +40 -0
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.d.ts +17 -0
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.js +36 -0
- package/src/lib/components/TransactionConfirmationPageLayout/components/TransactionRow/TransactionRow.cjs +11 -0
- package/src/lib/components/TransactionConfirmationPageLayout/components/TransactionRow/TransactionRow.d.ts +12 -0
- package/src/lib/components/TransactionConfirmationPageLayout/components/TransactionRow/TransactionRow.js +7 -0
- package/src/lib/components/TransactionConfirmationPageLayout/components/TransactionRow/index.d.ts +1 -0
- package/src/lib/components/TransactionConfirmationPageLayout/components/index.d.ts +1 -0
- package/src/lib/components/TransactionConfirmationPageLayout/index.d.ts +2 -0
- package/src/lib/components/TransactionOriginDestination/TransactionOriginDestination.d.ts +11 -0
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.d.ts +11 -0
- package/src/lib/components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.cjs +2 -0
- package/src/lib/components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.js +2 -0
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.cjs +2 -0
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.js +2 -0
- package/src/lib/components/UserProfile/parts/UserProfileSection/UserProfileSection.cjs +2 -0
- package/src/lib/components/UserProfile/parts/UserProfileSection/UserProfileSection.js +2 -0
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.cjs +2 -0
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.js +2 -0
- package/src/lib/components/index.d.ts +2 -0
- package/src/lib/context/DynamicContext/DynamicContext.cjs +22 -9
- package/src/lib/context/DynamicContext/DynamicContext.d.ts +2 -0
- package/src/lib/context/DynamicContext/DynamicContext.js +22 -9
- package/src/lib/context/DynamicContext/hooks/useEmailLoginState/useEmailLoginState.cjs +1 -0
- package/src/lib/context/DynamicContext/hooks/useEmailLoginState/useEmailLoginState.js +1 -0
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerAuthFlowCallbacks.cjs +2 -0
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerAuthFlowCallbacks.js +2 -0
- package/src/lib/context/QrCodeContext/QrCodeContext.cjs +2 -0
- package/src/lib/context/QrCodeContext/QrCodeContext.js +2 -0
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +5 -2
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +5 -2
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.cjs +2 -0
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.js +2 -0
- package/src/lib/layout/DynamicAuthLayout/Footer/Footer.cjs +2 -0
- package/src/lib/layout/DynamicAuthLayout/Footer/Footer.js +2 -0
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/Item/Item.cjs +2 -0
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/Item/Item.js +2 -0
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.cjs +2 -0
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.js +2 -0
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletListFooterContent.cjs +1 -0
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletListFooterContent.js +1 -0
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletMoreInfoContent/WalletMoreInfoContent.cjs +2 -0
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletMoreInfoContent/WalletMoreInfoContent.js +2 -0
- package/src/lib/layout/DynamicAuthLayout/Header/header.cjs +2 -0
- package/src/lib/layout/DynamicAuthLayout/Header/header.js +2 -0
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.cjs +2 -0
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.js +2 -0
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.cjs +25 -80
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.js +27 -82
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.types.d.ts +0 -4
- package/src/lib/shared/types/index.d.ts +1 -1
- package/src/lib/shared/utils/functions/formatBigNumber/formatBigNumber.cjs +2 -1
- package/src/lib/shared/utils/functions/formatBigNumber/formatBigNumber.js +2 -1
- package/src/lib/shared/utils/functions/index.d.ts +1 -0
- package/src/lib/shared/utils/functions/trimEnd/index.d.ts +1 -0
- package/src/lib/shared/utils/functions/trimEnd/trimEnd.cjs +13 -0
- package/src/lib/shared/utils/functions/trimEnd/trimEnd.d.ts +1 -0
- package/src/lib/shared/utils/functions/trimEnd/trimEnd.js +9 -0
- package/src/lib/shared/utils/hooks/index.d.ts +2 -0
- package/src/lib/shared/utils/hooks/useIsMounted/index.d.ts +1 -0
- package/src/lib/shared/utils/hooks/useIsMounted/useIsMounted.cjs +18 -0
- package/src/lib/shared/utils/hooks/useIsMounted/useIsMounted.d.ts +1 -0
- package/src/lib/shared/utils/hooks/useIsMounted/useIsMounted.js +14 -0
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/functions/getAppOrigin/getAppOrigin.cjs +12 -0
- package/src/lib/utils/functions/getAppOrigin/getAppOrigin.d.ts +1 -0
- package/src/lib/utils/functions/getAppOrigin/getAppOrigin.js +8 -0
- package/src/lib/utils/functions/getAppOrigin/index.d.ts +1 -0
- package/src/lib/utils/functions/getReferencedAccount/getReferencedAccount.d.ts +7 -0
- package/src/lib/utils/functions/getReferencedAccount/index.d.ts +1 -0
- package/src/lib/utils/functions/index.d.ts +2 -0
- package/src/lib/utils/functions/isWalletLinked/index.d.ts +1 -0
- package/src/lib/utils/functions/isWalletLinked/isWalletLinked.cjs +15 -0
- package/src/lib/utils/functions/isWalletLinked/isWalletLinked.d.ts +2 -0
- package/src/lib/utils/functions/isWalletLinked/isWalletLinked.js +11 -0
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.cjs +1 -1
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.js +1 -1
- package/src/lib/utils/hooks/authenticationHooks/useEmailVerificationRequest/useEmailVerificationRequest.cjs +1 -0
- package/src/lib/utils/hooks/authenticationHooks/useEmailVerificationRequest/useEmailVerificationRequest.js +1 -0
- package/src/lib/utils/hooks/multiWallet/index.d.ts +1 -0
- package/src/lib/utils/hooks/multiWallet/useMultiWalletWidgetState/useMultiWalletWidgetState.cjs +0 -2
- package/src/lib/utils/hooks/multiWallet/useMultiWalletWidgetState/useMultiWalletWidgetState.js +0 -2
- package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.cjs +63 -7
- package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.d.ts +8 -1
- package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.js +64 -8
- package/src/lib/utils/hooks/useConnectedAccountWallet/index.d.ts +1 -0
- package/src/lib/utils/hooks/useConnectedAccountWallet/useConnectedAccountWallet.cjs +30 -0
- package/src/lib/utils/hooks/useConnectedAccountWallet/useConnectedAccountWallet.d.ts +2 -0
- package/src/lib/utils/hooks/useConnectedAccountWallet/useConnectedAccountWallet.js +26 -0
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +1 -1
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +1 -1
- package/src/lib/utils/hooks/useWalletConnectors/reconnectSocialWallet.d.ts +8 -0
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.cjs +18 -6
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.js +18 -6
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.cjs +8 -8
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.js +8 -8
- package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.cjs +3 -2
- package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.js +3 -2
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.cjs +19 -17
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.js +19 -17
- package/src/lib/utils/hooks/useWallets/useWallets.cjs +26 -36
- package/src/lib/utils/hooks/useWallets/useWallets.d.ts +1 -2
- package/src/lib/utils/hooks/useWallets/useWallets.js +27 -37
- package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.cjs +2 -0
- package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.js +2 -0
- package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +1 -0
- package/src/lib/views/CollectUserDataView/CollectUserDataView.js +1 -0
- package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.cjs +2 -0
- package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.js +2 -0
- package/src/lib/views/CollectUserDataView/UserDataFields/index.cjs +2 -0
- package/src/lib/views/CollectUserDataView/UserDataFields/index.js +2 -0
- package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.cjs +2 -0
- package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.js +2 -0
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.cjs +2 -0
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.js +2 -0
- package/src/lib/views/EmailUpdate/EmailUpdate.cjs +2 -0
- package/src/lib/views/EmailUpdate/EmailUpdate.js +2 -0
- package/src/lib/views/EmailVerification/EmailVerification.cjs +2 -0
- package/src/lib/views/EmailVerification/EmailVerification.js +2 -0
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.cjs +2 -0
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.js +2 -0
- package/src/lib/views/LoginWithEmailView/components/ListItemButton/ListItemButton.cjs +2 -0
- package/src/lib/views/LoginWithEmailView/components/ListItemButton/ListItemButton.js +2 -0
- package/src/lib/views/LoginWithEmailView/components/LoginWithEmailForm/LoginWithEmailForm.cjs +2 -0
- package/src/lib/views/LoginWithEmailView/components/LoginWithEmailForm/LoginWithEmailForm.js +2 -0
- package/src/lib/views/LoginWithEmailView/components/SocialSignIn/SocialSignIn.cjs +2 -0
- package/src/lib/views/LoginWithEmailView/components/SocialSignIn/SocialSignIn.js +2 -0
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.cjs +1 -0
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.js +1 -0
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.cjs +1 -0
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.js +1 -0
- package/src/lib/views/NoAccess/NoAccess.cjs +1 -0
- package/src/lib/views/NoAccess/NoAccess.js +1 -0
- package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.cjs +1 -0
- package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.js +1 -0
- package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.cjs +2 -0
- package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.js +2 -0
- package/src/lib/views/PendingConnectView/PendingConnectView.cjs +1 -0
- package/src/lib/views/PendingConnectView/PendingConnectView.js +1 -0
- package/src/lib/views/PendingSignatureView/PendingSignatureView.cjs +1 -0
- package/src/lib/views/PendingSignatureView/PendingSignatureView.js +1 -0
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.cjs +2 -0
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.js +2 -0
- package/src/lib/views/QrCodeView/QrCodeView.cjs +1 -0
- package/src/lib/views/QrCodeView/QrCodeView.js +1 -0
- package/src/lib/views/SocialRedirectView/SocialRedirectView.cjs +2 -0
- package/src/lib/views/SocialRedirectView/SocialRedirectView.js +2 -0
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.cjs +92 -0
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.d.ts +13 -0
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.js +88 -0
- package/src/lib/{modals/TransactionConfirmationModal → views/TransactionConfirmationView}/helpers/transactionErrorMessage.cjs +6 -1
- package/src/lib/{modals/TransactionConfirmationModal → views/TransactionConfirmationView}/helpers/transactionErrorMessage.d.ts +1 -0
- package/src/lib/{modals/TransactionConfirmationModal → views/TransactionConfirmationView}/helpers/transactionErrorMessage.js +6 -1
- package/src/lib/{modals/TransactionConfirmationModal → views/TransactionConfirmationView}/hooks/useTransactionData/useTransactionData.cjs +2 -0
- package/src/lib/{modals/TransactionConfirmationModal → views/TransactionConfirmationView}/hooks/useTransactionData/useTransactionData.js +2 -0
- package/src/lib/views/TransactionConfirmationView/index.d.ts +2 -0
- package/src/lib/views/WalletList/SearchInstead/SearchInstead.cjs +2 -0
- package/src/lib/views/WalletList/SearchInstead/SearchInstead.js +2 -0
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.cjs +1 -0
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.js +1 -0
- package/src/lib/views/WalletList/data.cjs +4 -5
- package/src/lib/views/WalletList/data.d.ts +2 -2
- package/src/lib/views/WalletList/data.js +4 -5
- package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.cjs +1 -0
- package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.js +1 -0
- package/src/lib/views/WalletUsedView/WalletUsedView.cjs +1 -0
- package/src/lib/views/WalletUsedView/WalletUsedView.js +1 -0
- package/src/lib/widgets/DynamicWidget/DynamicWidget.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/DynamicWidget.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.js +1 -0
- package/src/lib/widgets/DynamicWidget/components/Balance/Balance.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/Balance/Balance.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.js +1 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetPrompts/DynamicWidgetPrompts.cjs +15 -5
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetPrompts/DynamicWidgetPrompts.js +15 -5
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetSwitcher/DynamicWidgetSwitcher.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetSwitcher/DynamicWidgetSwitcher.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetDropdown/DynamicWidgetDropdown.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetDropdown/DynamicWidgetDropdown.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetModal/DynamicWidgetModal.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetModal/DynamicWidgetModal.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.cjs +4 -1
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.js +4 -1
- package/src/lib/widgets/DynamicWidget/components/WalletIconWithStatus/WalletIconWithStatus.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/components/WalletIconWithStatus/WalletIconWithStatus.js +1 -0
- package/src/lib/widgets/DynamicWidget/components/WidgetPortal/WidgetPortal.cjs +40 -6
- package/src/lib/widgets/DynamicWidget/components/WidgetPortal/WidgetPortal.d.ts +2 -1
- package/src/lib/widgets/DynamicWidget/components/WidgetPortal/WidgetPortal.js +41 -7
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.js +2 -0
- package/src/lib/widgets/DynamicWidget/hooks/useFetchBalance/useFetchBalance.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/hooks/useFetchBalance/useFetchBalance.js +1 -0
- package/src/lib/widgets/DynamicWidget/{components/DefaultPendingSignModalContent/DefaultPendingSignModalContent.cjs → prompts/DefaultPromptModal/DefaultPromptModal.cjs} +8 -13
- package/src/lib/widgets/DynamicWidget/prompts/DefaultPromptModal/DefaultPromptModal.d.ts +13 -0
- package/src/lib/widgets/DynamicWidget/{components/DefaultPendingSignModalContent/DefaultPendingSignModalContent.js → prompts/DefaultPromptModal/DefaultPromptModal.js} +8 -13
- package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.js +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.cjs +2 -1
- package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.js +2 -1
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/PendingAccountSwitchModal.cjs +17 -42
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/PendingAccountSwitchModal.js +18 -43
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/SwitchAccountView.cjs +42 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/SwitchAccountView.d.ts +7 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/SwitchAccountView.js +38 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.cjs +68 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.d.ts +8 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.js +64 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/PendingAccountSwitchToLinkModal.cjs +58 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/PendingAccountSwitchToLinkModal.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/PendingAccountSwitchToLinkModal.js +54 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.cjs +45 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.js +41 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/DefaultPendingSignModalContent/DefaultPendingSignModalContent.cjs +65 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/DefaultPendingSignModalContent/DefaultPendingSignModalContent.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/DefaultPendingSignModalContent/DefaultPendingSignModalContent.js +61 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/PendingSignModal.cjs +2 -33
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/PendingSignModal.js +2 -33
- package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.cjs +5 -6
- package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.js +6 -7
- package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.cjs +2 -1
- package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.js +2 -1
- package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/UnlinkWalletPopUp.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/UnlinkWalletPopUp.js +2 -0
- package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.js +2 -0
- package/src/lib/widgets/DynamicWidget/views/IndexView/IndexView.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/views/IndexView/IndexView.js +2 -0
- package/src/lib/widgets/DynamicWidget/views/ProfileView/ProfileView.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/views/ProfileView/ProfileView.js +2 -0
- package/src/lib/widgets/FundingWidget/views/FundWalletView/FundWalletView.cjs +2 -0
- package/src/lib/widgets/FundingWidget/views/FundWalletView/FundWalletView.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/DefaultPendingSignModalContent/DefaultPendingSignModalContent.d.ts +0 -2
- package/src/lib/widgets/DynamicWidget/components/DefaultPendingSignModalContent/DefaultPendingSignModalContent.types.d.ts +0 -7
- package/src/lib/widgets/DynamicWidget/prompts/DetectedKnownSecondaryWalletModal/DetectedKnownSecondaryWalletModal.cjs +0 -61
- package/src/lib/widgets/DynamicWidget/prompts/DetectedKnownSecondaryWalletModal/DetectedKnownSecondaryWalletModal.d.ts +0 -7
- package/src/lib/widgets/DynamicWidget/prompts/DetectedKnownSecondaryWalletModal/DetectedKnownSecondaryWalletModal.js +0 -57
- package/src/lib/widgets/DynamicWidget/prompts/DetectedKnownSecondaryWalletModal/index.d.ts +0 -1
- /package/src/lib/{modals/TransactionConfirmationModal → views/TransactionConfirmationView}/hooks/index.d.ts +0 -0
- /package/src/lib/{modals/TransactionConfirmationModal → views/TransactionConfirmationView}/hooks/useTransactionData/index.d.ts +0 -0
- /package/src/lib/{modals/TransactionConfirmationModal → views/TransactionConfirmationView}/hooks/useTransactionData/useTransactionData.d.ts +0 -0
- /package/src/lib/widgets/DynamicWidget/{components → prompts/PendingSignModal}/DefaultPendingSignModalContent/index.d.ts +0 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _tslib = require('../../../../../../_virtual/_tslib.cjs');
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
var React = require('react');
|
|
8
|
+
var walletBook = require('@dynamic-labs/wallet-book');
|
|
9
|
+
var useInternalDynamicContext = require('../../../../context/DynamicContext/useInternalDynamicContext.cjs');
|
|
10
|
+
var Typography = require('../../../../components/Typography/Typography.cjs');
|
|
11
|
+
require('@dynamic-labs/sdk-api');
|
|
12
|
+
require('../../../../shared/logger.cjs');
|
|
13
|
+
require('@dynamic-labs/iconic');
|
|
14
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
15
|
+
require('../../../../context/ViewContext/ViewContext.cjs');
|
|
16
|
+
require('@dynamic-labs/utils');
|
|
17
|
+
require('../../../../utils/constants/colors.cjs');
|
|
18
|
+
require('ethers');
|
|
19
|
+
require('../../../../shared/consts/index.cjs');
|
|
20
|
+
require('@dynamic-labs/multi-wallet');
|
|
21
|
+
require('../../../../components/ShadowDOM/ShadowDOM.cjs');
|
|
22
|
+
require('../../../../context/ThemeContext/ThemeContext.cjs');
|
|
23
|
+
require('react-dom');
|
|
24
|
+
require('react-focus-lock');
|
|
25
|
+
require('../../../../components/Transition/ZoomTransition/ZoomTransition.cjs');
|
|
26
|
+
require('../../../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
|
|
27
|
+
require('../../../../components/Transition/OpacityTransition/OpacityTransition.cjs');
|
|
28
|
+
require('../../../../config/ApiEndpoint.cjs');
|
|
29
|
+
require('@dynamic-labs/rpc-providers');
|
|
30
|
+
require('../../../../context/ErrorContext/ErrorContext.cjs');
|
|
31
|
+
require('../../../../context/MockContext/MockContext.cjs');
|
|
32
|
+
require('../../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
33
|
+
require('../../../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.cjs');
|
|
34
|
+
require('../../../../components/IconButton/IconButton.cjs');
|
|
35
|
+
require('../../../../components/Alert/Alert.cjs');
|
|
36
|
+
require('../../../../components/Popper/Popper/Popper.cjs');
|
|
37
|
+
require('../../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
38
|
+
require('../../../../components/SendBalanceForm/SendBalanceForm.cjs');
|
|
39
|
+
var DefaultPromptModal = require('../DefaultPromptModal/DefaultPromptModal.cjs');
|
|
40
|
+
|
|
41
|
+
const PendingAccountSwitchToLinkModal = () => {
|
|
42
|
+
const { selectedWalletConnector } = useInternalDynamicContext.useInternalDynamicContext();
|
|
43
|
+
React.useEffect(() => {
|
|
44
|
+
//flow client library only supports one connected wallet at any given time.
|
|
45
|
+
const disconnectAndConnect = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
46
|
+
var _a, _b;
|
|
47
|
+
if ((selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.connectedChain) !== 'FLOW') {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
yield ((_a = selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.endSession) === null || _a === void 0 ? void 0 : _a.call(selectedWalletConnector));
|
|
51
|
+
(_b = selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.connect) === null || _b === void 0 ? void 0 : _b.call(selectedWalletConnector);
|
|
52
|
+
});
|
|
53
|
+
disconnectAndConnect();
|
|
54
|
+
}, [selectedWalletConnector]);
|
|
55
|
+
return (jsxRuntime.jsx(DefaultPromptModal.DefaultPromptModal, Object.assign({ showCloseButton: true, dataTestId: 'pending-account-switch', icon: jsxRuntime.jsx(walletBook.WalletIcon, { walletName: selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name }), title: `Switch wallet in ${selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name}` }, { children: jsxRuntime.jsxs(Typography.Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content' }, { children: ["To link a new wallet, open", ' ', jsxRuntime.jsx(Typography.Typography, Object.assign({ as: 'span', weight: 'medium', color: 'primary' }, { children: selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name })), ' ', "and switch to the account you want to link."] })) })));
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
exports.PendingAccountSwitchToLinkModal = PendingAccountSwitchToLinkModal;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { __awaiter } from '../../../../../../_virtual/_tslib.js';
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { useEffect } from 'react';
|
|
4
|
+
import { WalletIcon } from '@dynamic-labs/wallet-book';
|
|
5
|
+
import { useInternalDynamicContext } from '../../../../context/DynamicContext/useInternalDynamicContext.js';
|
|
6
|
+
import { Typography } from '../../../../components/Typography/Typography.js';
|
|
7
|
+
import '@dynamic-labs/sdk-api';
|
|
8
|
+
import '../../../../shared/logger.js';
|
|
9
|
+
import '@dynamic-labs/iconic';
|
|
10
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
11
|
+
import '../../../../context/ViewContext/ViewContext.js';
|
|
12
|
+
import '@dynamic-labs/utils';
|
|
13
|
+
import '../../../../utils/constants/colors.js';
|
|
14
|
+
import 'ethers';
|
|
15
|
+
import '../../../../shared/consts/index.js';
|
|
16
|
+
import '@dynamic-labs/multi-wallet';
|
|
17
|
+
import '../../../../components/ShadowDOM/ShadowDOM.js';
|
|
18
|
+
import '../../../../context/ThemeContext/ThemeContext.js';
|
|
19
|
+
import 'react-dom';
|
|
20
|
+
import 'react-focus-lock';
|
|
21
|
+
import '../../../../components/Transition/ZoomTransition/ZoomTransition.js';
|
|
22
|
+
import '../../../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
|
|
23
|
+
import '../../../../components/Transition/OpacityTransition/OpacityTransition.js';
|
|
24
|
+
import '../../../../config/ApiEndpoint.js';
|
|
25
|
+
import '@dynamic-labs/rpc-providers';
|
|
26
|
+
import '../../../../context/ErrorContext/ErrorContext.js';
|
|
27
|
+
import '../../../../context/MockContext/MockContext.js';
|
|
28
|
+
import '../../../../context/CaptchaContext/CaptchaContext.js';
|
|
29
|
+
import '../../../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.js';
|
|
30
|
+
import '../../../../components/IconButton/IconButton.js';
|
|
31
|
+
import '../../../../components/Alert/Alert.js';
|
|
32
|
+
import '../../../../components/Popper/Popper/Popper.js';
|
|
33
|
+
import '../../../../components/Popper/PopperContext/PopperContext.js';
|
|
34
|
+
import '../../../../components/SendBalanceForm/SendBalanceForm.js';
|
|
35
|
+
import { DefaultPromptModal } from '../DefaultPromptModal/DefaultPromptModal.js';
|
|
36
|
+
|
|
37
|
+
const PendingAccountSwitchToLinkModal = () => {
|
|
38
|
+
const { selectedWalletConnector } = useInternalDynamicContext();
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
//flow client library only supports one connected wallet at any given time.
|
|
41
|
+
const disconnectAndConnect = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
42
|
+
var _a, _b;
|
|
43
|
+
if ((selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.connectedChain) !== 'FLOW') {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
yield ((_a = selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.endSession) === null || _a === void 0 ? void 0 : _a.call(selectedWalletConnector));
|
|
47
|
+
(_b = selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.connect) === null || _b === void 0 ? void 0 : _b.call(selectedWalletConnector);
|
|
48
|
+
});
|
|
49
|
+
disconnectAndConnect();
|
|
50
|
+
}, [selectedWalletConnector]);
|
|
51
|
+
return (jsx(DefaultPromptModal, Object.assign({ showCloseButton: true, dataTestId: 'pending-account-switch', icon: jsx(WalletIcon, { walletName: selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name }), title: `Switch wallet in ${selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name}` }, { children: jsxs(Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content' }, { children: ["To link a new wallet, open", ' ', jsx(Typography, Object.assign({ as: 'span', weight: 'medium', color: 'primary' }, { children: selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name })), ' ', "and switch to the account you want to link."] })) })));
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export { PendingAccountSwitchToLinkModal };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './PendingAccountSwitchToLinkModal';
|
package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.cjs
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var walletBook = require('@dynamic-labs/wallet-book');
|
|
7
|
+
var useInternalDynamicContext = require('../../../../context/DynamicContext/useInternalDynamicContext.cjs');
|
|
8
|
+
var DefaultPromptModal = require('../DefaultPromptModal/DefaultPromptModal.cjs');
|
|
9
|
+
require('react');
|
|
10
|
+
var Typography = require('../../../../components/Typography/Typography.cjs');
|
|
11
|
+
require('@dynamic-labs/sdk-api');
|
|
12
|
+
require('../../../../shared/logger.cjs');
|
|
13
|
+
require('@dynamic-labs/iconic');
|
|
14
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
15
|
+
require('../../../../context/ViewContext/ViewContext.cjs');
|
|
16
|
+
require('@dynamic-labs/utils');
|
|
17
|
+
require('../../../../utils/constants/colors.cjs');
|
|
18
|
+
require('ethers');
|
|
19
|
+
require('../../../../shared/consts/index.cjs');
|
|
20
|
+
require('@dynamic-labs/multi-wallet');
|
|
21
|
+
require('../../../../components/ShadowDOM/ShadowDOM.cjs');
|
|
22
|
+
require('../../../../context/ThemeContext/ThemeContext.cjs');
|
|
23
|
+
require('react-dom');
|
|
24
|
+
require('react-focus-lock');
|
|
25
|
+
require('../../../../components/Transition/ZoomTransition/ZoomTransition.cjs');
|
|
26
|
+
require('../../../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
|
|
27
|
+
require('../../../../components/Transition/OpacityTransition/OpacityTransition.cjs');
|
|
28
|
+
require('../../../../config/ApiEndpoint.cjs');
|
|
29
|
+
require('@dynamic-labs/rpc-providers');
|
|
30
|
+
require('../../../../context/ErrorContext/ErrorContext.cjs');
|
|
31
|
+
require('../../../../context/MockContext/MockContext.cjs');
|
|
32
|
+
require('../../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
33
|
+
require('../../../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.cjs');
|
|
34
|
+
require('../../../../components/IconButton/IconButton.cjs');
|
|
35
|
+
require('../../../../components/Alert/Alert.cjs');
|
|
36
|
+
require('../../../../components/Popper/Popper/Popper.cjs');
|
|
37
|
+
require('../../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
38
|
+
require('../../../../components/SendBalanceForm/SendBalanceForm.cjs');
|
|
39
|
+
|
|
40
|
+
const PendingConnectionModal = () => {
|
|
41
|
+
const { selectedWalletConnector } = useInternalDynamicContext.useInternalDynamicContext();
|
|
42
|
+
return (jsxRuntime.jsx(DefaultPromptModal.DefaultPromptModal, Object.assign({ showCloseButton: true, dataTestId: 'pending-connection-modal', icon: jsxRuntime.jsx(walletBook.WalletIcon, { walletName: selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name }), title: `Connect ${selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name} wallet` }, { children: jsxRuntime.jsxs(Typography.Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content' }, { children: ["Connect your", ' ', jsxRuntime.jsx(Typography.Typography, Object.assign({ as: 'span', weight: 'medium', color: 'primary' }, { children: selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name })), ' ', "wallet to make active."] })) })));
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
exports.PendingConnectionModal = PendingConnectionModal;
|
package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { WalletIcon } from '@dynamic-labs/wallet-book';
|
|
3
|
+
import { useInternalDynamicContext } from '../../../../context/DynamicContext/useInternalDynamicContext.js';
|
|
4
|
+
import { DefaultPromptModal } from '../DefaultPromptModal/DefaultPromptModal.js';
|
|
5
|
+
import 'react';
|
|
6
|
+
import { Typography } from '../../../../components/Typography/Typography.js';
|
|
7
|
+
import '@dynamic-labs/sdk-api';
|
|
8
|
+
import '../../../../shared/logger.js';
|
|
9
|
+
import '@dynamic-labs/iconic';
|
|
10
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
11
|
+
import '../../../../context/ViewContext/ViewContext.js';
|
|
12
|
+
import '@dynamic-labs/utils';
|
|
13
|
+
import '../../../../utils/constants/colors.js';
|
|
14
|
+
import 'ethers';
|
|
15
|
+
import '../../../../shared/consts/index.js';
|
|
16
|
+
import '@dynamic-labs/multi-wallet';
|
|
17
|
+
import '../../../../components/ShadowDOM/ShadowDOM.js';
|
|
18
|
+
import '../../../../context/ThemeContext/ThemeContext.js';
|
|
19
|
+
import 'react-dom';
|
|
20
|
+
import 'react-focus-lock';
|
|
21
|
+
import '../../../../components/Transition/ZoomTransition/ZoomTransition.js';
|
|
22
|
+
import '../../../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
|
|
23
|
+
import '../../../../components/Transition/OpacityTransition/OpacityTransition.js';
|
|
24
|
+
import '../../../../config/ApiEndpoint.js';
|
|
25
|
+
import '@dynamic-labs/rpc-providers';
|
|
26
|
+
import '../../../../context/ErrorContext/ErrorContext.js';
|
|
27
|
+
import '../../../../context/MockContext/MockContext.js';
|
|
28
|
+
import '../../../../context/CaptchaContext/CaptchaContext.js';
|
|
29
|
+
import '../../../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.js';
|
|
30
|
+
import '../../../../components/IconButton/IconButton.js';
|
|
31
|
+
import '../../../../components/Alert/Alert.js';
|
|
32
|
+
import '../../../../components/Popper/Popper/Popper.js';
|
|
33
|
+
import '../../../../components/Popper/PopperContext/PopperContext.js';
|
|
34
|
+
import '../../../../components/SendBalanceForm/SendBalanceForm.js';
|
|
35
|
+
|
|
36
|
+
const PendingConnectionModal = () => {
|
|
37
|
+
const { selectedWalletConnector } = useInternalDynamicContext();
|
|
38
|
+
return (jsx(DefaultPromptModal, Object.assign({ showCloseButton: true, dataTestId: 'pending-connection-modal', icon: jsx(WalletIcon, { walletName: selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name }), title: `Connect ${selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name} wallet` }, { children: jsxs(Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content' }, { children: ["Connect your", ' ', jsx(Typography, Object.assign({ as: 'span', weight: 'medium', color: 'primary' }, { children: selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name })), ' ', "wallet to make active."] })) })));
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export { PendingConnectionModal };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './PendingConnectionModal';
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _tslib = require('../../../../../../../_virtual/_tslib.cjs');
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
var utils = require('@dynamic-labs/utils');
|
|
8
|
+
var walletBook = require('@dynamic-labs/wallet-book');
|
|
9
|
+
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
10
|
+
require('react');
|
|
11
|
+
var Typography = require('../../../../../components/Typography/Typography.cjs');
|
|
12
|
+
require('@dynamic-labs/sdk-api');
|
|
13
|
+
require('../../../../../shared/logger.cjs');
|
|
14
|
+
require('@dynamic-labs/iconic');
|
|
15
|
+
require('../../../../../context/ViewContext/ViewContext.cjs');
|
|
16
|
+
require('../../../../../utils/constants/colors.cjs');
|
|
17
|
+
require('ethers');
|
|
18
|
+
require('../../../../../shared/consts/index.cjs');
|
|
19
|
+
var useInternalDynamicContext = require('../../../../../context/DynamicContext/useInternalDynamicContext.cjs');
|
|
20
|
+
require('@dynamic-labs/multi-wallet');
|
|
21
|
+
require('../../../../../components/ShadowDOM/ShadowDOM.cjs');
|
|
22
|
+
require('../../../../../context/ThemeContext/ThemeContext.cjs');
|
|
23
|
+
require('react-dom');
|
|
24
|
+
require('react-focus-lock');
|
|
25
|
+
require('../../../../../components/Transition/ZoomTransition/ZoomTransition.cjs');
|
|
26
|
+
require('../../../../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
|
|
27
|
+
require('../../../../../components/Transition/OpacityTransition/OpacityTransition.cjs');
|
|
28
|
+
require('../../../../../config/ApiEndpoint.cjs');
|
|
29
|
+
require('@dynamic-labs/rpc-providers');
|
|
30
|
+
require('../../../../../context/ErrorContext/ErrorContext.cjs');
|
|
31
|
+
require('../../../../../context/MockContext/MockContext.cjs');
|
|
32
|
+
require('../../../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
33
|
+
var useConnectAndSignSplitSteps = require('../../../../../utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.cjs');
|
|
34
|
+
require('../../../../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.cjs');
|
|
35
|
+
var Button = require('../../../../../components/Button/Button.cjs');
|
|
36
|
+
require('../../../../../components/IconButton/IconButton.cjs');
|
|
37
|
+
require('../../../../../components/Alert/Alert.cjs');
|
|
38
|
+
require('../../../../../components/Popper/Popper/Popper.cjs');
|
|
39
|
+
require('../../../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
40
|
+
require('../../../../../components/SendBalanceForm/SendBalanceForm.cjs');
|
|
41
|
+
var DefaultPromptModal = require('../../DefaultPromptModal/DefaultPromptModal.cjs');
|
|
42
|
+
|
|
43
|
+
const DefaultPendingSignModalContent = () => {
|
|
44
|
+
const { selectedWalletConnector, setMultiWalletWidgetState } = useInternalDynamicContext.useInternalDynamicContext();
|
|
45
|
+
const { signAlreadyConnectedUser } = useConnectAndSignSplitSteps.useConnectAndSignSplitSteps();
|
|
46
|
+
const onClickToSign = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
47
|
+
try {
|
|
48
|
+
if (selectedWalletConnector) {
|
|
49
|
+
yield signAlreadyConnectedUser({
|
|
50
|
+
walletConnector: selectedWalletConnector,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
catch (e) {
|
|
55
|
+
walletConnectorCore.logger.error(e);
|
|
56
|
+
}
|
|
57
|
+
finally {
|
|
58
|
+
setMultiWalletWidgetState('idle');
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
return (jsxRuntime.jsxs(DefaultPromptModal.DefaultPromptModal, Object.assign({ showCloseButton: true, dataTestId: 'pending-account-switch', icon: jsxRuntime.jsx(walletBook.WalletIcon, { walletName: selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name }), title: `Sign in with ${selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name}` }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content' }, { children: "Sign the message in your wallet to approve linking this wallet to your account" })), utils.isMobile() &&
|
|
62
|
+
!(selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.canConnectViaCustodialService) && (jsxRuntime.jsx(Button.Button, Object.assign({ buttonClassName: 'default-prompt-modal__button', buttonRounded: 'small', expanded: true, type: 'button', buttonPadding: 'medium', typographyProps: { variant: 'button_secondary' }, onClick: onClickToSign, dataTestId: 'click-to-sign-button' }, { children: "Click to Sign" })))] })));
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
exports.DefaultPendingSignModalContent = DefaultPendingSignModalContent;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { __awaiter } from '../../../../../../../_virtual/_tslib.js';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { isMobile } from '@dynamic-labs/utils';
|
|
4
|
+
import { WalletIcon } from '@dynamic-labs/wallet-book';
|
|
5
|
+
import { logger } from '@dynamic-labs/wallet-connector-core';
|
|
6
|
+
import 'react';
|
|
7
|
+
import { Typography } from '../../../../../components/Typography/Typography.js';
|
|
8
|
+
import '@dynamic-labs/sdk-api';
|
|
9
|
+
import '../../../../../shared/logger.js';
|
|
10
|
+
import '@dynamic-labs/iconic';
|
|
11
|
+
import '../../../../../context/ViewContext/ViewContext.js';
|
|
12
|
+
import '../../../../../utils/constants/colors.js';
|
|
13
|
+
import 'ethers';
|
|
14
|
+
import '../../../../../shared/consts/index.js';
|
|
15
|
+
import { useInternalDynamicContext } from '../../../../../context/DynamicContext/useInternalDynamicContext.js';
|
|
16
|
+
import '@dynamic-labs/multi-wallet';
|
|
17
|
+
import '../../../../../components/ShadowDOM/ShadowDOM.js';
|
|
18
|
+
import '../../../../../context/ThemeContext/ThemeContext.js';
|
|
19
|
+
import 'react-dom';
|
|
20
|
+
import 'react-focus-lock';
|
|
21
|
+
import '../../../../../components/Transition/ZoomTransition/ZoomTransition.js';
|
|
22
|
+
import '../../../../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
|
|
23
|
+
import '../../../../../components/Transition/OpacityTransition/OpacityTransition.js';
|
|
24
|
+
import '../../../../../config/ApiEndpoint.js';
|
|
25
|
+
import '@dynamic-labs/rpc-providers';
|
|
26
|
+
import '../../../../../context/ErrorContext/ErrorContext.js';
|
|
27
|
+
import '../../../../../context/MockContext/MockContext.js';
|
|
28
|
+
import '../../../../../context/CaptchaContext/CaptchaContext.js';
|
|
29
|
+
import { useConnectAndSignSplitSteps } from '../../../../../utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.js';
|
|
30
|
+
import '../../../../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.js';
|
|
31
|
+
import { Button } from '../../../../../components/Button/Button.js';
|
|
32
|
+
import '../../../../../components/IconButton/IconButton.js';
|
|
33
|
+
import '../../../../../components/Alert/Alert.js';
|
|
34
|
+
import '../../../../../components/Popper/Popper/Popper.js';
|
|
35
|
+
import '../../../../../components/Popper/PopperContext/PopperContext.js';
|
|
36
|
+
import '../../../../../components/SendBalanceForm/SendBalanceForm.js';
|
|
37
|
+
import { DefaultPromptModal } from '../../DefaultPromptModal/DefaultPromptModal.js';
|
|
38
|
+
|
|
39
|
+
const DefaultPendingSignModalContent = () => {
|
|
40
|
+
const { selectedWalletConnector, setMultiWalletWidgetState } = useInternalDynamicContext();
|
|
41
|
+
const { signAlreadyConnectedUser } = useConnectAndSignSplitSteps();
|
|
42
|
+
const onClickToSign = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
43
|
+
try {
|
|
44
|
+
if (selectedWalletConnector) {
|
|
45
|
+
yield signAlreadyConnectedUser({
|
|
46
|
+
walletConnector: selectedWalletConnector,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
catch (e) {
|
|
51
|
+
logger.error(e);
|
|
52
|
+
}
|
|
53
|
+
finally {
|
|
54
|
+
setMultiWalletWidgetState('idle');
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
return (jsxs(DefaultPromptModal, Object.assign({ showCloseButton: true, dataTestId: 'pending-account-switch', icon: jsx(WalletIcon, { walletName: selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name }), title: `Sign in with ${selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name}` }, { children: [jsx(Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content' }, { children: "Sign the message in your wallet to approve linking this wallet to your account" })), isMobile() &&
|
|
58
|
+
!(selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.canConnectViaCustodialService) && (jsx(Button, Object.assign({ buttonClassName: 'default-prompt-modal__button', buttonRounded: 'small', expanded: true, type: 'button', buttonPadding: 'medium', typographyProps: { variant: 'button_secondary' }, onClick: onClickToSign, dataTestId: 'click-to-sign-button' }, { children: "Click to Sign" })))] })));
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export { DefaultPendingSignModalContent };
|
|
@@ -2,47 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var _tslib = require('../../../../../../_virtual/_tslib.cjs');
|
|
6
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
6
|
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
8
7
|
var useInternalDynamicContext = require('../../../../context/DynamicContext/useInternalDynamicContext.cjs');
|
|
9
8
|
var WidgetPortal = require('../../components/WidgetPortal/WidgetPortal.cjs');
|
|
10
|
-
require('@dynamic-labs/utils');
|
|
11
|
-
require('../../../../context/ViewContext/ViewContext.cjs');
|
|
12
|
-
require('../../../../context/ErrorContext/ErrorContext.cjs');
|
|
13
|
-
require('@dynamic-labs/sdk-api');
|
|
14
|
-
var logger = require('../../../../shared/logger.cjs');
|
|
15
|
-
require('@dynamic-labs/iconic');
|
|
16
|
-
require('react');
|
|
17
|
-
require('../../../../utils/constants/colors.cjs');
|
|
18
|
-
require('ethers');
|
|
19
|
-
require('../../../../shared/consts/index.cjs');
|
|
20
|
-
require('../../../../config/ApiEndpoint.cjs');
|
|
21
|
-
require('@dynamic-labs/multi-wallet');
|
|
22
|
-
require('../../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
23
|
-
var useConnectAndSignSplitSteps = require('../../../../utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.cjs');
|
|
24
|
-
var DefaultPendingSignModalContent = require('../../components/DefaultPendingSignModalContent/DefaultPendingSignModalContent.cjs');
|
|
25
9
|
var EmailConnectorPendingSignModalContent = require('../../components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.cjs');
|
|
26
10
|
var EmailOTPConnectorPendingSignModalContent = require('../../components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.cjs');
|
|
11
|
+
var DefaultPendingSignModalContent = require('./DefaultPendingSignModalContent/DefaultPendingSignModalContent.cjs');
|
|
27
12
|
|
|
28
13
|
const PendingSignModal = () => {
|
|
29
14
|
const { selectedWalletConnector, setSelectedWalletConnector, setMultiWalletWidgetState, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
30
|
-
const { signAlreadyConnectedUser } = useConnectAndSignSplitSteps.useConnectAndSignSplitSteps();
|
|
31
|
-
const handleClick = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
32
|
-
try {
|
|
33
|
-
if (selectedWalletConnector) {
|
|
34
|
-
yield signAlreadyConnectedUser({
|
|
35
|
-
walletConnector: selectedWalletConnector,
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
catch (e) {
|
|
40
|
-
logger.logger.error(e);
|
|
41
|
-
}
|
|
42
|
-
finally {
|
|
43
|
-
setMultiWalletWidgetState('idle');
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
15
|
const handleOnClickBackdrop = () => {
|
|
47
16
|
setMultiWalletWidgetState('idle');
|
|
48
17
|
setSelectedWalletConnector(null);
|
|
@@ -55,7 +24,7 @@ const PendingSignModal = () => {
|
|
|
55
24
|
return (jsxRuntime.jsx(WidgetPortal.WidgetPortal, Object.assign({ onBackdropClick: handleOnClickBackdrop }, { children: jsxRuntime.jsx(EmailConnectorPendingSignModalContent.EmailConnectorPendingSignModalContent, { emailWalletConnector: selectedWalletConnector }) })));
|
|
56
25
|
}
|
|
57
26
|
}
|
|
58
|
-
return
|
|
27
|
+
return jsxRuntime.jsx(DefaultPendingSignModalContent.DefaultPendingSignModalContent, {});
|
|
59
28
|
};
|
|
60
29
|
|
|
61
30
|
exports.PendingSignModal = PendingSignModal;
|
|
@@ -1,44 +1,13 @@
|
|
|
1
|
-
import { __awaiter } from '../../../../../../_virtual/_tslib.js';
|
|
2
1
|
import { jsx } from 'react/jsx-runtime';
|
|
3
2
|
import { isEmailOTPWalletConnector, isEmailWalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
4
3
|
import { useInternalDynamicContext } from '../../../../context/DynamicContext/useInternalDynamicContext.js';
|
|
5
4
|
import { WidgetPortal } from '../../components/WidgetPortal/WidgetPortal.js';
|
|
6
|
-
import '@dynamic-labs/utils';
|
|
7
|
-
import '../../../../context/ViewContext/ViewContext.js';
|
|
8
|
-
import '../../../../context/ErrorContext/ErrorContext.js';
|
|
9
|
-
import '@dynamic-labs/sdk-api';
|
|
10
|
-
import { logger } from '../../../../shared/logger.js';
|
|
11
|
-
import '@dynamic-labs/iconic';
|
|
12
|
-
import 'react';
|
|
13
|
-
import '../../../../utils/constants/colors.js';
|
|
14
|
-
import 'ethers';
|
|
15
|
-
import '../../../../shared/consts/index.js';
|
|
16
|
-
import '../../../../config/ApiEndpoint.js';
|
|
17
|
-
import '@dynamic-labs/multi-wallet';
|
|
18
|
-
import '../../../../context/CaptchaContext/CaptchaContext.js';
|
|
19
|
-
import { useConnectAndSignSplitSteps } from '../../../../utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.js';
|
|
20
|
-
import { DefaultPendingSignModalContent } from '../../components/DefaultPendingSignModalContent/DefaultPendingSignModalContent.js';
|
|
21
5
|
import { EmailConnectorPendingSignModalContent } from '../../components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.js';
|
|
22
6
|
import { EmailOTPConnectorPendingSignModalContent } from '../../components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.js';
|
|
7
|
+
import { DefaultPendingSignModalContent } from './DefaultPendingSignModalContent/DefaultPendingSignModalContent.js';
|
|
23
8
|
|
|
24
9
|
const PendingSignModal = () => {
|
|
25
10
|
const { selectedWalletConnector, setSelectedWalletConnector, setMultiWalletWidgetState, } = useInternalDynamicContext();
|
|
26
|
-
const { signAlreadyConnectedUser } = useConnectAndSignSplitSteps();
|
|
27
|
-
const handleClick = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
28
|
-
try {
|
|
29
|
-
if (selectedWalletConnector) {
|
|
30
|
-
yield signAlreadyConnectedUser({
|
|
31
|
-
walletConnector: selectedWalletConnector,
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
catch (e) {
|
|
36
|
-
logger.error(e);
|
|
37
|
-
}
|
|
38
|
-
finally {
|
|
39
|
-
setMultiWalletWidgetState('idle');
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
11
|
const handleOnClickBackdrop = () => {
|
|
43
12
|
setMultiWalletWidgetState('idle');
|
|
44
13
|
setSelectedWalletConnector(null);
|
|
@@ -51,7 +20,7 @@ const PendingSignModal = () => {
|
|
|
51
20
|
return (jsx(WidgetPortal, Object.assign({ onBackdropClick: handleOnClickBackdrop }, { children: jsx(EmailConnectorPendingSignModalContent, { emailWalletConnector: selectedWalletConnector }) })));
|
|
52
21
|
}
|
|
53
22
|
}
|
|
54
|
-
return
|
|
23
|
+
return jsx(DefaultPendingSignModalContent, {});
|
|
55
24
|
};
|
|
56
25
|
|
|
57
26
|
export { PendingSignModal };
|
package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.cjs
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var React = require('react');
|
|
7
6
|
var walletBook = require('@dynamic-labs/wallet-book');
|
|
7
|
+
require('react');
|
|
8
8
|
var Typography = require('../../../../components/Typography/Typography.cjs');
|
|
9
9
|
require('@dynamic-labs/sdk-api');
|
|
10
10
|
require('../../../../shared/logger.cjs');
|
|
@@ -33,18 +33,17 @@ require('../../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
|
33
33
|
require('../../../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.cjs');
|
|
34
34
|
require('../../../../components/IconButton/IconButton.cjs');
|
|
35
35
|
require('../../../../components/Alert/Alert.cjs');
|
|
36
|
-
var IconWithSpinner = require('../../../../components/IconWithSpinner/IconWithSpinner.cjs');
|
|
37
36
|
var LogoutButton = require('../../../../components/LogoutButton/LogoutButton.cjs');
|
|
38
37
|
require('../../../../components/Popper/Popper/Popper.cjs');
|
|
39
38
|
require('../../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
40
|
-
|
|
39
|
+
require('../../../../components/SendBalanceForm/SendBalanceForm.cjs');
|
|
40
|
+
var Divider = require('../../../../components/Divider/Divider.cjs');
|
|
41
|
+
var DefaultPromptModal = require('../DefaultPromptModal/DefaultPromptModal.cjs');
|
|
41
42
|
|
|
42
43
|
const PrimaryNotConnectedModal = () => {
|
|
43
44
|
var _a;
|
|
44
45
|
const { primaryWallet } = useInternalDynamicContext.useInternalDynamicContext();
|
|
45
|
-
|
|
46
|
-
const primaryWalletCopy = React.useMemo(() => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: ["to", ' ', jsxRuntime.jsx("span", Object.assign({ className: 'primary-not-connected__content-bold' }, { children: shortenWalletAddress.shortenWalletAddress(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.address, 4, 4) })), ' ', "in", ' ', jsxRuntime.jsx("span", Object.assign({ className: 'primary-not-connected__content-bold' }, { children: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.name })), ' '] })), [primaryWallet]);
|
|
47
|
-
return (jsxRuntime.jsxs(WidgetPortal.WidgetPortal, { children: [jsxRuntime.jsx("div", Object.assign({ className: 'primary-not-connected__prompt-container' }, { children: jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: icon, iconSize: 96, isSpinning: true }) })), jsxRuntime.jsx("div", Object.assign({ className: 'primary-not-connected__content-container' }, { children: jsxRuntime.jsxs("div", Object.assign({ className: 'primary-not-connected__content', "data-testid": 'wallet-not-connected' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'title', color: 'primary' }, { children: "Update your active wallet" })), jsxRuntime.jsxs(Typography.Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular' }, { children: ["Update your active wallet ", primaryWallet && primaryWalletCopy, "to reconnect."] }))] })) })), jsxRuntime.jsx(LogoutButton.LogoutButton, { buttonClassName: 'primary-not-connected__logout-button' })] }));
|
|
46
|
+
return (jsxRuntime.jsxs(DefaultPromptModal.DefaultPromptModal, Object.assign({ dataTestId: 'wallet-not-connected', icon: jsxRuntime.jsx(walletBook.WalletIcon, { walletName: (_a = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) === null || _a === void 0 ? void 0 : _a.name }), title: `Switch wallet in ${primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.name}` }, { children: [jsxRuntime.jsxs(Typography.Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content' }, { children: ["Your active wallet in", ' ', jsxRuntime.jsx(Typography.Typography, Object.assign({ as: 'span', weight: 'medium', color: 'primary' }, { children: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.name })), ' ', "is not linked. Please switch to wallet", ' ', jsxRuntime.jsx(Typography.Typography, Object.assign({ as: 'span', weight: 'medium', color: 'primary' }, { children: shortenWalletAddress.shortenWalletAddress(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.address, 3, 3) })), ' ', "to log in."] })), jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content' }, { children: "You can link this wallet to this account after you log in." })), jsxRuntime.jsx(Divider.Divider, { fullWidth: true, text: 'Or' }), jsxRuntime.jsx(LogoutButton.LogoutButton, { isTextButton: false, buttonClassName: 'primary-not-connected__log-out-button' })] })));
|
|
48
47
|
};
|
|
49
48
|
|
|
50
49
|
exports.PrimaryNotConnectedModal = PrimaryNotConnectedModal;
|
package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useMemo } from 'react';
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
2
|
import { WalletIcon } from '@dynamic-labs/wallet-book';
|
|
3
|
+
import 'react';
|
|
4
4
|
import { Typography } from '../../../../components/Typography/Typography.js';
|
|
5
5
|
import '@dynamic-labs/sdk-api';
|
|
6
6
|
import '../../../../shared/logger.js';
|
|
@@ -29,18 +29,17 @@ import '../../../../context/CaptchaContext/CaptchaContext.js';
|
|
|
29
29
|
import '../../../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.js';
|
|
30
30
|
import '../../../../components/IconButton/IconButton.js';
|
|
31
31
|
import '../../../../components/Alert/Alert.js';
|
|
32
|
-
import { IconWithSpinner } from '../../../../components/IconWithSpinner/IconWithSpinner.js';
|
|
33
32
|
import { LogoutButton } from '../../../../components/LogoutButton/LogoutButton.js';
|
|
34
33
|
import '../../../../components/Popper/Popper/Popper.js';
|
|
35
34
|
import '../../../../components/Popper/PopperContext/PopperContext.js';
|
|
36
|
-
import
|
|
35
|
+
import '../../../../components/SendBalanceForm/SendBalanceForm.js';
|
|
36
|
+
import { Divider } from '../../../../components/Divider/Divider.js';
|
|
37
|
+
import { DefaultPromptModal } from '../DefaultPromptModal/DefaultPromptModal.js';
|
|
37
38
|
|
|
38
39
|
const PrimaryNotConnectedModal = () => {
|
|
39
40
|
var _a;
|
|
40
41
|
const { primaryWallet } = useInternalDynamicContext();
|
|
41
|
-
|
|
42
|
-
const primaryWalletCopy = useMemo(() => (jsxs(Fragment, { children: ["to", ' ', jsx("span", Object.assign({ className: 'primary-not-connected__content-bold' }, { children: shortenWalletAddress(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.address, 4, 4) })), ' ', "in", ' ', jsx("span", Object.assign({ className: 'primary-not-connected__content-bold' }, { children: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.name })), ' '] })), [primaryWallet]);
|
|
43
|
-
return (jsxs(WidgetPortal, { children: [jsx("div", Object.assign({ className: 'primary-not-connected__prompt-container' }, { children: jsx(IconWithSpinner, { Icon: icon, iconSize: 96, isSpinning: true }) })), jsx("div", Object.assign({ className: 'primary-not-connected__content-container' }, { children: jsxs("div", Object.assign({ className: 'primary-not-connected__content', "data-testid": 'wallet-not-connected' }, { children: [jsx(Typography, Object.assign({ variant: 'title', color: 'primary' }, { children: "Update your active wallet" })), jsxs(Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular' }, { children: ["Update your active wallet ", primaryWallet && primaryWalletCopy, "to reconnect."] }))] })) })), jsx(LogoutButton, { buttonClassName: 'primary-not-connected__logout-button' })] }));
|
|
42
|
+
return (jsxs(DefaultPromptModal, Object.assign({ dataTestId: 'wallet-not-connected', icon: jsx(WalletIcon, { walletName: (_a = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) === null || _a === void 0 ? void 0 : _a.name }), title: `Switch wallet in ${primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.name}` }, { children: [jsxs(Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content' }, { children: ["Your active wallet in", ' ', jsx(Typography, Object.assign({ as: 'span', weight: 'medium', color: 'primary' }, { children: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.name })), ' ', "is not linked. Please switch to wallet", ' ', jsx(Typography, Object.assign({ as: 'span', weight: 'medium', color: 'primary' }, { children: shortenWalletAddress(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.address, 3, 3) })), ' ', "to log in."] })), jsx(Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content' }, { children: "You can link this wallet to this account after you log in." })), jsx(Divider, { fullWidth: true, text: 'Or' }), jsx(LogoutButton, { isTextButton: false, buttonClassName: 'primary-not-connected__log-out-button' })] })));
|
|
44
43
|
};
|
|
45
44
|
|
|
46
45
|
export { PrimaryNotConnectedModal };
|
|
@@ -42,6 +42,7 @@ var TextButton = require('../../../../components/TextButton/TextButton.cjs');
|
|
|
42
42
|
require('../../../../components/Alert/Alert.cjs');
|
|
43
43
|
require('../../../../components/Popper/Popper/Popper.cjs');
|
|
44
44
|
require('../../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
45
|
+
require('../../../../components/SendBalanceForm/SendBalanceForm.cjs');
|
|
45
46
|
|
|
46
47
|
const QrCodeModalView = ({ walletId }) => {
|
|
47
48
|
var _a;
|
|
@@ -60,7 +61,7 @@ const QrCodeModalView = ({ walletId }) => {
|
|
|
60
61
|
// can't use theme because it's string instead of 'light' | 'dark'
|
|
61
62
|
const typedTheme = theme.theme.name === 'light' ? 'light' : 'dark';
|
|
62
63
|
const icon = (jsxRuntime.jsx(walletBook.WalletIcon, { walletName: walletName, style: { height: pixelToRem.pixelToRem(24), width: pixelToRem.pixelToRem(24) } }));
|
|
63
|
-
return (jsxRuntime.jsxs("div", Object.assign({ className: 'qr-code-modal-view' }, { children: [jsxRuntime.jsxs(Typography.Typography, Object.assign({ variant: 'button_primary', color: 'primary', className: 'qr-code-modal-view__title' }, { children: ["Connect with ", newPrimaryWallet === null || newPrimaryWallet === void 0 ? void 0 : newPrimaryWallet.connector.name] })), jsxRuntime.jsxs(Typography.Typography, Object.assign({ variant: 'body_small', color: 'secondary', className: 'qr-code-modal-view__title' }, { children: ["Connect wallet", ' ', jsxRuntime.jsx(Typography.Typography, Object.assign({ as: 'span', weight: '
|
|
64
|
+
return (jsxRuntime.jsxs("div", Object.assign({ className: 'qr-code-modal-view' }, { children: [jsxRuntime.jsxs(Typography.Typography, Object.assign({ variant: 'button_primary', color: 'primary', className: 'qr-code-modal-view__title' }, { children: ["Connect with ", newPrimaryWallet === null || newPrimaryWallet === void 0 ? void 0 : newPrimaryWallet.connector.name] })), jsxRuntime.jsxs(Typography.Typography, Object.assign({ variant: 'body_small', color: 'secondary', className: 'qr-code-modal-view__title' }, { children: ["Connect wallet", ' ', jsxRuntime.jsx(Typography.Typography, Object.assign({ as: 'span', weight: 'medium', color: 'primary' }, { children: shortenWalletAddress.shortenWalletAddress(newPrimaryWallet === null || newPrimaryWallet === void 0 ? void 0 : newPrimaryWallet.address, 4, 4) })), ' ', "to switch active account."] })), jsxRuntime.jsx("div", Object.assign({ className: 'qr-code-modal-view__container' }, { children: jsxRuntime.jsx("div", Object.assign({ className: 'qr-code-modal-view__wrapper' }, { children: qrcodeUri ? (jsxRuntime.jsx(QRCode.QRCode, { Icon: icon, accentColor: qrCodeColorsByTheme[typedTheme].accentColor, value: qrcodeUri, size: 175, logoSize: 40, walletName: walletConnectorCore.normalizeWalletName(walletName) })) : (
|
|
64
65
|
// this div exists to give the parent a child, so that the parent
|
|
65
66
|
// takes on its given width and height. the result is stable
|
|
66
67
|
// rendering of this component, without this there is a brief flash
|
|
@@ -38,6 +38,7 @@ import { TextButton } from '../../../../components/TextButton/TextButton.js';
|
|
|
38
38
|
import '../../../../components/Alert/Alert.js';
|
|
39
39
|
import '../../../../components/Popper/Popper/Popper.js';
|
|
40
40
|
import '../../../../components/Popper/PopperContext/PopperContext.js';
|
|
41
|
+
import '../../../../components/SendBalanceForm/SendBalanceForm.js';
|
|
41
42
|
|
|
42
43
|
const QrCodeModalView = ({ walletId }) => {
|
|
43
44
|
var _a;
|
|
@@ -56,7 +57,7 @@ const QrCodeModalView = ({ walletId }) => {
|
|
|
56
57
|
// can't use theme because it's string instead of 'light' | 'dark'
|
|
57
58
|
const typedTheme = theme.theme.name === 'light' ? 'light' : 'dark';
|
|
58
59
|
const icon = (jsx(WalletIcon, { walletName: walletName, style: { height: pixelToRem(24), width: pixelToRem(24) } }));
|
|
59
|
-
return (jsxs("div", Object.assign({ className: 'qr-code-modal-view' }, { children: [jsxs(Typography, Object.assign({ variant: 'button_primary', color: 'primary', className: 'qr-code-modal-view__title' }, { children: ["Connect with ", newPrimaryWallet === null || newPrimaryWallet === void 0 ? void 0 : newPrimaryWallet.connector.name] })), jsxs(Typography, Object.assign({ variant: 'body_small', color: 'secondary', className: 'qr-code-modal-view__title' }, { children: ["Connect wallet", ' ', jsx(Typography, Object.assign({ as: 'span', weight: '
|
|
60
|
+
return (jsxs("div", Object.assign({ className: 'qr-code-modal-view' }, { children: [jsxs(Typography, Object.assign({ variant: 'button_primary', color: 'primary', className: 'qr-code-modal-view__title' }, { children: ["Connect with ", newPrimaryWallet === null || newPrimaryWallet === void 0 ? void 0 : newPrimaryWallet.connector.name] })), jsxs(Typography, Object.assign({ variant: 'body_small', color: 'secondary', className: 'qr-code-modal-view__title' }, { children: ["Connect wallet", ' ', jsx(Typography, Object.assign({ as: 'span', weight: 'medium', color: 'primary' }, { children: shortenWalletAddress(newPrimaryWallet === null || newPrimaryWallet === void 0 ? void 0 : newPrimaryWallet.address, 4, 4) })), ' ', "to switch active account."] })), jsx("div", Object.assign({ className: 'qr-code-modal-view__container' }, { children: jsx("div", Object.assign({ className: 'qr-code-modal-view__wrapper' }, { children: qrcodeUri ? (jsx(QRCode, { Icon: icon, accentColor: qrCodeColorsByTheme[typedTheme].accentColor, value: qrcodeUri, size: 175, logoSize: 40, walletName: normalizeWalletName(walletName) })) : (
|
|
60
61
|
// this div exists to give the parent a child, so that the parent
|
|
61
62
|
// takes on its given width and height. the result is stable
|
|
62
63
|
// rendering of this component, without this there is a brief flash
|
|
@@ -37,6 +37,8 @@ require('../../../../components/IconButton/IconButton.cjs');
|
|
|
37
37
|
require('../../../../components/Alert/Alert.cjs');
|
|
38
38
|
require('../../../../components/Popper/Popper/Popper.cjs');
|
|
39
39
|
require('../../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
40
|
+
require('@dynamic-labs/wallet-book');
|
|
41
|
+
require('../../../../components/SendBalanceForm/SendBalanceForm.cjs');
|
|
40
42
|
|
|
41
43
|
const UnlinkWalletPopUp = ({ walletId }) => {
|
|
42
44
|
const { handleUnlinkWallet, eventsCallbacks, setSelectedWalletWithAction, user, } = useInternalDynamicContext.useInternalDynamicContext();
|