@getpara/react-sdk 1.6.1-dev.0 → 1.7.1
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/dist/{modal/components/AddFunds/MoonPayEmbed.js → MoonPayEmbed-Q2HP2BFI.js} +3 -1
- package/dist/MoonPayEmbed-Q2HP2BFI.js.br +0 -0
- package/dist/MoonPayEmbed-Q2HP2BFI.js.gz +0 -0
- package/dist/chunk-MMUBH76A.js.br +0 -0
- package/dist/chunk-MMUBH76A.js.gz +0 -0
- package/dist/index.js +6659 -6
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/modal/components/ExternalWalletVerificationStep/ExternalWalletVerificationStep.d.ts +1 -0
- package/dist/modal/components/ExternalWalletsWrapper/ExternalWalletsWrapper.d.ts +2 -1
- package/dist/modal/components/common.d.ts +4 -0
- package/dist/modal/index.d.ts +1 -0
- package/dist/modal/providers/CosmosExternalWalletContextStub.d.ts +13 -0
- package/dist/modal/providers/EvmExternalWalletContextStub.d.ts +11 -0
- package/dist/modal/providers/ExternalWalletContext.d.ts +15 -1
- package/dist/modal/providers/SolanaExternalWalletContextStub.d.ts +11 -0
- package/dist/modal/stores/externalWalletProvider/useExternalWalletProviderStore.d.ts +2 -0
- package/dist/modal/types/commonTypes.d.ts +12 -2
- package/dist/modal/types/externalWallets.d.ts +2 -0
- package/dist/modal/types/modalProps.d.ts +6 -0
- package/dist/modal/utils/steps.d.ts +2 -0
- package/dist/provider/utils/constants.d.ts +5 -0
- package/package.json +5 -5
- package/dist/modal/ParaModal.js +0 -337
- package/dist/modal/components/Account/Account.js +0 -69
- package/dist/modal/components/AddFunds/AddFunds.js +0 -220
- package/dist/modal/components/AddFunds/AddFundsAwaiting.js +0 -72
- package/dist/modal/components/AddFunds/AddFundsDone.js +0 -43
- package/dist/modal/components/AddFunds/index.js +0 -4
- package/dist/modal/components/AuthInput/AuthInput.js +0 -283
- package/dist/modal/components/AuthInput/countryCodes.js +0 -42
- package/dist/modal/components/AuthInput/hooks/useDropdownPosition.js +0 -33
- package/dist/modal/components/AuthInput/phoneMasks.js +0 -253
- package/dist/modal/components/AuthMainStep/AuthMainStep.js +0 -37
- package/dist/modal/components/AuthMainStep/AuthMainStepContent.js +0 -113
- package/dist/modal/components/AuthOptions/AuthOptions.js +0 -33
- package/dist/modal/components/AwaitingBiometricsStep/AwaitingBiometricsStep.js +0 -18
- package/dist/modal/components/AwaitingOAuthStep/AwaitingOAuthStep.js +0 -10
- package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.js +0 -18
- package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.js +0 -44
- package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.js +0 -52
- package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.js +0 -93
- package/dist/modal/components/Body/AnimatedHeightWrapper.js +0 -29
- package/dist/modal/components/Body/Body.js +0 -304
- package/dist/modal/components/ChainSwitch/ChainSwitch.js +0 -94
- package/dist/modal/components/ChainSwitch/config.js +0 -17
- package/dist/modal/components/Controls/Controls.js +0 -74
- package/dist/modal/components/Controls/Selects.js +0 -213
- package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.js +0 -151
- package/dist/modal/components/ExternalWalletStep/config.js +0 -17
- package/dist/modal/components/ExternalWallets/ExternalWallets.js +0 -172
- package/dist/modal/components/ExternalWalletsWrapper/ExternalWalletsWrapper.js +0 -123
- package/dist/modal/components/Footer/Footer.js +0 -93
- package/dist/modal/components/Header/Header.js +0 -43
- package/dist/modal/components/Header/hooks/useStepTitle.js +0 -50
- package/dist/modal/components/Hero/Hero.js +0 -122
- package/dist/modal/components/IFrameStep/IFrameStep.js +0 -55
- package/dist/modal/components/LoginDoneStep/LoginDoneStep.js +0 -28
- package/dist/modal/components/ModalContent/ModalContent.js +0 -310
- package/dist/modal/components/OAuth/FarcasterOAuthStep.js +0 -81
- package/dist/modal/components/OAuth/OAuth.js +0 -153
- package/dist/modal/components/OAuth/TelegramOAuthStep.js +0 -139
- package/dist/modal/components/OnRampComponents/AddingFunds.js +0 -23
- package/dist/modal/components/OnRampComponents/OnRampProviderButton.js +0 -77
- package/dist/modal/components/RecoverySecretStep/RecoverySecretStep.js +0 -101
- package/dist/modal/components/Setup2FAStep/Setup2FAStep.js +0 -141
- package/dist/modal/components/StripeComponents/StripeComponents.js +0 -88
- package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.js +0 -24
- package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.js +0 -159
- package/dist/modal/components/Waiting/Waiting.js +0 -17
- package/dist/modal/components/WalletCard/PartnerIcon.js +0 -34
- package/dist/modal/components/WalletCard/WalletCard.js +0 -127
- package/dist/modal/components/WalletCreationDoneStep/WalletCreationDoneStep.js +0 -52
- package/dist/modal/components/common.js +0 -83
- package/dist/modal/components/index.js +0 -2
- package/dist/modal/constants/constants.js +0 -111
- package/dist/modal/constants/defaults.js +0 -10
- package/dist/modal/constants/oAuthLogos.js +0 -24
- package/dist/modal/hooks/useActiveWallet.js +0 -15
- package/dist/modal/hooks/useCreateAccount.js +0 -72
- package/dist/modal/hooks/useEmbeddedExternalConnection.js +0 -39
- package/dist/modal/hooks/useGoBack.js +0 -35
- package/dist/modal/hooks/useSetLoginURLs.js +0 -45
- package/dist/modal/index.js +0 -32
- package/dist/modal/providers/CosmosExternalWalletContextStub.js +0 -34
- package/dist/modal/providers/EvmExternalWalletContextStub.js +0 -38
- package/dist/modal/providers/ExternalWalletContext.js +0 -275
- package/dist/modal/providers/SolanaExternalWalletContextStub.js +0 -19
- package/dist/modal/stores/externalWalletProvider/actions.js +0 -10
- package/dist/modal/stores/externalWalletProvider/useExternalWalletProviderStore.js +0 -20
- package/dist/modal/stores/index.js +0 -4
- package/dist/modal/stores/modal/actions.js +0 -70
- package/dist/modal/stores/modal/useModalStore.js +0 -65
- package/dist/modal/stores/theme/actions.js +0 -28
- package/dist/modal/stores/theme/useThemeStore.js +0 -21
- package/dist/modal/stores/userInfo/actions.js +0 -30
- package/dist/modal/stores/userInfo/useUserInfoStore.js +0 -17
- package/dist/modal/types/commonTypes.js +0 -1
- package/dist/modal/types/externalWallets.js +0 -31
- package/dist/modal/types/modalProps.js +0 -12
- package/dist/modal/utils/authLayoutHelpers.js +0 -8
- package/dist/modal/utils/getMailtoLink.js +0 -10
- package/dist/modal/utils/getTileButtonFlex.js +0 -20
- package/dist/modal/utils/openPopup.js +0 -60
- package/dist/modal/utils/routeMobileExternalWallet.js +0 -31
- package/dist/modal/utils/steps.js +0 -228
- package/dist/modal/utils/stringFormatters.js +0 -14
- package/dist/modal/utils/validateOnRampConfig.js +0 -32
- package/dist/provider/ParaProvider.js +0 -22
- package/dist/provider/actions/checkIfUserExists.js +0 -21
- package/dist/provider/actions/createUser.js +0 -26
- package/dist/provider/actions/getAccount.js +0 -22
- package/dist/provider/actions/getWallet.js +0 -14
- package/dist/provider/actions/initiateLogin.js +0 -20
- package/dist/provider/actions/keepSessionAlive.js +0 -20
- package/dist/provider/actions/logout.js +0 -17
- package/dist/provider/actions/signMessage.js +0 -20
- package/dist/provider/actions/signTransaction.js +0 -20
- package/dist/provider/actions/waitForAccountCreation.js +0 -21
- package/dist/provider/actions/waitForLoginAndSetup.js +0 -24
- package/dist/provider/actions/waitForPasskeyAndCreateWallet.js +0 -21
- package/dist/provider/hooks/index.js +0 -4
- package/dist/provider/hooks/mutations/index.js +0 -24
- package/dist/provider/hooks/mutations/useCheckIfUserExists.js +0 -23
- package/dist/provider/hooks/mutations/useCreateUser.js +0 -20
- package/dist/provider/hooks/mutations/useInitiateLogin.js +0 -23
- package/dist/provider/hooks/mutations/useKeepSessionAlive.js +0 -20
- package/dist/provider/hooks/mutations/useLogout.js +0 -30
- package/dist/provider/hooks/mutations/useSignMessage.js +0 -33
- package/dist/provider/hooks/mutations/useSignTransaction.js +0 -33
- package/dist/provider/hooks/mutations/useWaitForAccountCreation.js +0 -30
- package/dist/provider/hooks/mutations/useWaitForLoginAndSetup.js +0 -30
- package/dist/provider/hooks/mutations/useWaitForPasskeyAndCreateWallet.js +0 -30
- package/dist/provider/hooks/queries/index.js +0 -8
- package/dist/provider/hooks/queries/useAccount.js +0 -21
- package/dist/provider/hooks/queries/useWallet.js +0 -22
- package/dist/provider/hooks/utils/index.js +0 -10
- package/dist/provider/hooks/utils/useAutoSessionKeepAlive.js +0 -74
- package/dist/provider/hooks/utils/useClient.js +0 -10
- package/dist/provider/hooks/utils/useEventListeners.js +0 -105
- package/dist/provider/hooks/utils/useInternalClient.js +0 -10
- package/dist/provider/hooks/utils/useModal.js +0 -17
- package/dist/provider/hooks/utils/useWalletState.js +0 -33
- package/dist/provider/index.js +0 -8
- package/dist/provider/stores/getters.js +0 -13
- package/dist/provider/stores/slices/client.js +0 -9
- package/dist/provider/stores/slices/index.js +0 -4
- package/dist/provider/stores/slices/modal.js +0 -9
- package/dist/provider/stores/slices/wallet.js +0 -11
- package/dist/provider/stores/types.js +0 -1
- package/dist/provider/stores/useStore.js +0 -27
- package/dist/provider/types/provider.js +0 -1
- package/dist/provider/types/query.js +0 -1
- package/dist/provider/types/utils.js +0 -1
- package/dist/provider/utils/renameMutations.js +0 -16
|
@@ -1,93 +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
|
-
const Footer = () => {
|
|
11
|
-
const isAccount = useModalStore((state) => state.isAccount());
|
|
12
|
-
const currentStep = useModalStore((state) => state.step);
|
|
13
|
-
const showFooter = isAccount || getStepHasFooter(currentStep);
|
|
14
|
-
const Content = useMemo(() => {
|
|
15
|
-
if (isAccount) {
|
|
16
|
-
return /* @__PURE__ */ jsxs(ConnectContainer, { children: [
|
|
17
|
-
/* @__PURE__ */ jsxs(ConnectText, { variant: "bodyS", color: "secondary", weight: "medium", children: [
|
|
18
|
-
"Access all your wallet\u2019s features at",
|
|
19
|
-
" ",
|
|
20
|
-
/* @__PURE__ */ jsx("a", { href: PARA_CONNECT, target: "blank", children: /* @__PURE__ */ jsx(ClickableText, { variant: "bodyS", weight: "medium", children: "Para Connect" }) })
|
|
21
|
-
] }),
|
|
22
|
-
/* @__PURE__ */ jsx(CpslButton, { as: "a", href: PARA_CONNECT, target: "blank", variant: "ghost", children: /* @__PURE__ */ jsx(RightChevron, { icon: "chevronUp" }) })
|
|
23
|
-
] });
|
|
24
|
-
}
|
|
25
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
26
|
-
/* @__PURE__ */ jsxs(InlineText, { variant: "body2XS", color: "secondary", weight: "medium", children: [
|
|
27
|
-
"By logging in you agree to our",
|
|
28
|
-
" ",
|
|
29
|
-
/* @__PURE__ */ jsx("a", { href: PARA_TERMS_AND_CONDITIONS, target: "blank", children: /* @__PURE__ */ jsx(ClickableText, { variant: "body2XS", weight: "medium", children: "Terms & Conditions" }) })
|
|
30
|
-
] }),
|
|
31
|
-
/* @__PURE__ */ jsxs(PoweredByContainer, { children: [
|
|
32
|
-
/* @__PURE__ */ jsx(InlineText, { variant: "bodyS", color: "secondary", weight: "medium", children: "Powered by" }),
|
|
33
|
-
/* @__PURE__ */ jsx(ParaLogo, { icon: "para" })
|
|
34
|
-
] })
|
|
35
|
-
] });
|
|
36
|
-
}, [isAccount]);
|
|
37
|
-
if (!showFooter) {
|
|
38
|
-
return null;
|
|
39
|
-
}
|
|
40
|
-
return /* @__PURE__ */ jsx(FooterContainer, { slot: "footer", children: /* @__PURE__ */ jsx(FooterContentContainer, { children: Content }) });
|
|
41
|
-
};
|
|
42
|
-
const FooterContainer = styled.div`
|
|
43
|
-
display: flex;
|
|
44
|
-
flex-direction: column;
|
|
45
|
-
align-items: center;
|
|
46
|
-
gap: 16px;
|
|
47
|
-
padding: 8px 0px;
|
|
48
|
-
`;
|
|
49
|
-
const FooterContentContainer = styled.div`
|
|
50
|
-
display: flex;
|
|
51
|
-
flex-direction: column;
|
|
52
|
-
align-items: center;
|
|
53
|
-
gap: 8px;
|
|
54
|
-
`;
|
|
55
|
-
const PoweredByContainer = styled.div`
|
|
56
|
-
display: flex;
|
|
57
|
-
gap: 5px;
|
|
58
|
-
align-items: center;
|
|
59
|
-
justify-content: center;
|
|
60
|
-
`;
|
|
61
|
-
const ConnectContainer = styled.div`
|
|
62
|
-
display: flex;
|
|
63
|
-
gap: 8px;
|
|
64
|
-
align-items: center;
|
|
65
|
-
justify-content: center;
|
|
66
|
-
`;
|
|
67
|
-
const RightChevron = styled(CpslIcon)`
|
|
68
|
-
transform: rotate(90deg);
|
|
69
|
-
|
|
70
|
-
/* --icon-color: var(--cpsl-color-text-tertiary); */
|
|
71
|
-
--height: 24px;
|
|
72
|
-
--width: 24px;
|
|
73
|
-
`;
|
|
74
|
-
const InlineText = styled(CpslText)`
|
|
75
|
-
text-align: center;
|
|
76
|
-
display: inline-block;
|
|
77
|
-
`;
|
|
78
|
-
const ConnectText = styled(InlineText)`
|
|
79
|
-
line-height: 20px;
|
|
80
|
-
`;
|
|
81
|
-
const ClickableText = styled(InlineText)`
|
|
82
|
-
cursor: pointer;
|
|
83
|
-
display: inline-block;
|
|
84
|
-
`;
|
|
85
|
-
const ParaLogo = styled(CpslIcon)`
|
|
86
|
-
display: inline-block;
|
|
87
|
-
--icon-color: var(--cpsl-color-text-secondary);
|
|
88
|
-
--width: 49px;
|
|
89
|
-
--height: auto;
|
|
90
|
-
`;
|
|
91
|
-
export {
|
|
92
|
-
Footer
|
|
93
|
-
};
|
|
@@ -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,50 +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 "../../../providers/ExternalWalletContext.js";
|
|
7
|
-
import { useThemeStore } from "../../../stores/index.js";
|
|
8
|
-
const useStepTitle = () => {
|
|
9
|
-
const hideWallets = useThemeStore((state) => state.hideWallets);
|
|
10
|
-
const isLogin = useModalStore((state) => state.isLogin());
|
|
11
|
-
const currentStep = useModalStore((state) => state.step);
|
|
12
|
-
const { chainId } = useExternalWallets();
|
|
13
|
-
const titles = useMemo(
|
|
14
|
-
() => ({
|
|
15
|
-
[ModalStep.AUTH_MAIN]: "",
|
|
16
|
-
[ModalStep.AUTH_MORE]: "Sign Up or Log In",
|
|
17
|
-
[ModalStep.EX_WALLET_MORE]: "Connect Wallet",
|
|
18
|
-
[ModalStep.VERIFICATIONS]: "Sign Up",
|
|
19
|
-
[ModalStep.AWAITING_OAUTH]: isLogin ? "Login" : "Sign Up",
|
|
20
|
-
[ModalStep.FARCASTER_OAUTH]: isLogin ? "Login" : "Sign Up",
|
|
21
|
-
[ModalStep.BIOMETRIC_CREATION]: "Sign Up",
|
|
22
|
-
[ModalStep.PASSWORD_CREATION]: "Sign Up",
|
|
23
|
-
[ModalStep.AWAITING_BIOMETRIC_CREATION]: "Sign Up",
|
|
24
|
-
[ModalStep.AWAITING_WALLET_CREATION]: isLogin ? "Login" : "Sign Up",
|
|
25
|
-
[ModalStep.AWAITING_PASSWORD_CREATION]: "Sign Up",
|
|
26
|
-
[ModalStep.WALLET_CREATION_DONE]: hideWallets ? "Account Created" : "Wallet Created",
|
|
27
|
-
[ModalStep.SECRET]: isLogin ? "Login" : "Sign Up",
|
|
28
|
-
[ModalStep.BIOMETRIC_LOGIN]: "Login",
|
|
29
|
-
[ModalStep.AWAITING_PASSWORD_LOGIN]: "Login",
|
|
30
|
-
[ModalStep.AWAITING_BIOMETRIC_LOGIN]: "Login",
|
|
31
|
-
[ModalStep.LOGIN_DONE]: "",
|
|
32
|
-
[ModalStep.SETUP_2FA]: "2FA",
|
|
33
|
-
[ModalStep.VERIFY_2FA]: "2FA",
|
|
34
|
-
[ModalStep.TWO_FACTOR_DONE]: "2FA",
|
|
35
|
-
[ModalStep.ADD_FUNDS_BUY]: "",
|
|
36
|
-
[ModalStep.ADD_FUNDS_RECEIVE]: "",
|
|
37
|
-
[ModalStep.ADD_FUNDS_WITHDRAW]: "",
|
|
38
|
-
[ModalStep.ADD_FUNDS_AWAITING]: "",
|
|
39
|
-
[ModalStep.ADD_FUNDS_SUCCESS]: "",
|
|
40
|
-
[ModalStep.ADD_FUNDS_FAILURE]: "",
|
|
41
|
-
[ModalStep.ACCOUNT_MAIN]: "",
|
|
42
|
-
[ModalStep.CHAIN_SWITCH]: ""
|
|
43
|
-
}),
|
|
44
|
-
[isLogin, chainId, hideWallets]
|
|
45
|
-
);
|
|
46
|
-
return { title: titles[currentStep] };
|
|
47
|
-
};
|
|
48
|
-
export {
|
|
49
|
-
useStepTitle
|
|
50
|
-
};
|
|
@@ -1,122 +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 { useExternalWallets } from "../../providers/ExternalWalletContext.js";
|
|
9
|
-
import { NETWORK_NOT_SUPPORTED_ERROR } from "../../constants/constants.js";
|
|
10
|
-
import { useEffect, useState } from "react";
|
|
11
|
-
import { isMobile } from "@getpara/web-sdk";
|
|
12
|
-
import { useActiveWallet } from "../../hooks/useActiveWallet.js";
|
|
13
|
-
import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.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.ACCOUNT_MAIN]: {
|
|
32
|
-
variant: "customContent",
|
|
33
|
-
topOffset: 0,
|
|
34
|
-
spacerHeight: 104,
|
|
35
|
-
hideFadeOut: true
|
|
36
|
-
},
|
|
37
|
-
[ModalStep.FARCASTER_OAUTH]: {
|
|
38
|
-
variant: "externalWalletConnection",
|
|
39
|
-
topOffset: 40,
|
|
40
|
-
spacerHeight: 158,
|
|
41
|
-
hideFadeOut: true
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
const Hero = () => {
|
|
46
|
-
const para = useInternalClient();
|
|
47
|
-
const { wallet: connector, walletDisplayHelpers, avatar } = useExternalWallets();
|
|
48
|
-
const step = useModalStore((state) => state.step);
|
|
49
|
-
const externalWalletError = useModalStore((state) => state.externalWalletError);
|
|
50
|
-
const activeWallet = useActiveWallet();
|
|
51
|
-
const [currentStep, setCurrentStep] = useState(step);
|
|
52
|
-
const stepConfig = getStepConfig({
|
|
53
|
-
externalWalletError
|
|
54
|
-
})[currentStep];
|
|
55
|
-
useEffect(() => {
|
|
56
|
-
const prevStepConfig = getStepConfig({
|
|
57
|
-
externalWalletError
|
|
58
|
-
})[currentStep];
|
|
59
|
-
const newStepConfig = getStepConfig({
|
|
60
|
-
externalWalletError
|
|
61
|
-
})[step];
|
|
62
|
-
const delay = newStepConfig && prevStepConfig ? 0 : newStepConfig && !prevStepConfig ? 0 : 200;
|
|
63
|
-
setTimeout(() => {
|
|
64
|
-
setCurrentStep(step);
|
|
65
|
-
}, delay);
|
|
66
|
-
}, [step]);
|
|
67
|
-
const isExternalStep = currentStep === ModalStep.EX_WALLET_SELECTED;
|
|
68
|
-
const isChainSwitchStep = currentStep === ModalStep.CHAIN_SWITCH;
|
|
69
|
-
const isAccountStep = currentStep === ModalStep.ACCOUNT_MAIN;
|
|
70
|
-
const isFarcasterStep = currentStep === ModalStep.FARCASTER_OAUTH;
|
|
71
|
-
const { showExtension, isCosmosMobileWallet } = walletDisplayHelpers;
|
|
72
|
-
const shouldHide = !stepConfig || !isMobile() && isExternalStep && !showExtension || !isMobile() && isChainSwitchStep && isCosmosMobileWallet || !isMobile() && isFarcasterStep;
|
|
73
|
-
const { variant, topOffset, spacerHeight, hideFadeOut } = stepConfig != null ? stepConfig : {};
|
|
74
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
75
|
-
/* @__PURE__ */ jsx(Container, { $top: -45 + topOffset, children: shouldHide ? null : /* @__PURE__ */ jsxs(StyledHero, { $isAccount: isAccountStep, hideFadeOut, variant, height: 480, withDefaultTheme: true, children: [
|
|
76
|
-
(isExternalStep || isChainSwitchStep) && /* @__PURE__ */ jsx(WalletLogo, { slot: "connectionLeft", src: connector == null ? void 0 : connector.iconUrl }),
|
|
77
|
-
isFarcasterStep && /* @__PURE__ */ jsx(WalletLogo, { slot: "connectionLeft", icon: "farcasterBrand" }),
|
|
78
|
-
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)
|
|
79
|
-
] }) }),
|
|
80
|
-
!shouldHide && /* @__PURE__ */ jsx(Spacer, { $height: spacerHeight })
|
|
81
|
-
] });
|
|
82
|
-
};
|
|
83
|
-
const Container = styled.div`
|
|
84
|
-
display: flex;
|
|
85
|
-
position: absolute;
|
|
86
|
-
justify-content: center;
|
|
87
|
-
align-items: center;
|
|
88
|
-
width: 100%;
|
|
89
|
-
|
|
90
|
-
top: ${({ $top }) => `${$top}px`};
|
|
91
|
-
`;
|
|
92
|
-
const Spacer = styled.div`
|
|
93
|
-
height: ${({ $height }) => `${$height}px`};
|
|
94
|
-
`;
|
|
95
|
-
const WalletLogo = styled(CpslIcon)`
|
|
96
|
-
--height: 60px;
|
|
97
|
-
--width: 60px;
|
|
98
|
-
`;
|
|
99
|
-
const Avatar = styled.img`
|
|
100
|
-
width: 100%;
|
|
101
|
-
height: 100%;
|
|
102
|
-
object-fit: contain;
|
|
103
|
-
`;
|
|
104
|
-
const IconAvatar = styled(CpslIdenticon)`
|
|
105
|
-
border-radius: 1000px;
|
|
106
|
-
`;
|
|
107
|
-
const StyledHero = styled(CpslHero)`
|
|
108
|
-
${({ $isAccount }) => $isAccount && `
|
|
109
|
-
--ring-3-size: 560px;
|
|
110
|
-
--ring-2-size: 402px;
|
|
111
|
-
--ring-1-size: 228px;
|
|
112
|
-
--ring-0-size: 104px;
|
|
113
|
-
|
|
114
|
-
--default-theme-ring-3-opacity: 0.02;
|
|
115
|
-
--default-theme-ring-2-opacity: 0.04;
|
|
116
|
-
--default-theme-ring-1-opacity: 0.06;
|
|
117
|
-
--default-theme-ring-0-opacity: 0.1;
|
|
118
|
-
`}
|
|
119
|
-
`;
|
|
120
|
-
export {
|
|
121
|
-
Hero
|
|
122
|
-
};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import "../../../chunk-MMUBH76A.js";
|
|
3
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
import { useModalStore, useThemeStore } 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
|
-
const IFrameStep = () => {
|
|
11
|
-
const iFrameUrl = useModalStore((state) => state.iFrameUrl);
|
|
12
|
-
const setIsReady = useModalStore((state) => state.setIsIFrameReady);
|
|
13
|
-
const isReady = useModalStore((state) => state.isIFrameReady);
|
|
14
|
-
const currentStep = useModalStore((state) => state.step);
|
|
15
|
-
const embeddedModal = useThemeStore((state) => state.embeddedModal);
|
|
16
|
-
return /* @__PURE__ */ jsxs(OuterContainer, { $isVisible: IFrameSteps.includes(currentStep), $embeddedModal: embeddedModal, children: [
|
|
17
|
-
/* @__PURE__ */ jsx(Container, { $isReady: isReady, children: /* @__PURE__ */ jsx(
|
|
18
|
-
"iframe",
|
|
19
|
-
{
|
|
20
|
-
src: iFrameUrl,
|
|
21
|
-
onLoad: () => {
|
|
22
|
-
setIsReady(true);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
) }),
|
|
26
|
-
!isReady && /* @__PURE__ */ jsx(SpinnerContainer, { style: { width: "100%", height: "100%", flex: 1 }, children: /* @__PURE__ */ jsx(CpslSpinner, { size: 100 }) })
|
|
27
|
-
] });
|
|
28
|
-
};
|
|
29
|
-
const OuterContainer = styled.div`
|
|
30
|
-
height: ${({ $isVisible }) => $isVisible ? "100%" : "0px"};
|
|
31
|
-
width: ${({ $isVisible }) => $isVisible ? "100%" : "0px"};
|
|
32
|
-
flex: ${({ $isVisible }) => $isVisible ? 1 : "auto"};
|
|
33
|
-
padding: ${({ $embeddedModal, $isVisible }) => !$isVisible ? "0px" : $embeddedModal ? "12px 0px 0px" : "72px 72px 32px"};
|
|
34
|
-
display: flex;
|
|
35
|
-
align-items: center;
|
|
36
|
-
justify-content: center;
|
|
37
|
-
|
|
38
|
-
@media (max-width: ${MOBILE_SIZE}px) {
|
|
39
|
-
padding: ${({ $embeddedModal, $isVisible }) => !$isVisible ? "0px" : $embeddedModal ? "12px 0px 0px" : "72px 16px 0px"};
|
|
40
|
-
}
|
|
41
|
-
`;
|
|
42
|
-
const Container = styled.div`
|
|
43
|
-
height: 100%;
|
|
44
|
-
width: 100%;
|
|
45
|
-
display: ${({ $isReady }) => $isReady ? "block" : "none"};
|
|
46
|
-
|
|
47
|
-
& > iframe {
|
|
48
|
-
height: 360px;
|
|
49
|
-
width: 100%;
|
|
50
|
-
border: none;
|
|
51
|
-
}
|
|
52
|
-
`;
|
|
53
|
-
export {
|
|
54
|
-
IFrameStep
|
|
55
|
-
};
|
|
@@ -1,28 +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 { useThemeStore } from "../../stores/index.js";
|
|
8
|
-
import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
|
|
9
|
-
const LoginDoneStep = ({ onClose }) => {
|
|
10
|
-
var _a;
|
|
11
|
-
const para = useInternalClient();
|
|
12
|
-
const hideWallets = useThemeStore((state) => state.hideWallets);
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
setTimeout(() => {
|
|
15
|
-
onClose();
|
|
16
|
-
}, 1600);
|
|
17
|
-
}, []);
|
|
18
|
-
return /* @__PURE__ */ jsxs(StepContainer, { children: [
|
|
19
|
-
/* @__PURE__ */ jsx(HeroIcon, { icon: "checkCircleFilled" }),
|
|
20
|
-
/* @__PURE__ */ jsx(Heading, { variant: "headingS", weight: "bold", children: "Connected" }),
|
|
21
|
-
!hideWallets && /* @__PURE__ */ jsx(WalletCards, { children: para.isUsingExternalWallet() ? /* @__PURE__ */ jsx(ExternalWalletCard, { address: (_a = Object.values(para.externalWallets || {})[0]) == null ? void 0 : _a.address }) : para.currentWalletIdsArray.map(([id, type]) => {
|
|
22
|
-
return /* @__PURE__ */ jsx(WalletCard, { id, type }, `${id}-${type}`);
|
|
23
|
-
}) })
|
|
24
|
-
] });
|
|
25
|
-
};
|
|
26
|
-
export {
|
|
27
|
-
LoginDoneStep
|
|
28
|
-
};
|