@getpara/react-sdk 2.0.0-alpha.7 → 2.0.0-alpha.71
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/README.md +21 -0
- package/dist/cosmos/actions/getCosmjsAminoSigner.d.ts +8 -0
- package/dist/cosmos/actions/getCosmjsAminoSigner.js +16 -0
- package/dist/cosmos/actions/getCosmjsProtoSigner.d.ts +8 -0
- package/dist/cosmos/actions/getCosmjsProtoSigner.js +16 -0
- package/dist/cosmos/actions/index.d.ts +2 -0
- package/dist/cosmos/actions/index.js +3 -0
- package/dist/cosmos/hooks/index.d.ts +2 -0
- package/dist/cosmos/hooks/index.js +3 -0
- package/dist/cosmos/hooks/useCosmjsAminoSigner.d.ts +11 -0
- package/dist/cosmos/hooks/useCosmjsAminoSigner.js +37 -0
- package/dist/cosmos/hooks/useCosmjsProtoSigner.d.ts +11 -0
- package/dist/cosmos/hooks/useCosmjsProtoSigner.js +37 -0
- package/dist/cosmos/index.d.ts +2 -0
- package/dist/cosmos/index.js +3 -0
- package/dist/css/modal.css +14 -1
- package/dist/evm/actions/getViemAccount.d.ts +22 -0
- package/dist/evm/actions/getViemAccount.js +20 -0
- package/dist/evm/actions/getViemClient.d.ts +17993 -0
- package/dist/evm/actions/getViemClient.js +25 -0
- package/dist/evm/actions/index.d.ts +2 -0
- package/dist/evm/actions/index.js +3 -0
- package/dist/evm/hooks/index.d.ts +2 -0
- package/dist/evm/hooks/index.js +3 -0
- package/dist/evm/hooks/useViemAccount.d.ts +26 -0
- package/dist/evm/hooks/useViemAccount.js +32 -0
- package/dist/evm/hooks/useViemClient.d.ts +17997 -0
- package/dist/evm/hooks/useViemClient.js +30 -0
- package/dist/evm/index.d.ts +2 -0
- package/dist/evm/index.js +3 -0
- package/dist/index.d.ts +3 -6
- package/dist/index.js +4 -9
- package/dist/provider/ParaProvider.d.ts +1 -2
- package/dist/provider/ParaProvider.js +17 -76
- package/dist/public/PPMori-Regular.woff2 +0 -0
- package/dist/public/PPMori-SemiBold.woff2 +0 -0
- package/dist/solana/actions/getSolanaSigner.d.ts +8 -0
- package/dist/solana/actions/getSolanaSigner.js +15 -0
- package/dist/solana/actions/index.d.ts +1 -0
- package/dist/solana/actions/index.js +2 -0
- package/dist/solana/hooks/index.d.ts +1 -0
- package/dist/solana/hooks/index.js +2 -0
- package/dist/solana/hooks/useSolanaSigner.d.ts +12 -0
- package/dist/solana/hooks/useSolanaSigner.js +32 -0
- package/dist/solana/index.d.ts +2 -0
- package/dist/solana/index.js +3 -0
- package/package.json +37 -51
- package/styles.css/package.json +1 -1
- package/dist/cli/cli.mjs +0 -35
- package/dist/modal/ParaModal.d.ts +0 -2
- package/dist/modal/ParaModal.js +0 -262
- package/dist/modal/components/Account/Account.d.ts +0 -5
- package/dist/modal/components/Account/Account.js +0 -139
- package/dist/modal/components/AddFunds/AddFunds.d.ts +0 -1
- package/dist/modal/components/AddFunds/AddFunds.js +0 -69
- package/dist/modal/components/AddFunds/AddFundsAsset.d.ts +0 -1
- package/dist/modal/components/AddFunds/AddFundsAsset.js +0 -125
- package/dist/modal/components/AddFunds/AddFundsAwaiting.d.ts +0 -1
- package/dist/modal/components/AddFunds/AddFundsAwaiting.js +0 -78
- package/dist/modal/components/AddFunds/AddFundsContext.d.ts +0 -31
- package/dist/modal/components/AddFunds/AddFundsContext.js +0 -160
- package/dist/modal/components/AddFunds/AddFundsDone.d.ts +0 -6
- package/dist/modal/components/AddFunds/AddFundsDone.js +0 -49
- package/dist/modal/components/AddFunds/AddFundsProvider.d.ts +0 -1
- package/dist/modal/components/AddFunds/AddFundsProvider.js +0 -109
- package/dist/modal/components/AddFunds/AddFundsReceive.d.ts +0 -1
- package/dist/modal/components/AddFunds/AddFundsReceive.js +0 -83
- package/dist/modal/components/AddFunds/AddFundsSettings.d.ts +0 -1
- package/dist/modal/components/AddFunds/AddFundsSettings.js +0 -237
- package/dist/modal/components/AddFunds/MoonPayEmbed.d.ts +0 -2
- package/dist/modal/components/AddFunds/MoonPayEmbed.js +0 -7
- package/dist/modal/components/AddFunds/common.d.ts +0 -19
- package/dist/modal/components/AddFunds/common.js +0 -24
- package/dist/modal/components/AddFunds/index.d.ts +0 -3
- package/dist/modal/components/AddFunds/index.js +0 -4
- package/dist/modal/components/AuthInput/AuthInput.d.ts +0 -6
- package/dist/modal/components/AuthInput/AuthInput.js +0 -262
- package/dist/modal/components/AuthInput/hooks/useDropdownPosition.d.ts +0 -7
- package/dist/modal/components/AuthInput/hooks/useDropdownPosition.js +0 -33
- package/dist/modal/components/AuthInput/phoneMasks.d.ts +0 -247
- package/dist/modal/components/AuthInput/phoneMasks.js +0 -253
- package/dist/modal/components/AuthMainStep/AuthMainStep.d.ts +0 -9
- package/dist/modal/components/AuthMainStep/AuthMainStep.js +0 -50
- package/dist/modal/components/AuthMainStep/AuthMainStepContent.d.ts +0 -9
- package/dist/modal/components/AuthMainStep/AuthMainStepContent.js +0 -157
- package/dist/modal/components/AuthOptions/AuthOptions.d.ts +0 -9
- package/dist/modal/components/AuthOptions/AuthOptions.js +0 -67
- package/dist/modal/components/AwaitingBiometricsStep/AwaitingBiometricsStep.d.ts +0 -1
- package/dist/modal/components/AwaitingBiometricsStep/AwaitingBiometricsStep.js +0 -18
- package/dist/modal/components/AwaitingOAuthStep/AwaitingOAuthStep.d.ts +0 -1
- package/dist/modal/components/AwaitingOAuthStep/AwaitingOAuthStep.js +0 -10
- package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.d.ts +0 -1
- package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.js +0 -18
- package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.d.ts +0 -5
- package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.js +0 -49
- package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.d.ts +0 -1
- package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.js +0 -63
- package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.d.ts +0 -1
- package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.js +0 -55
- package/dist/modal/components/Body/AnimatedHeightWrapper.d.ts +0 -6
- package/dist/modal/components/Body/AnimatedHeightWrapper.js +0 -29
- package/dist/modal/components/Body/Body.d.ts +0 -11
- package/dist/modal/components/Body/Body.js +0 -327
- package/dist/modal/components/ChainSwitch/ChainSwitch.d.ts +0 -1
- package/dist/modal/components/ChainSwitch/ChainSwitch.js +0 -95
- package/dist/modal/components/ChainSwitch/config.d.ts +0 -7
- package/dist/modal/components/ChainSwitch/config.js +0 -17
- package/dist/modal/components/Controls/Controls.d.ts +0 -5
- package/dist/modal/components/Controls/Controls.js +0 -77
- package/dist/modal/components/Controls/Selects.d.ts +0 -2
- package/dist/modal/components/Controls/Selects.js +0 -189
- package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.d.ts +0 -1
- package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.js +0 -144
- package/dist/modal/components/ExternalWalletStep/config.d.ts +0 -7
- package/dist/modal/components/ExternalWalletStep/config.js +0 -17
- package/dist/modal/components/ExternalWalletVerificationStep/ExternalWalletVerificationStep.d.ts +0 -1
- package/dist/modal/components/ExternalWalletVerificationStep/ExternalWalletVerificationStep.js +0 -34
- package/dist/modal/components/ExternalWallets/ExternalWallets.d.ts +0 -1
- package/dist/modal/components/ExternalWallets/ExternalWallets.js +0 -173
- package/dist/modal/components/Footer/Footer.d.ts +0 -1
- package/dist/modal/components/Footer/Footer.js +0 -95
- package/dist/modal/components/Header/Header.d.ts +0 -1
- package/dist/modal/components/Header/Header.js +0 -43
- package/dist/modal/components/Header/hooks/useStepTitle.d.ts +0 -3
- package/dist/modal/components/Header/hooks/useStepTitle.js +0 -54
- package/dist/modal/components/Hero/Hero.d.ts +0 -1
- package/dist/modal/components/Hero/Hero.js +0 -116
- package/dist/modal/components/IFrameStep/IFrameStep.d.ts +0 -1
- package/dist/modal/components/IFrameStep/IFrameStep.js +0 -59
- package/dist/modal/components/LoginDoneStep/LoginDoneStep.d.ts +0 -1
- package/dist/modal/components/LoginDoneStep/LoginDoneStep.js +0 -31
- package/dist/modal/components/ModalContent/ModalContent.d.ts +0 -10
- package/dist/modal/components/ModalContent/ModalContent.js +0 -95
- package/dist/modal/components/OAuth/FarcasterOAuthStep.d.ts +0 -2
- package/dist/modal/components/OAuth/FarcasterOAuthStep.js +0 -27
- package/dist/modal/components/OAuth/OAuth.d.ts +0 -6
- package/dist/modal/components/OAuth/OAuth.js +0 -79
- package/dist/modal/components/OAuth/TelegramOAuthStep.d.ts +0 -1
- package/dist/modal/components/OAuth/TelegramOAuthStep.js +0 -90
- package/dist/modal/components/OnRampComponents/AddingFunds.d.ts +0 -1
- package/dist/modal/components/OnRampComponents/AddingFunds.js +0 -23
- package/dist/modal/components/OnRampComponents/OnRampProviderButton.d.ts +0 -9
- package/dist/modal/components/OnRampComponents/OnRampProviderButton.js +0 -77
- package/dist/modal/components/RecoverySecretStep/RecoverySecretStep.d.ts +0 -6
- package/dist/modal/components/RecoverySecretStep/RecoverySecretStep.js +0 -107
- package/dist/modal/components/Setup2FAStep/Setup2FAStep.d.ts +0 -5
- package/dist/modal/components/Setup2FAStep/Setup2FAStep.js +0 -132
- package/dist/modal/components/StripeComponents/StripeComponents.d.ts +0 -16
- package/dist/modal/components/StripeComponents/StripeComponents.js +0 -88
- package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.d.ts +0 -5
- package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.js +0 -27
- package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.d.ts +0 -1
- package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.js +0 -143
- package/dist/modal/components/Waiting/Waiting.d.ts +0 -6
- package/dist/modal/components/Waiting/Waiting.js +0 -17
- package/dist/modal/components/WalletCard/PartnerIcon.d.ts +0 -6
- package/dist/modal/components/WalletCard/PartnerIcon.js +0 -34
- package/dist/modal/components/WalletCard/WalletCard.d.ts +0 -18
- package/dist/modal/components/WalletCard/WalletCard.js +0 -128
- package/dist/modal/components/WalletCreationDoneStep/WalletCreationDoneStep.d.ts +0 -6
- package/dist/modal/components/WalletCreationDoneStep/WalletCreationDoneStep.js +0 -73
- package/dist/modal/components/common.d.ts +0 -42
- package/dist/modal/components/common.js +0 -175
- package/dist/modal/components/index.d.ts +0 -1
- package/dist/modal/components/index.js +0 -2
- package/dist/modal/constants/constants.d.ts +0 -39
- package/dist/modal/constants/constants.js +0 -138
- package/dist/modal/constants/defaults.d.ts +0 -5
- package/dist/modal/constants/defaults.js +0 -10
- package/dist/modal/constants/oAuthLogos.d.ts +0 -8
- package/dist/modal/constants/oAuthLogos.js +0 -24
- package/dist/modal/hooks/useGoBack.d.ts +0 -1
- package/dist/modal/hooks/useGoBack.js +0 -43
- package/dist/modal/index.d.ts +0 -8
- package/dist/modal/index.js +0 -29
- package/dist/modal/stores/index.d.ts +0 -1
- package/dist/modal/stores/index.js +0 -2
- package/dist/modal/stores/modal/actions.d.ts +0 -3
- package/dist/modal/stores/modal/actions.js +0 -133
- package/dist/modal/stores/modal/useModalStore.d.ts +0 -102
- package/dist/modal/stores/modal/useModalStore.js +0 -68
- package/dist/modal/types/commonTypes.d.ts +0 -6
- package/dist/modal/types/commonTypes.js +0 -1
- package/dist/modal/types/externalWallets.d.ts +0 -33
- package/dist/modal/types/externalWallets.js +0 -32
- package/dist/modal/types/modalProps.d.ts +0 -124
- package/dist/modal/types/modalProps.js +0 -12
- package/dist/modal/utils/authInputHelpers.d.ts +0 -7
- package/dist/modal/utils/authInputHelpers.js +0 -38
- package/dist/modal/utils/authLayoutHelpers.d.ts +0 -3
- package/dist/modal/utils/authLayoutHelpers.js +0 -8
- package/dist/modal/utils/countryCodes.d.ts +0 -8
- package/dist/modal/utils/countryCodes.js +0 -45
- package/dist/modal/utils/getMailtoLink.d.ts +0 -1
- package/dist/modal/utils/getMailtoLink.js +0 -10
- package/dist/modal/utils/getTileButtonFlex.d.ts +0 -1
- package/dist/modal/utils/getTileButtonFlex.js +0 -20
- package/dist/modal/utils/isPasskeySupported.d.ts +0 -1
- package/dist/modal/utils/isPasskeySupported.js +0 -15
- package/dist/modal/utils/openPopup.d.ts +0 -6
- package/dist/modal/utils/openPopup.js +0 -60
- package/dist/modal/utils/routeMobileExternalWallet.d.ts +0 -1
- package/dist/modal/utils/routeMobileExternalWallet.js +0 -31
- package/dist/modal/utils/steps.d.ts +0 -120
- package/dist/modal/utils/steps.js +0 -247
- package/dist/modal/utils/stringFormatters.d.ts +0 -5
- package/dist/modal/utils/stringFormatters.js +0 -19
- package/dist/modal/utils/validateOnRampConfig.d.ts +0 -5
- package/dist/modal/utils/validateOnRampConfig.js +0 -32
- package/dist/provider/actions/getAccount.d.ts +0 -26
- package/dist/provider/actions/getAccount.js +0 -51
- package/dist/provider/actions/getWallet.d.ts +0 -5
- package/dist/provider/actions/getWallet.js +0 -14
- package/dist/provider/actions/index.d.ts +0 -27
- package/dist/provider/actions/index.js +0 -59
- package/dist/provider/actions/utils.d.ts +0 -3
- package/dist/provider/actions/utils.js +0 -15
- package/dist/provider/components/CosmosWalletWrapper.d.ts +0 -11
- package/dist/provider/components/CosmosWalletWrapper.js +0 -34
- package/dist/provider/components/EvmWalletWrapper.d.ts +0 -12
- package/dist/provider/components/EvmWalletWrapper.js +0 -34
- package/dist/provider/components/ExternalWalletWrapper.d.ts +0 -8
- package/dist/provider/components/ExternalWalletWrapper.js +0 -139
- package/dist/provider/components/SolanaWalletWrapper.d.ts +0 -9
- package/dist/provider/components/SolanaWalletWrapper.js +0 -36
- package/dist/provider/external/getParaCosmosConnector.d.ts +0 -7
- package/dist/provider/external/getParaCosmosConnector.js +0 -22
- package/dist/provider/external/getParaEvmConnector.d.ts +0 -7
- package/dist/provider/external/getParaEvmConnector.js +0 -22
- package/dist/provider/external/getParaSolanaConnector.d.ts +0 -7
- package/dist/provider/external/getParaSolanaConnector.js +0 -22
- package/dist/provider/external/stubs/CosmosExternalWalletContextStub.d.ts +0 -12
- package/dist/provider/external/stubs/CosmosExternalWalletContextStub.js +0 -18
- package/dist/provider/external/stubs/EvmExternalWalletContextStub.d.ts +0 -3
- package/dist/provider/external/stubs/EvmExternalWalletContextStub.js +0 -21
- package/dist/provider/external/stubs/SolanaExternalWalletContextStub.d.ts +0 -8
- package/dist/provider/external/stubs/SolanaExternalWalletContextStub.js +0 -14
- package/dist/provider/hooks/index.d.ts +0 -3
- package/dist/provider/hooks/index.js +0 -4
- package/dist/provider/hooks/mutations/index.d.ts +0 -26
- package/dist/provider/hooks/mutations/index.js +0 -61
- package/dist/provider/hooks/mutations/utils.d.ts +0 -4
- package/dist/provider/hooks/mutations/utils.js +0 -22
- package/dist/provider/hooks/queries/index.d.ts +0 -3
- package/dist/provider/hooks/queries/index.js +0 -10
- package/dist/provider/hooks/queries/useAccount.d.ts +0 -5
- package/dist/provider/hooks/queries/useAccount.js +0 -21
- package/dist/provider/hooks/queries/useWallet.d.ts +0 -5
- package/dist/provider/hooks/queries/useWallet.js +0 -22
- package/dist/provider/hooks/queries/useWalletBalance.d.ts +0 -6
- package/dist/provider/hooks/queries/useWalletBalance.js +0 -55
- package/dist/provider/hooks/utils/index.d.ts +0 -3
- package/dist/provider/hooks/utils/index.js +0 -10
- package/dist/provider/hooks/utils/useAutoSessionKeepAlive.d.ts +0 -3
- package/dist/provider/hooks/utils/useAutoSessionKeepAlive.js +0 -74
- package/dist/provider/hooks/utils/useClient.d.ts +0 -5
- package/dist/provider/hooks/utils/useClient.js +0 -10
- package/dist/provider/hooks/utils/useEventListeners.d.ts +0 -2
- package/dist/provider/hooks/utils/useEventListeners.js +0 -147
- package/dist/provider/hooks/utils/useInternalClient.d.ts +0 -5
- package/dist/provider/hooks/utils/useInternalClient.js +0 -10
- package/dist/provider/hooks/utils/useModal.d.ts +0 -8
- package/dist/provider/hooks/utils/useModal.js +0 -17
- package/dist/provider/hooks/utils/useWalletState.d.ts +0 -15
- package/dist/provider/hooks/utils/useWalletState.js +0 -48
- package/dist/provider/index.d.ts +0 -4
- package/dist/provider/index.js +0 -9
- package/dist/provider/providers/AuthProvider.d.ts +0 -35
- package/dist/provider/providers/AuthProvider.js +0 -498
- package/dist/provider/providers/CosmosExternalWalletProvider.d.ts +0 -7
- package/dist/provider/providers/CosmosExternalWalletProvider.js +0 -66
- package/dist/provider/providers/EvmExternalWalletProvider.d.ts +0 -7
- package/dist/provider/providers/EvmExternalWalletProvider.js +0 -74
- package/dist/provider/providers/ExternalWalletProvider.d.ts +0 -76
- package/dist/provider/providers/ExternalWalletProvider.js +0 -428
- package/dist/provider/providers/SolanaExternalWalletProvider.d.ts +0 -7
- package/dist/provider/providers/SolanaExternalWalletProvider.js +0 -66
- package/dist/provider/stores/getters.d.ts +0 -4
- package/dist/provider/stores/getters.js +0 -13
- package/dist/provider/stores/setters.d.ts +0 -1
- package/dist/provider/stores/setters.js +0 -7
- package/dist/provider/stores/slices/client.d.ts +0 -3
- package/dist/provider/stores/slices/client.js +0 -9
- package/dist/provider/stores/slices/config.d.ts +0 -3
- package/dist/provider/stores/slices/config.js +0 -9
- package/dist/provider/stores/slices/externalWallets.d.ts +0 -3
- package/dist/provider/stores/slices/externalWallets.js +0 -40
- package/dist/provider/stores/slices/index.d.ts +0 -4
- package/dist/provider/stores/slices/index.js +0 -5
- package/dist/provider/stores/slices/modal.d.ts +0 -3
- package/dist/provider/stores/slices/modal.js +0 -16
- package/dist/provider/stores/slices/wallet.d.ts +0 -3
- package/dist/provider/stores/slices/wallet.js +0 -13
- package/dist/provider/stores/types.d.ts +0 -64
- package/dist/provider/stores/types.js +0 -1
- package/dist/provider/stores/useStore.d.ts +0 -17
- package/dist/provider/stores/useStore.js +0 -28
- package/dist/provider/types/externalWalletProviders.d.ts +0 -12
- package/dist/provider/types/externalWalletProviders.js +0 -1
- package/dist/provider/types/provider.d.ts +0 -147
- package/dist/provider/types/provider.js +0 -1
- package/dist/provider/types/query.d.ts +0 -3
- package/dist/provider/types/query.js +0 -1
- package/dist/provider/types/utils.d.ts +0 -22
- package/dist/provider/types/utils.js +0 -1
- package/dist/provider/utils/constants.d.ts +0 -5
- package/dist/provider/utils/constants.js +0 -10
- package/dist/provider/utils/paraConfigTypeGuards.d.ts +0 -7
- package/dist/provider/utils/paraConfigTypeGuards.js +0 -13
- package/dist/provider/utils/renameMutations.d.ts +0 -5
- package/dist/provider/utils/renameMutations.js +0 -18
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import "../../../chunk-MMUBH76A.js";
|
|
3
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
import { styled } from "styled-components";
|
|
5
|
-
import { CpslButton, CpslIcon, CpslText } from "@getpara/react-components";
|
|
6
|
-
import { useModalStore } from "../../stores/index.js";
|
|
7
|
-
import { PARA_CONNECT, PARA_TERMS_AND_CONDITIONS } from "../../constants/constants.js";
|
|
8
|
-
import { useMemo } from "react";
|
|
9
|
-
import { getStepHasFooter } from "../../utils/steps.js";
|
|
10
|
-
import { useAccount } from "../../../provider/index.js";
|
|
11
|
-
const Footer = () => {
|
|
12
|
-
const { data: account } = useAccount();
|
|
13
|
-
const currentStep = useModalStore((state) => state.step);
|
|
14
|
-
const accountFooter = (account == null ? void 0 : account.isConnected) && !account.isGuestMode;
|
|
15
|
-
const showFooter = accountFooter || getStepHasFooter(currentStep);
|
|
16
|
-
const Content = useMemo(() => {
|
|
17
|
-
if (accountFooter) {
|
|
18
|
-
return /* @__PURE__ */ jsxs(ConnectContainer, { children: [
|
|
19
|
-
/* @__PURE__ */ jsxs(ConnectText, { variant: "bodyS", color: "secondary", weight: "medium", children: [
|
|
20
|
-
"Access all your wallet\u2019s features at",
|
|
21
|
-
" ",
|
|
22
|
-
/* @__PURE__ */ jsx("a", { href: PARA_CONNECT, target: "blank", children: /* @__PURE__ */ jsx(ClickableText, { variant: "bodyS", weight: "medium", children: "Para Connect" }) })
|
|
23
|
-
] }),
|
|
24
|
-
/* @__PURE__ */ jsx(CpslButton, { as: "a", href: PARA_CONNECT, target: "blank", variant: "ghost", children: /* @__PURE__ */ jsx(RightChevron, { icon: "chevronUp" }) })
|
|
25
|
-
] });
|
|
26
|
-
}
|
|
27
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
28
|
-
/* @__PURE__ */ jsxs(InlineText, { variant: "body2XS", color: "secondary", weight: "medium", children: [
|
|
29
|
-
"By logging in you agree to our",
|
|
30
|
-
" ",
|
|
31
|
-
/* @__PURE__ */ jsx("a", { href: PARA_TERMS_AND_CONDITIONS, target: "blank", children: /* @__PURE__ */ jsx(ClickableText, { variant: "body2XS", weight: "medium", children: "Terms & Conditions" }) })
|
|
32
|
-
] }),
|
|
33
|
-
/* @__PURE__ */ jsxs(PoweredByContainer, { children: [
|
|
34
|
-
/* @__PURE__ */ jsx(InlineText, { variant: "bodyS", color: "secondary", weight: "medium", children: "Powered by" }),
|
|
35
|
-
/* @__PURE__ */ jsx(ParaLogo, { icon: "para" })
|
|
36
|
-
] })
|
|
37
|
-
] });
|
|
38
|
-
}, [account]);
|
|
39
|
-
if (!showFooter) {
|
|
40
|
-
return null;
|
|
41
|
-
}
|
|
42
|
-
return /* @__PURE__ */ jsx(FooterContainer, { slot: "footer", children: /* @__PURE__ */ jsx(FooterContentContainer, { children: Content }) });
|
|
43
|
-
};
|
|
44
|
-
const FooterContainer = styled.div`
|
|
45
|
-
display: flex;
|
|
46
|
-
flex-direction: column;
|
|
47
|
-
align-items: center;
|
|
48
|
-
gap: 16px;
|
|
49
|
-
padding: 8px 0px;
|
|
50
|
-
`;
|
|
51
|
-
const FooterContentContainer = styled.div`
|
|
52
|
-
display: flex;
|
|
53
|
-
flex-direction: column;
|
|
54
|
-
align-items: center;
|
|
55
|
-
gap: 8px;
|
|
56
|
-
`;
|
|
57
|
-
const PoweredByContainer = styled.div`
|
|
58
|
-
display: flex;
|
|
59
|
-
gap: 5px;
|
|
60
|
-
align-items: center;
|
|
61
|
-
justify-content: center;
|
|
62
|
-
`;
|
|
63
|
-
const ConnectContainer = styled.div`
|
|
64
|
-
display: flex;
|
|
65
|
-
gap: 8px;
|
|
66
|
-
align-items: center;
|
|
67
|
-
justify-content: center;
|
|
68
|
-
`;
|
|
69
|
-
const RightChevron = styled(CpslIcon)`
|
|
70
|
-
transform: rotate(90deg);
|
|
71
|
-
|
|
72
|
-
/* --icon-color: var(--cpsl-color-text-tertiary); */
|
|
73
|
-
--height: 24px;
|
|
74
|
-
--width: 24px;
|
|
75
|
-
`;
|
|
76
|
-
const InlineText = styled(CpslText)`
|
|
77
|
-
text-align: center;
|
|
78
|
-
display: inline-block;
|
|
79
|
-
`;
|
|
80
|
-
const ConnectText = styled(InlineText)`
|
|
81
|
-
line-height: 20px;
|
|
82
|
-
`;
|
|
83
|
-
const ClickableText = styled(InlineText)`
|
|
84
|
-
cursor: pointer;
|
|
85
|
-
display: inline-block;
|
|
86
|
-
`;
|
|
87
|
-
const ParaLogo = styled(CpslIcon)`
|
|
88
|
-
display: inline-block;
|
|
89
|
-
--icon-color: var(--cpsl-color-text-secondary);
|
|
90
|
-
--width: 49px;
|
|
91
|
-
--height: auto;
|
|
92
|
-
`;
|
|
93
|
-
export {
|
|
94
|
-
Footer
|
|
95
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const Header: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import "../../../chunk-MMUBH76A.js";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
import { styled } from "styled-components";
|
|
5
|
-
import { useStepTitle } from "./hooks/useStepTitle.js";
|
|
6
|
-
import { CenteredText } from "../common.js";
|
|
7
|
-
import { AnimatePresence, motion } from "framer-motion";
|
|
8
|
-
import { useModalStore } from "../../stores/index.js";
|
|
9
|
-
import { BODY_MOTION_VARIANTS, BODY_TRANSITION } from "../../constants/constants.js";
|
|
10
|
-
const Header = () => {
|
|
11
|
-
const { title } = useStepTitle();
|
|
12
|
-
const stepDirection = useModalStore((state) => state.stepDirection);
|
|
13
|
-
const currentStep = useModalStore((state) => state.step);
|
|
14
|
-
return /* @__PURE__ */ jsx(AnimatePresence, { mode: "popLayout", initial: false, custom: stepDirection, children: /* @__PURE__ */ jsx(
|
|
15
|
-
Container,
|
|
16
|
-
{
|
|
17
|
-
custom: stepDirection,
|
|
18
|
-
variants: BODY_MOTION_VARIANTS,
|
|
19
|
-
initial: "enter",
|
|
20
|
-
animate: "center",
|
|
21
|
-
exit: "exit",
|
|
22
|
-
transition: BODY_TRANSITION,
|
|
23
|
-
slot: "header",
|
|
24
|
-
id: "header",
|
|
25
|
-
children: /* @__PURE__ */ jsx(CenteredText, { weight: "semiBold", color: "secondary", children: title })
|
|
26
|
-
},
|
|
27
|
-
["ADD_FUNDS_BUY", "ADD_FUNDS_RECEIVE", "ADD_FUNDS_WITHDRAW"].includes(currentStep) ? "ADD_FUNDS" : currentStep
|
|
28
|
-
) });
|
|
29
|
-
};
|
|
30
|
-
const Container = styled(motion.div)`
|
|
31
|
-
position: absolute;
|
|
32
|
-
top: 16px;
|
|
33
|
-
width: 100%;
|
|
34
|
-
z-index: 2;
|
|
35
|
-
display: flex;
|
|
36
|
-
align-items: center;
|
|
37
|
-
justify-content: space-between;
|
|
38
|
-
gap: 8px;
|
|
39
|
-
flex-wrap: wrap;
|
|
40
|
-
`;
|
|
41
|
-
export {
|
|
42
|
-
Header
|
|
43
|
-
};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import "../../../../chunk-MMUBH76A.js";
|
|
3
|
-
import { useMemo } from "react";
|
|
4
|
-
import { useModalStore } from "../../../stores/modal/useModalStore.js";
|
|
5
|
-
import { ModalStep } from "../../../utils/steps.js";
|
|
6
|
-
import { useExternalWallets } from "../../../../provider/providers/ExternalWalletProvider.js";
|
|
7
|
-
import { useStore } from "../../../../provider/stores/useStore.js";
|
|
8
|
-
const useStepTitle = () => {
|
|
9
|
-
const hideWallets = useStore((state) => {
|
|
10
|
-
var _a;
|
|
11
|
-
return (_a = state.modalConfig) == null ? void 0 : _a.hideWallets;
|
|
12
|
-
});
|
|
13
|
-
const isLogin = useModalStore((state) => state.isLogin());
|
|
14
|
-
const currentStep = useModalStore((state) => state.step);
|
|
15
|
-
const { chainId } = useExternalWallets();
|
|
16
|
-
const titles = useMemo(
|
|
17
|
-
() => ({
|
|
18
|
-
[ModalStep.AUTH_MAIN]: "",
|
|
19
|
-
[ModalStep.AUTH_MORE]: "Sign Up or Log In",
|
|
20
|
-
[ModalStep.AUTH_GUEST_SIGNUP]: "Complete Account Setup",
|
|
21
|
-
[ModalStep.EX_WALLET_MORE]: "Connect Wallet",
|
|
22
|
-
[ModalStep.VERIFICATIONS]: "Sign Up",
|
|
23
|
-
[ModalStep.AWAITING_OAUTH]: isLogin ? "Login" : "Sign Up",
|
|
24
|
-
[ModalStep.FARCASTER_OAUTH]: isLogin ? "Login" : "Sign Up",
|
|
25
|
-
[ModalStep.BIOMETRIC_CREATION]: "Sign Up",
|
|
26
|
-
[ModalStep.PASSWORD_CREATION]: "Sign Up",
|
|
27
|
-
[ModalStep.AWAITING_BIOMETRIC_CREATION]: "Sign Up",
|
|
28
|
-
[ModalStep.AWAITING_WALLET_CREATION]: isLogin ? "Login" : "Sign Up",
|
|
29
|
-
[ModalStep.AWAITING_PASSWORD_CREATION]: "Sign Up",
|
|
30
|
-
[ModalStep.WALLET_CREATION_DONE]: hideWallets ? "Account Created" : "Wallet Created",
|
|
31
|
-
[ModalStep.SECRET]: isLogin ? "Login" : "Sign Up",
|
|
32
|
-
[ModalStep.BIOMETRIC_LOGIN]: "Login",
|
|
33
|
-
[ModalStep.AWAITING_PASSWORD_LOGIN]: "Login",
|
|
34
|
-
[ModalStep.AWAITING_BIOMETRIC_LOGIN]: "Login",
|
|
35
|
-
[ModalStep.LOGIN_DONE]: "",
|
|
36
|
-
[ModalStep.SETUP_2FA]: "2FA",
|
|
37
|
-
[ModalStep.VERIFY_2FA]: "2FA",
|
|
38
|
-
[ModalStep.TWO_FACTOR_DONE]: "2FA",
|
|
39
|
-
[ModalStep.ADD_FUNDS_BUY]: "",
|
|
40
|
-
[ModalStep.ADD_FUNDS_RECEIVE]: "",
|
|
41
|
-
[ModalStep.ADD_FUNDS_WITHDRAW]: "",
|
|
42
|
-
[ModalStep.ADD_FUNDS_AWAITING]: "",
|
|
43
|
-
[ModalStep.ADD_FUNDS_SUCCESS]: "",
|
|
44
|
-
[ModalStep.ADD_FUNDS_FAILURE]: "",
|
|
45
|
-
[ModalStep.ACCOUNT_MAIN]: "",
|
|
46
|
-
[ModalStep.CHAIN_SWITCH]: ""
|
|
47
|
-
}),
|
|
48
|
-
[isLogin, chainId, hideWallets]
|
|
49
|
-
);
|
|
50
|
-
return { title: titles[currentStep] };
|
|
51
|
-
};
|
|
52
|
-
export {
|
|
53
|
-
useStepTitle
|
|
54
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const Hero: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import "../../../chunk-MMUBH76A.js";
|
|
3
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
import { CpslHero, CpslIcon, CpslIdenticon } from "@getpara/react-components";
|
|
5
|
-
import styled from "styled-components";
|
|
6
|
-
import { ModalStep } from "../../utils/steps.js";
|
|
7
|
-
import { useModalStore } from "../../stores/index.js";
|
|
8
|
-
import { NETWORK_NOT_SUPPORTED_ERROR } from "../../constants/constants.js";
|
|
9
|
-
import { useEffect, useState } from "react";
|
|
10
|
-
import { isMobile } from "@getpara/web-sdk";
|
|
11
|
-
import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
|
|
12
|
-
import { useExternalWallets } from "../../../provider/providers/ExternalWalletProvider.js";
|
|
13
|
-
import { useWallet } from "../../../provider/index.js";
|
|
14
|
-
const getStepConfig = ({
|
|
15
|
-
externalWalletError
|
|
16
|
-
}) => {
|
|
17
|
-
var _a;
|
|
18
|
-
return {
|
|
19
|
-
[ModalStep.EX_WALLET_SELECTED]: {
|
|
20
|
-
variant: "externalWalletConnection",
|
|
21
|
-
topOffset: 40,
|
|
22
|
-
spacerHeight: 158,
|
|
23
|
-
hideFadeOut: true
|
|
24
|
-
},
|
|
25
|
-
[ModalStep.CHAIN_SWITCH]: {
|
|
26
|
-
variant: ((_a = externalWalletError == null ? void 0 : externalWalletError[0]) == null ? void 0 : _a.toLowerCase()) === NETWORK_NOT_SUPPORTED_ERROR ? "failed" : "externalWalletConnection",
|
|
27
|
-
topOffset: 20,
|
|
28
|
-
spacerHeight: 158,
|
|
29
|
-
hideFadeOut: true
|
|
30
|
-
},
|
|
31
|
-
[ModalStep.FARCASTER_OAUTH]: {
|
|
32
|
-
variant: "externalWalletConnection",
|
|
33
|
-
topOffset: 40,
|
|
34
|
-
spacerHeight: 158,
|
|
35
|
-
hideFadeOut: true
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
const Hero = () => {
|
|
40
|
-
const para = useInternalClient();
|
|
41
|
-
const { wallet: connector, walletDisplayHelpers, avatar } = useExternalWallets();
|
|
42
|
-
const step = useModalStore((state) => state.step);
|
|
43
|
-
const externalWalletError = useModalStore((state) => state.externalWalletError);
|
|
44
|
-
const { data: activeWallet } = useWallet();
|
|
45
|
-
const [currentStep, setCurrentStep] = useState(step);
|
|
46
|
-
const stepConfig = getStepConfig({
|
|
47
|
-
externalWalletError
|
|
48
|
-
})[currentStep];
|
|
49
|
-
useEffect(() => {
|
|
50
|
-
const prevStepConfig = getStepConfig({
|
|
51
|
-
externalWalletError
|
|
52
|
-
})[currentStep];
|
|
53
|
-
const newStepConfig = getStepConfig({
|
|
54
|
-
externalWalletError
|
|
55
|
-
})[step];
|
|
56
|
-
const delay = newStepConfig && prevStepConfig ? 0 : newStepConfig && !prevStepConfig ? 0 : 200;
|
|
57
|
-
setTimeout(() => {
|
|
58
|
-
setCurrentStep(step);
|
|
59
|
-
}, delay);
|
|
60
|
-
}, [step]);
|
|
61
|
-
const isExternalStep = currentStep === ModalStep.EX_WALLET_SELECTED;
|
|
62
|
-
const isChainSwitchStep = currentStep === ModalStep.CHAIN_SWITCH;
|
|
63
|
-
const isAccountStep = currentStep === ModalStep.ACCOUNT_MAIN;
|
|
64
|
-
const isFarcasterStep = currentStep === ModalStep.FARCASTER_OAUTH;
|
|
65
|
-
const { showExtension, isCosmosMobileWallet } = walletDisplayHelpers;
|
|
66
|
-
const shouldHide = !stepConfig || !isMobile() && isExternalStep && !showExtension || !isMobile() && isChainSwitchStep && isCosmosMobileWallet || !isMobile() && isFarcasterStep;
|
|
67
|
-
const { variant, topOffset, spacerHeight, hideFadeOut } = stepConfig != null ? stepConfig : {};
|
|
68
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
69
|
-
/* @__PURE__ */ jsx(Container, { $top: -45 + (topOffset != null ? topOffset : 0), children: shouldHide ? null : /* @__PURE__ */ jsxs(StyledHero, { $isAccount: isAccountStep, hideFadeOut, variant, height: 480, withDefaultTheme: true, children: [
|
|
70
|
-
(isExternalStep || isChainSwitchStep) && /* @__PURE__ */ jsx(WalletLogo, { slot: "connectionLeft", src: connector == null ? void 0 : connector.iconUrl }),
|
|
71
|
-
isFarcasterStep && /* @__PURE__ */ jsx(WalletLogo, { slot: "connectionLeft", icon: "farcasterBrand" }),
|
|
72
|
-
isAccountStep && (avatar ? /* @__PURE__ */ jsx(Avatar, { slot: "image", src: avatar }) : activeWallet ? /* @__PURE__ */ jsx(IconAvatar, { slot: "image", size: "100%", hash: para.getIdenticonHash(activeWallet.id, activeWallet.type) }) : null)
|
|
73
|
-
] }) }),
|
|
74
|
-
!shouldHide && /* @__PURE__ */ jsx(Spacer, { $height: spacerHeight != null ? spacerHeight : 0 })
|
|
75
|
-
] });
|
|
76
|
-
};
|
|
77
|
-
const Container = styled.div`
|
|
78
|
-
display: flex;
|
|
79
|
-
position: absolute;
|
|
80
|
-
justify-content: center;
|
|
81
|
-
align-items: center;
|
|
82
|
-
width: 100%;
|
|
83
|
-
|
|
84
|
-
top: ${({ $top }) => `${$top}px`};
|
|
85
|
-
`;
|
|
86
|
-
const Spacer = styled.div`
|
|
87
|
-
height: ${({ $height }) => `${$height}px`};
|
|
88
|
-
`;
|
|
89
|
-
const WalletLogo = styled(CpslIcon)`
|
|
90
|
-
--height: 60px;
|
|
91
|
-
--width: 60px;
|
|
92
|
-
`;
|
|
93
|
-
const Avatar = styled.img`
|
|
94
|
-
width: 100%;
|
|
95
|
-
height: 100%;
|
|
96
|
-
object-fit: contain;
|
|
97
|
-
`;
|
|
98
|
-
const IconAvatar = styled(CpslIdenticon)`
|
|
99
|
-
border-radius: 1000px;
|
|
100
|
-
`;
|
|
101
|
-
const StyledHero = styled(CpslHero)`
|
|
102
|
-
${({ $isAccount }) => $isAccount && `
|
|
103
|
-
--ring-3-size: 560px;
|
|
104
|
-
--ring-2-size: 402px;
|
|
105
|
-
--ring-1-size: 228px;
|
|
106
|
-
--ring-0-size: 104px;
|
|
107
|
-
|
|
108
|
-
--default-theme-ring-3-opacity: 0.02;
|
|
109
|
-
--default-theme-ring-2-opacity: 0.04;
|
|
110
|
-
--default-theme-ring-1-opacity: 0.06;
|
|
111
|
-
--default-theme-ring-0-opacity: 0.1;
|
|
112
|
-
`}
|
|
113
|
-
`;
|
|
114
|
-
export {
|
|
115
|
-
Hero
|
|
116
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const IFrameStep: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import "../../../chunk-MMUBH76A.js";
|
|
3
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
import { useModalStore } from "../../stores/index.js";
|
|
5
|
-
import { IFrameSteps } from "../../utils/steps.js";
|
|
6
|
-
import styled from "styled-components";
|
|
7
|
-
import { SpinnerContainer } from "@getpara/react-common";
|
|
8
|
-
import { CpslSpinner } from "@getpara/react-components";
|
|
9
|
-
import { MOBILE_SIZE } from "../../constants/constants.js";
|
|
10
|
-
import { useStore } from "../../../provider/stores/useStore.js";
|
|
11
|
-
const IFrameStep = () => {
|
|
12
|
-
const iFrameUrl = useModalStore((state) => state.iFrameUrl);
|
|
13
|
-
const setIsReady = useModalStore((state) => state.setIsIFrameReady);
|
|
14
|
-
const isReady = useModalStore((state) => state.isIFrameReady);
|
|
15
|
-
const currentStep = useModalStore((state) => state.step);
|
|
16
|
-
const embeddedModal = useStore((state) => {
|
|
17
|
-
var _a;
|
|
18
|
-
return (_a = state.modalConfig) == null ? void 0 : _a.embeddedModal;
|
|
19
|
-
});
|
|
20
|
-
return /* @__PURE__ */ jsxs(OuterContainer, { $isVisible: IFrameSteps.includes(currentStep), $embeddedModal: !!embeddedModal, children: [
|
|
21
|
-
/* @__PURE__ */ jsx(Container, { $isReady: !!isReady, children: /* @__PURE__ */ jsx(
|
|
22
|
-
"iframe",
|
|
23
|
-
{
|
|
24
|
-
src: iFrameUrl,
|
|
25
|
-
onLoad: () => {
|
|
26
|
-
setIsReady(true);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
) }),
|
|
30
|
-
!isReady && /* @__PURE__ */ jsx(SpinnerContainer, { style: { width: "100%", height: "100%", flex: 1 }, children: /* @__PURE__ */ jsx(CpslSpinner, { size: 100 }) })
|
|
31
|
-
] });
|
|
32
|
-
};
|
|
33
|
-
const OuterContainer = styled.div`
|
|
34
|
-
height: ${({ $isVisible }) => $isVisible ? "100%" : "0px"};
|
|
35
|
-
width: ${({ $isVisible }) => $isVisible ? "100%" : "0px"};
|
|
36
|
-
flex: ${({ $isVisible }) => $isVisible ? 1 : "auto"};
|
|
37
|
-
padding: ${({ $embeddedModal, $isVisible }) => !$isVisible ? "0px" : $embeddedModal ? "12px 0px 0px" : "72px 72px 32px"};
|
|
38
|
-
display: flex;
|
|
39
|
-
align-items: center;
|
|
40
|
-
justify-content: center;
|
|
41
|
-
|
|
42
|
-
@media (max-width: ${MOBILE_SIZE}px) {
|
|
43
|
-
padding: ${({ $embeddedModal, $isVisible }) => !$isVisible ? "0px" : $embeddedModal ? "12px 0px 0px" : "72px 16px 0px"};
|
|
44
|
-
}
|
|
45
|
-
`;
|
|
46
|
-
const Container = styled.div`
|
|
47
|
-
height: 100%;
|
|
48
|
-
width: 100%;
|
|
49
|
-
display: ${({ $isReady }) => $isReady ? "block" : "none"};
|
|
50
|
-
|
|
51
|
-
& > iframe {
|
|
52
|
-
height: 360px;
|
|
53
|
-
width: 100%;
|
|
54
|
-
border: none;
|
|
55
|
-
}
|
|
56
|
-
`;
|
|
57
|
-
export {
|
|
58
|
-
IFrameStep
|
|
59
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const LoginDoneStep: ({ onClose }: LoginDoneStep) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import "../../../chunk-MMUBH76A.js";
|
|
3
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
import { useEffect } from "react";
|
|
5
|
-
import { Heading, HeroIcon, StepContainer } from "../common.js";
|
|
6
|
-
import { ExternalWalletCard, WalletCard, WalletCards } from "../WalletCard/WalletCard.js";
|
|
7
|
-
import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
|
|
8
|
-
import { useStore } from "../../../provider/stores/useStore.js";
|
|
9
|
-
const LoginDoneStep = ({ onClose }) => {
|
|
10
|
-
var _a, _b;
|
|
11
|
-
const para = useInternalClient();
|
|
12
|
-
const hideWallets = useStore((state) => {
|
|
13
|
-
var _a2;
|
|
14
|
-
return (_a2 = state.modalConfig) == null ? void 0 : _a2.hideWallets;
|
|
15
|
-
});
|
|
16
|
-
useEffect(() => {
|
|
17
|
-
setTimeout(() => {
|
|
18
|
-
onClose();
|
|
19
|
-
}, 1600);
|
|
20
|
-
}, []);
|
|
21
|
-
return /* @__PURE__ */ jsxs(StepContainer, { children: [
|
|
22
|
-
/* @__PURE__ */ jsx(HeroIcon, { icon: "checkCircleFilled" }),
|
|
23
|
-
/* @__PURE__ */ jsx(Heading, { variant: "headingS", weight: "bold", children: "Connected" }),
|
|
24
|
-
!hideWallets && /* @__PURE__ */ jsx(WalletCards, { children: para.externalWalletConnectionType === "CONNECTION_ONLY" ? /* @__PURE__ */ jsx(ExternalWalletCard, { address: (_b = (_a = Object.values(para.externalWallets || {})[0]) == null ? void 0 : _a.address) != null ? _b : "" }) : para.currentWalletIdsArray.map(([id, type]) => {
|
|
25
|
-
return /* @__PURE__ */ jsx(WalletCard, { id, type }, `${id}-${type}`);
|
|
26
|
-
}) })
|
|
27
|
-
] });
|
|
28
|
-
};
|
|
29
|
-
export {
|
|
30
|
-
LoginDoneStep
|
|
31
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ParaModalProps } from '../../types/modalProps.js';
|
|
2
|
-
type ModalContentProps = Omit<ParaModalProps, 'para' | 'isOpen' | 'theme' | 'branding' | 'onModalStepChange' | 'onExpandModalChange'>;
|
|
3
|
-
export type ModalContentHandle = {
|
|
4
|
-
/**
|
|
5
|
-
* Trigger the modal close handler
|
|
6
|
-
*/
|
|
7
|
-
handleModalClose: () => void;
|
|
8
|
-
};
|
|
9
|
-
export declare const ModalContent: import("react").ForwardRefExoticComponent<ModalContentProps & import("react").RefAttributes<ModalContentHandle>>;
|
|
10
|
-
export {};
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__async,
|
|
4
|
-
__spreadProps,
|
|
5
|
-
__spreadValues
|
|
6
|
-
} from "../../../chunk-MMUBH76A.js";
|
|
7
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
-
import { forwardRef, useEffect, useImperativeHandle } from "react";
|
|
9
|
-
import { EnabledFlow } from "@getpara/web-sdk";
|
|
10
|
-
import { useModalStore } from "../../stores/index.js";
|
|
11
|
-
import { ModalStep } from "../../utils/steps.js";
|
|
12
|
-
import { Body } from "../Body/Body.js";
|
|
13
|
-
import { Footer } from "../Footer/Footer.js";
|
|
14
|
-
import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
|
|
15
|
-
import { useExternalWallets } from "../../../provider/providers/ExternalWalletProvider.js";
|
|
16
|
-
const ModalContent = forwardRef(
|
|
17
|
-
({
|
|
18
|
-
twoFactorAuthEnabled = false,
|
|
19
|
-
oAuthMethods,
|
|
20
|
-
disableEmailLogin,
|
|
21
|
-
disablePhoneLogin,
|
|
22
|
-
isGuestModeEnabled = false,
|
|
23
|
-
onClose,
|
|
24
|
-
onRampTestMode
|
|
25
|
-
}, ref) => {
|
|
26
|
-
const para = useInternalClient();
|
|
27
|
-
const refs = useModalStore((state) => state.refs);
|
|
28
|
-
const onRampConfig = useModalStore((state) => state.onRampConfig);
|
|
29
|
-
const setOnRampConfig = useModalStore((state) => state.setOnRampConfig);
|
|
30
|
-
const accountAddFundTab = useModalStore((state) => state.accountAddFundTab);
|
|
31
|
-
const setAccountAddFundTab = useModalStore((state) => state.setAccountAddFundTab);
|
|
32
|
-
const { disconnectExternalWallet } = useExternalWallets();
|
|
33
|
-
useImperativeHandle(ref, () => {
|
|
34
|
-
return {
|
|
35
|
-
handleModalClose() {
|
|
36
|
-
handleClose();
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
}, []);
|
|
40
|
-
const handleClose = () => {
|
|
41
|
-
onClose == null ? void 0 : onClose();
|
|
42
|
-
if (refs.currentStep.current === ModalStep.EXTERNAL_WALLET_VERIFICATION && para.isExternalWalletAuth) {
|
|
43
|
-
disconnectExternalWallet();
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
useEffect(() => {
|
|
47
|
-
if (!onRampConfig) {
|
|
48
|
-
para.ctx.client.getOnRampConfig().then((res) => {
|
|
49
|
-
let newOnRampConfig;
|
|
50
|
-
newOnRampConfig = __spreadProps(__spreadValues({}, res), { testMode: onRampTestMode });
|
|
51
|
-
setOnRampConfig(newOnRampConfig);
|
|
52
|
-
if (!accountAddFundTab) {
|
|
53
|
-
setAccountAddFundTab(
|
|
54
|
-
newOnRampConfig.isBuyEnabled ? EnabledFlow.BUY : newOnRampConfig.isReceiveEnabled ? EnabledFlow.RECEIVE : newOnRampConfig.isWithdrawEnabled ? EnabledFlow.WITHDRAW : void 0
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
}).catch();
|
|
58
|
-
}
|
|
59
|
-
}, []);
|
|
60
|
-
useEffect(() => {
|
|
61
|
-
if (!!onRampConfig) {
|
|
62
|
-
setOnRampConfig(__spreadProps(__spreadValues({}, onRampConfig), { testMode: onRampTestMode }));
|
|
63
|
-
}
|
|
64
|
-
}, [onRampTestMode]);
|
|
65
|
-
useEffect(() => {
|
|
66
|
-
const init = () => __async(void 0, null, function* () {
|
|
67
|
-
if (!(yield para.isFullyLoggedIn())) {
|
|
68
|
-
yield disconnectExternalWallet();
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
init();
|
|
72
|
-
return () => {
|
|
73
|
-
var _a;
|
|
74
|
-
window.clearTimeout((_a = refs.poll.current) == null ? void 0 : _a.timeout);
|
|
75
|
-
};
|
|
76
|
-
}, []);
|
|
77
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
78
|
-
/* @__PURE__ */ jsx(
|
|
79
|
-
Body,
|
|
80
|
-
{
|
|
81
|
-
oAuthMethods,
|
|
82
|
-
twoFactorAuthEnabled,
|
|
83
|
-
disableEmailLogin: !!disableEmailLogin,
|
|
84
|
-
disablePhoneLogin: !!disablePhoneLogin,
|
|
85
|
-
isGuestModeEnabled,
|
|
86
|
-
onClose: handleClose
|
|
87
|
-
}
|
|
88
|
-
),
|
|
89
|
-
/* @__PURE__ */ jsx(Footer, {})
|
|
90
|
-
] });
|
|
91
|
-
}
|
|
92
|
-
);
|
|
93
|
-
export {
|
|
94
|
-
ModalContent
|
|
95
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import "../../../chunk-MMUBH76A.js";
|
|
3
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
import { CpslButton, CpslIcon, CpslQrCode, CpslSpinner, CpslText } from "@getpara/react-components";
|
|
5
|
-
import { CenteredText, Heading, InnerStepContainer, QRContainer, StepContainer } from "../common.js";
|
|
6
|
-
import { useModalStore } from "../../stores/index.js";
|
|
7
|
-
import { isMobile } from "@getpara/web-sdk";
|
|
8
|
-
const FarcasterOAuthStep = () => {
|
|
9
|
-
const farcasterConnectUri = useModalStore((state) => state.farcasterConnectUri);
|
|
10
|
-
return /* @__PURE__ */ jsx(StepContainer, { $wide: true, children: isMobile() ? /* @__PURE__ */ jsxs(InnerStepContainer, { children: [
|
|
11
|
-
/* @__PURE__ */ jsx(CpslText, { weight: "medium", color: "secondary", children: `Don\u2019t have Farcaster` }),
|
|
12
|
-
/* @__PURE__ */ jsxs(CpslButton, { as: "a", href: "https://link.warpcast.com/download-qr", target: "_blank", variant: "secondary", children: [
|
|
13
|
-
/* @__PURE__ */ jsx(CpslIcon, { slot: "start", icon: "linkExternal" }),
|
|
14
|
-
`Get Farcaster`
|
|
15
|
-
] })
|
|
16
|
-
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
17
|
-
/* @__PURE__ */ jsx(Heading, { variant: "headingS", weight: "bold", children: "Sign in using Farcaster" }),
|
|
18
|
-
/* @__PURE__ */ jsxs(InnerStepContainer, { children: [
|
|
19
|
-
/* @__PURE__ */ jsx(CenteredText, { variant: "bodyS", color: "secondary", weight: "medium", children: "Scan the QR code with your phone's camera to proceed." }),
|
|
20
|
-
/* @__PURE__ */ jsx(QRContainer, { children: !farcasterConnectUri ? /* @__PURE__ */ jsx(CpslSpinner, { size: 100 }) : /* @__PURE__ */ jsx(CpslQrCode, { url: farcasterConnectUri }) })
|
|
21
|
-
] })
|
|
22
|
-
] }) });
|
|
23
|
-
};
|
|
24
|
-
var FarcasterOAuthStep_default = FarcasterOAuthStep;
|
|
25
|
-
export {
|
|
26
|
-
FarcasterOAuthStep_default as default
|
|
27
|
-
};
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__async
|
|
4
|
-
} from "../../../chunk-MMUBH76A.js";
|
|
5
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
import { styled } from "styled-components";
|
|
7
|
-
import { useModalStore } from "../../stores/index.js";
|
|
8
|
-
import { ModalStep } from "../../utils/steps.js";
|
|
9
|
-
import { getTileButtonFlex } from "../../utils/getTileButtonFlex.js";
|
|
10
|
-
import { StyledCpslTileButton } from "../common.js";
|
|
11
|
-
import { brandedOAuthLogos, oAuthLogos } from "../../constants/oAuthLogos.js";
|
|
12
|
-
import { useStore } from "../../../provider/stores/useStore.js";
|
|
13
|
-
import { useAuthActions } from "../../../provider/providers/AuthProvider.js";
|
|
14
|
-
const HAS_MORE_LENGTH = 3;
|
|
15
|
-
const OAuth = ({ methods }) => {
|
|
16
|
-
const oAuthLogoVariant = useStore((state) => state.oAuthLogoVariant);
|
|
17
|
-
const isDark = useStore((state) => state.isDarkTheme);
|
|
18
|
-
const setStep = useModalStore((state) => state.setStep);
|
|
19
|
-
const showAll = useModalStore((state) => state.step === ModalStep.AUTH_MORE || state.step === ModalStep.AUTH_GUEST_SIGNUP);
|
|
20
|
-
const { verifyFarcaster, verifyOAuth } = useAuthActions();
|
|
21
|
-
const hasMore = methods.length > HAS_MORE_LENGTH;
|
|
22
|
-
const methodsToShow = showAll || !hasMore ? methods : methods.slice(0, HAS_MORE_LENGTH - 1);
|
|
23
|
-
const handleShowAll = () => {
|
|
24
|
-
setStep(ModalStep.AUTH_MORE);
|
|
25
|
-
};
|
|
26
|
-
const handleMethodClick = (method) => () => __async(void 0, null, function* () {
|
|
27
|
-
switch (method) {
|
|
28
|
-
case "FARCASTER":
|
|
29
|
-
verifyFarcaster();
|
|
30
|
-
break;
|
|
31
|
-
case "TELEGRAM":
|
|
32
|
-
setStep(ModalStep.TELEGRAM_OAUTH);
|
|
33
|
-
break;
|
|
34
|
-
default:
|
|
35
|
-
verifyOAuth(method);
|
|
36
|
-
break;
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
const useBrandedLogos = oAuthLogoVariant === "default";
|
|
40
|
-
const useDarkLogos = useBrandedLogos ? isDark : oAuthLogoVariant !== "dark";
|
|
41
|
-
const showMoreButton = !showAll && hasMore;
|
|
42
|
-
return /* @__PURE__ */ jsxs(OAuthContainer, { children: [
|
|
43
|
-
methodsToShow.map((method, index) => /* @__PURE__ */ jsx(
|
|
44
|
-
OAuthButton,
|
|
45
|
-
{
|
|
46
|
-
$isDark: useDarkLogos,
|
|
47
|
-
icon: useBrandedLogos ? brandedOAuthLogos[method] : oAuthLogos[method],
|
|
48
|
-
onClick: handleMethodClick(method),
|
|
49
|
-
$index: index,
|
|
50
|
-
$totalItems: showMoreButton ? HAS_MORE_LENGTH : methodsToShow.length
|
|
51
|
-
},
|
|
52
|
-
method
|
|
53
|
-
)),
|
|
54
|
-
showMoreButton && /* @__PURE__ */ jsx(
|
|
55
|
-
OAuthButton,
|
|
56
|
-
{
|
|
57
|
-
$isDark: useDarkLogos,
|
|
58
|
-
icon: "moreLoginOptions",
|
|
59
|
-
onClick: handleShowAll,
|
|
60
|
-
$index: HAS_MORE_LENGTH - 1,
|
|
61
|
-
$totalItems: HAS_MORE_LENGTH
|
|
62
|
-
}
|
|
63
|
-
)
|
|
64
|
-
] });
|
|
65
|
-
};
|
|
66
|
-
const OAuthContainer = styled.div`
|
|
67
|
-
display: flex;
|
|
68
|
-
justify-content: center;
|
|
69
|
-
gap: 8px;
|
|
70
|
-
flex-wrap: wrap;
|
|
71
|
-
`;
|
|
72
|
-
const OAuthButton = styled(StyledCpslTileButton)`
|
|
73
|
-
flex: ${({ $index, $totalItems }) => getTileButtonFlex($index, $totalItems)};
|
|
74
|
-
|
|
75
|
-
--button-icon-color: ${({ $isDark }) => $isDark ? "white" : "black"};
|
|
76
|
-
`;
|
|
77
|
-
export {
|
|
78
|
-
OAuth
|
|
79
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function TelegramOAuthStep(): import("react/jsx-runtime").JSX.Element;
|