@getpara/react-sdk-lite 2.0.0-alpha.48 → 2.0.0-alpha.50

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.
@@ -117,7 +117,7 @@ const ParaModal = forwardRef((props, ref) => {
117
117
  });
118
118
  trackAnalytics();
119
119
  }, []);
120
- const isOpen = configIsOpen != null ? configIsOpen : storedIsOpen;
120
+ const isOpen = bareModal || (configIsOpen != null ? configIsOpen : storedIsOpen);
121
121
  useImperativeHandle(ref, () => {
122
122
  return {
123
123
  goBack() {
@@ -32,9 +32,9 @@ const Account = () => {
32
32
  setGuestAddFundsTab(EnabledFlow.BUY);
33
33
  setStep(ModalStep.AUTH_GUEST_SIGNUP);
34
34
  }
35
- } else {
35
+ } else if ((onRampConfig == null ? void 0 : onRampConfig.isBuyEnabled) || (onRampConfig == null ? void 0 : onRampConfig.isReceiveEnabled)) {
36
36
  setOnRampStep(OnRampStep.SETTINGS);
37
- setStep(ModalStep.ADD_FUNDS_BUY);
37
+ setStep((onRampConfig == null ? void 0 : onRampConfig.isBuyEnabled) ? ModalStep.ADD_FUNDS_BUY : ModalStep.ADD_FUNDS_RECEIVE);
38
38
  }
39
39
  };
40
40
  const handleSellClick = () => {
@@ -76,7 +76,7 @@ const Account = () => {
76
76
  )
77
77
  ] }),
78
78
  /* @__PURE__ */ jsx(ButtonContainer, { children: isOnRampLoaded ? /* @__PURE__ */ jsxs(Fragment, { children: [
79
- onRampConfig.isBuyEnabled && !cantBuyAndWithdraw && /* @__PURE__ */ jsx(OptionButton, { icon: "plusCircle", onClick: handleBuyClick, children: /* @__PURE__ */ jsx(CpslText, { variant: "bodyXS", color: "secondary", weight: "medium", children: "Add Funds" }) }),
79
+ (onRampConfig.isBuyEnabled || onRampConfig.isReceiveEnabled) && !cantBuyAndWithdraw && /* @__PURE__ */ jsx(OptionButton, { icon: "plusCircle", onClick: handleBuyClick, children: /* @__PURE__ */ jsx(CpslText, { variant: "bodyXS", color: "secondary", weight: "medium", children: "Add Funds" }) }),
80
80
  onRampConfig.isWithdrawEnabled && !cantBuyAndWithdraw && /* @__PURE__ */ jsx(OptionButton, { icon: "arrowCircleDown", onClick: handleSellClick, children: /* @__PURE__ */ jsx(CpslText, { variant: "bodyXS", color: "secondary", weight: "medium", children: "Withdraw" }) }),
81
81
  /* @__PURE__ */ jsx(OptionButton, { icon: "user01", onClick: handleProfileClick, children: /* @__PURE__ */ jsx(CpslText, { variant: "bodyXS", color: "secondary", weight: "medium", children: isEnabled ? "Profile" : "Settings" }) })
82
82
  ] }) : /* @__PURE__ */ jsx(CpslSpinner, {}) })
@@ -26,11 +26,12 @@ const AddFunds = () => {
26
26
  const { data: activeWallet } = useWallet();
27
27
  const { embedded } = useAccount();
28
28
  const isGuestMode = (embedded == null ? void 0 : embedded.isConnected) && embedded.isGuestMode;
29
+ console.log(onRampConfig);
29
30
  const tabs = TABS.filter(
30
31
  ([enabledFlow, key]) => !!(onRampConfig == null ? void 0 : onRampConfig[key]) && (!isGuestMode || enabledFlow === EnabledFlow.RECEIVE)
31
32
  );
32
33
  const tab = storedTab != null ? storedTab : tabs[0][0];
33
- const isMultiFlow = (tab === EnabledFlow.BUY || tab === EnabledFlow.RECEIVE) && tabs.length > 1;
34
+ const isMultiFlow = (tab === EnabledFlow.BUY || tab === EnabledFlow.RECEIVE) && (onRampConfig == null ? void 0 : onRampConfig.isBuyEnabled) && (onRampConfig == null ? void 0 : onRampConfig.isReceiveEnabled);
34
35
  const onSetTab = (event) => {
35
36
  setModalStep(getAddFundsStep(event.detail.tab));
36
37
  };
@@ -56,12 +57,10 @@ const AddFunds = () => {
56
57
  return /* @__PURE__ */ jsx(SpinnerContainer, { children: /* @__PURE__ */ jsx(CpslSpinner, {}) });
57
58
  }
58
59
  return /* @__PURE__ */ jsxs(StepContainer, { children: [
59
- isMultiFlow && /* @__PURE__ */ jsx(InnerStepContainer, { children: /* @__PURE__ */ jsx(CpslTabs, { selectedTab: tab, onCpslTabsChanged: onSetTab, children: TABS.filter(([enabledFlow]) => enabledFlow === EnabledFlow.BUY || enabledFlow === EnabledFlow.RECEIVE).map(
60
- ([tab2, _, icon, title]) => /* @__PURE__ */ jsxs(CpslTab, { tab: tab2, children: [
61
- /* @__PURE__ */ jsx(CpslIcon, { slot: "start", icon }),
62
- title
63
- ] }, tab2)
64
- ) }) }),
60
+ isMultiFlow && /* @__PURE__ */ jsx(InnerStepContainer, { children: /* @__PURE__ */ jsx(CpslTabs, { selectedTab: tab, onCpslTabsChanged: onSetTab, children: tabs.filter(([enabledFlow]) => enabledFlow !== EnabledFlow.WITHDRAW).map(([tab2, _, icon, title]) => /* @__PURE__ */ jsxs(CpslTab, { tab: tab2, children: [
61
+ /* @__PURE__ */ jsx(CpslIcon, { slot: "start", icon }),
62
+ title
63
+ ] }, tab2)) }) }),
65
64
  (step === ModalStep.ADD_FUNDS_RECEIVE || (embedded == null ? void 0 : embedded.wallets) && embedded.wallets.length > 1) && /* @__PURE__ */ jsx(WalletSelectOld, {}),
66
65
  /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: /* @__PURE__ */ jsx(AddFundsContextProvider, { "data-testid": "add-funds", tab, children: Content }) })
67
66
  ] });
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@getpara/react-sdk-lite",
3
- "version": "2.0.0-alpha.48",
3
+ "version": "2.0.0-alpha.50",
4
4
  "bin": {
5
5
  "setup-para": "dist/cli/cli.mjs"
6
6
  },
7
7
  "dependencies": {
8
- "@getpara/react-common": "2.0.0-alpha.48",
9
- "@getpara/react-components": "2.0.0-alpha.48",
10
- "@getpara/web-sdk": "2.0.0-alpha.48",
8
+ "@getpara/react-common": "2.0.0-alpha.50",
9
+ "@getpara/react-components": "2.0.0-alpha.50",
10
+ "@getpara/web-sdk": "2.0.0-alpha.50",
11
11
  "date-fns": "^3.6.0",
12
12
  "framer-motion": "^11.3.31",
13
13
  "libphonenumber-js": "^1.11.7",
@@ -16,9 +16,9 @@
16
16
  "zustand-sync-tabs": "^0.2.2"
17
17
  },
18
18
  "devDependencies": {
19
- "@getpara/cosmos-wallet-connectors": "2.0.0-alpha.48",
20
- "@getpara/evm-wallet-connectors": "2.0.0-alpha.48",
21
- "@getpara/solana-wallet-connectors": "2.0.0-alpha.48",
19
+ "@getpara/cosmos-wallet-connectors": "2.0.0-alpha.50",
20
+ "@getpara/evm-wallet-connectors": "2.0.0-alpha.50",
21
+ "@getpara/solana-wallet-connectors": "2.0.0-alpha.50",
22
22
  "@tanstack/react-query": "^5.74.0",
23
23
  "@testing-library/dom": "^10.4.0",
24
24
  "@testing-library/react": "^16.3.0",
@@ -38,7 +38,7 @@
38
38
  "package.json",
39
39
  "styles.css"
40
40
  ],
41
- "gitHead": "bfb7086671a63d7360602908f3140c40959a43f6",
41
+ "gitHead": "688b92a7ca207593a4a3be09cb5cc580092614fc",
42
42
  "main": "dist/index.js",
43
43
  "peerDependencies": {
44
44
  "@tanstack/react-query": ">=5.0.0",