@b3dotfun/sdk 0.0.65-test.1 → 0.0.65
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/cjs/anyspend/react/components/AnySpend.js +33 -73
- package/dist/cjs/anyspend/react/components/AnySpendCustom.js +1 -1
- package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.js +1 -1
- package/dist/cjs/anyspend/react/components/common/FeeDetailPanel.js +1 -1
- package/dist/cjs/anyspend/react/components/common/FiatPaymentMethod.js +2 -2
- package/dist/cjs/anyspend/react/components/common/OrderHistory.d.ts +1 -1
- package/dist/cjs/anyspend/react/components/common/OrderHistory.js +3 -7
- package/dist/cjs/anyspend/react/components/common/PanelOnrampPayment.js +1 -1
- package/dist/cjs/anyspend/react/components/common/PointsDetailPanel.js +1 -1
- package/dist/cjs/anyspend/react/components/common/RecipientSelection.js +1 -1
- package/dist/cjs/global-account/react/components/AccountAssets/AccountAssets.js +2 -38
- package/dist/cjs/global-account/react/components/AvatarEditor/AvatarEditor.js +33 -139
- package/dist/cjs/global-account/react/components/B3DynamicModal.js +6 -25
- package/dist/cjs/global-account/react/components/LinkAccount/LinkAccount.d.ts +4 -6
- package/dist/cjs/global-account/react/components/LinkAccount/LinkAccount.js +279 -113
- package/dist/cjs/global-account/react/components/ManageAccount/BalanceContent.js +2 -2
- package/dist/cjs/global-account/react/components/ManageAccount/ManageAccount.js +193 -24
- package/dist/cjs/global-account/react/components/index.d.ts +2 -4
- package/dist/cjs/global-account/react/components/index.js +4 -11
- package/dist/cjs/global-account/react/components/ui/Tabs.js +2 -2
- package/dist/cjs/global-account/react/components/ui/dialog.js +2 -2
- package/dist/cjs/global-account/react/hooks/index.d.ts +1 -1
- package/dist/cjs/global-account/react/hooks/index.js +1 -3
- package/dist/cjs/global-account/react/hooks/useB3BalanceFromAddresses.js +0 -1
- package/dist/cjs/global-account/react/stores/index.d.ts +0 -1
- package/dist/cjs/global-account/react/stores/index.js +1 -3
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +3 -34
- package/dist/cjs/global-account/react/utils/profileDisplay.d.ts +0 -2
- package/dist/cjs/global-account/react/utils/profileDisplay.js +2 -2
- package/dist/cjs/shared/constants/chains/supported.d.ts +2 -2
- package/dist/cjs/shared/utils/ipfs.js +1 -1
- package/dist/esm/anyspend/react/components/AnySpend.js +34 -74
- package/dist/esm/anyspend/react/components/AnySpendCustom.js +1 -1
- package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.js +1 -1
- package/dist/esm/anyspend/react/components/common/FeeDetailPanel.js +1 -1
- package/dist/esm/anyspend/react/components/common/FiatPaymentMethod.js +2 -2
- package/dist/esm/anyspend/react/components/common/OrderHistory.d.ts +1 -1
- package/dist/esm/anyspend/react/components/common/OrderHistory.js +5 -6
- package/dist/esm/anyspend/react/components/common/PanelOnrampPayment.js +1 -1
- package/dist/esm/anyspend/react/components/common/PointsDetailPanel.js +1 -1
- package/dist/esm/anyspend/react/components/common/RecipientSelection.js +1 -1
- package/dist/esm/global-account/react/components/AccountAssets/AccountAssets.js +2 -38
- package/dist/esm/global-account/react/components/AvatarEditor/AvatarEditor.js +34 -140
- package/dist/esm/global-account/react/components/B3DynamicModal.js +6 -25
- package/dist/esm/global-account/react/components/LinkAccount/LinkAccount.d.ts +4 -6
- package/dist/esm/global-account/react/components/LinkAccount/LinkAccount.js +280 -113
- package/dist/esm/global-account/react/components/ManageAccount/BalanceContent.js +2 -2
- package/dist/esm/global-account/react/components/ManageAccount/ManageAccount.js +195 -26
- package/dist/esm/global-account/react/components/index.d.ts +2 -4
- package/dist/esm/global-account/react/components/index.js +2 -7
- package/dist/esm/global-account/react/components/ui/Tabs.js +2 -2
- package/dist/esm/global-account/react/components/ui/dialog.js +2 -2
- package/dist/esm/global-account/react/hooks/index.d.ts +1 -1
- package/dist/esm/global-account/react/hooks/index.js +1 -1
- package/dist/esm/global-account/react/hooks/useB3BalanceFromAddresses.js +0 -1
- package/dist/esm/global-account/react/stores/index.d.ts +0 -1
- package/dist/esm/global-account/react/stores/index.js +0 -1
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +3 -34
- package/dist/esm/global-account/react/utils/profileDisplay.d.ts +0 -2
- package/dist/esm/global-account/react/utils/profileDisplay.js +2 -2
- package/dist/esm/shared/constants/chains/supported.d.ts +2 -2
- package/dist/esm/shared/utils/ipfs.js +1 -1
- package/dist/styles/index.css +1 -1
- package/dist/types/anyspend/react/components/common/OrderHistory.d.ts +1 -1
- package/dist/types/global-account/react/components/LinkAccount/LinkAccount.d.ts +4 -6
- package/dist/types/global-account/react/components/index.d.ts +2 -4
- package/dist/types/global-account/react/hooks/index.d.ts +1 -1
- package/dist/types/global-account/react/stores/index.d.ts +0 -1
- package/dist/types/global-account/react/stores/useModalStore.d.ts +3 -34
- package/dist/types/global-account/react/utils/profileDisplay.d.ts +0 -2
- package/dist/types/shared/constants/chains/supported.d.ts +2 -2
- package/package.json +1 -1
- package/src/anyspend/react/components/AnySpend.tsx +167 -225
- package/src/anyspend/react/components/AnySpendCustom.tsx +1 -1
- package/src/anyspend/react/components/common/CryptoPaymentMethod.tsx +1 -1
- package/src/anyspend/react/components/common/FeeDetailPanel.tsx +1 -1
- package/src/anyspend/react/components/common/FiatPaymentMethod.tsx +2 -2
- package/src/anyspend/react/components/common/OrderHistory.tsx +13 -8
- package/src/anyspend/react/components/common/PanelOnrampPayment.tsx +1 -1
- package/src/anyspend/react/components/common/PointsDetailPanel.tsx +1 -1
- package/src/anyspend/react/components/common/RecipientSelection.tsx +1 -1
- package/src/global-account/react/components/AccountAssets/AccountAssets.tsx +25 -115
- package/src/global-account/react/components/AvatarEditor/AvatarEditor.tsx +126 -303
- package/src/global-account/react/components/B3DynamicModal.tsx +6 -28
- package/src/global-account/react/components/LinkAccount/LinkAccount.tsx +433 -332
- package/src/global-account/react/components/ManageAccount/BalanceContent.tsx +3 -2
- package/src/global-account/react/components/ManageAccount/ManageAccount.tsx +589 -73
- package/src/global-account/react/components/index.ts +2 -9
- package/src/global-account/react/components/ui/Tabs.tsx +13 -5
- package/src/global-account/react/components/ui/dialog.tsx +14 -32
- package/src/global-account/react/hooks/index.ts +0 -3
- package/src/global-account/react/hooks/useB3BalanceFromAddresses.ts +0 -1
- package/src/global-account/react/stores/index.ts +0 -1
- package/src/global-account/react/stores/useModalStore.ts +2 -39
- package/src/global-account/react/utils/profileDisplay.ts +2 -4
- package/src/shared/utils/ipfs.ts +1 -1
- package/src/styles/index.css +1 -6
- package/dist/cjs/global-account/react/components/Deposit/Deposit.d.ts +0 -1
- package/dist/cjs/global-account/react/components/Deposit/Deposit.js +0 -65
- package/dist/cjs/global-account/react/components/LinkAccount/LinkNewAccount.d.ts +0 -4
- package/dist/cjs/global-account/react/components/LinkAccount/LinkNewAccount.js +0 -331
- package/dist/cjs/global-account/react/components/ManageAccount/AppsContent.d.ts +0 -6
- package/dist/cjs/global-account/react/components/ManageAccount/AppsContent.js +0 -34
- package/dist/cjs/global-account/react/components/ManageAccount/BottomNavigation.d.ts +0 -2
- package/dist/cjs/global-account/react/components/ManageAccount/BottomNavigation.js +0 -23
- package/dist/cjs/global-account/react/components/ManageAccount/Header.d.ts +0 -3
- package/dist/cjs/global-account/react/components/ManageAccount/Header.js +0 -120
- package/dist/cjs/global-account/react/components/ManageAccount/HomeActions.d.ts +0 -5
- package/dist/cjs/global-account/react/components/ManageAccount/HomeActions.js +0 -43
- package/dist/cjs/global-account/react/components/ManageAccount/HomeContent.d.ts +0 -6
- package/dist/cjs/global-account/react/components/ManageAccount/HomeContent.js +0 -16
- package/dist/cjs/global-account/react/components/ManageAccount/NFTContent.d.ts +0 -2
- package/dist/cjs/global-account/react/components/ManageAccount/NFTContent.js +0 -15
- package/dist/cjs/global-account/react/components/ManageAccount/ProfileSection.d.ts +0 -2
- package/dist/cjs/global-account/react/components/ManageAccount/ProfileSection.js +0 -44
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsContent.d.ts +0 -7
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsContent.js +0 -50
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsMenuItem.d.ts +0 -9
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsMenuItem.js +0 -8
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsProfileCard.d.ts +0 -2
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsProfileCard.js +0 -38
- package/dist/cjs/global-account/react/components/ManageAccount/TokenContent.d.ts +0 -2
- package/dist/cjs/global-account/react/components/ManageAccount/TokenContent.js +0 -22
- package/dist/cjs/global-account/react/components/ModalHeader/ModalHeader.d.ts +0 -10
- package/dist/cjs/global-account/react/components/ModalHeader/ModalHeader.js +0 -12
- package/dist/cjs/global-account/react/components/Send/Send.d.ts +0 -5
- package/dist/cjs/global-account/react/components/Send/Send.js +0 -187
- package/dist/cjs/global-account/react/components/icons/BellIcon.d.ts +0 -3
- package/dist/cjs/global-account/react/components/icons/BellIcon.js +0 -5
- package/dist/cjs/global-account/react/components/icons/ChevronDownIcon.d.ts +0 -2
- package/dist/cjs/global-account/react/components/icons/ChevronDownIcon.js +0 -7
- package/dist/cjs/global-account/react/components/icons/CopyIcon.d.ts +0 -2
- package/dist/cjs/global-account/react/components/icons/CopyIcon.js +0 -7
- package/dist/cjs/global-account/react/components/icons/LinkIcon.d.ts +0 -3
- package/dist/cjs/global-account/react/components/icons/LinkIcon.js +0 -5
- package/dist/cjs/global-account/react/components/icons/LockIcon.d.ts +0 -3
- package/dist/cjs/global-account/react/components/icons/LockIcon.js +0 -5
- package/dist/cjs/global-account/react/components/icons/WalletIcon.d.ts +0 -2
- package/dist/cjs/global-account/react/components/icons/WalletIcon.js +0 -7
- package/dist/cjs/global-account/react/stores/useRecentAddressesStore.d.ts +0 -25
- package/dist/cjs/global-account/react/stores/useRecentAddressesStore.js +0 -36
- package/dist/esm/global-account/react/components/Deposit/Deposit.d.ts +0 -1
- package/dist/esm/global-account/react/components/Deposit/Deposit.js +0 -59
- package/dist/esm/global-account/react/components/LinkAccount/LinkNewAccount.d.ts +0 -4
- package/dist/esm/global-account/react/components/LinkAccount/LinkNewAccount.js +0 -325
- package/dist/esm/global-account/react/components/ManageAccount/AppsContent.d.ts +0 -6
- package/dist/esm/global-account/react/components/ManageAccount/AppsContent.js +0 -32
- package/dist/esm/global-account/react/components/ManageAccount/BottomNavigation.d.ts +0 -2
- package/dist/esm/global-account/react/components/ManageAccount/BottomNavigation.js +0 -21
- package/dist/esm/global-account/react/components/ManageAccount/Header.d.ts +0 -3
- package/dist/esm/global-account/react/components/ManageAccount/Header.js +0 -81
- package/dist/esm/global-account/react/components/ManageAccount/HomeActions.d.ts +0 -5
- package/dist/esm/global-account/react/components/ManageAccount/HomeActions.js +0 -41
- package/dist/esm/global-account/react/components/ManageAccount/HomeContent.d.ts +0 -6
- package/dist/esm/global-account/react/components/ManageAccount/HomeContent.js +0 -10
- package/dist/esm/global-account/react/components/ManageAccount/NFTContent.d.ts +0 -2
- package/dist/esm/global-account/react/components/ManageAccount/NFTContent.js +0 -13
- package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.d.ts +0 -2
- package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.js +0 -42
- package/dist/esm/global-account/react/components/ManageAccount/SettingsContent.d.ts +0 -7
- package/dist/esm/global-account/react/components/ManageAccount/SettingsContent.js +0 -45
- package/dist/esm/global-account/react/components/ManageAccount/SettingsMenuItem.d.ts +0 -9
- package/dist/esm/global-account/react/components/ManageAccount/SettingsMenuItem.js +0 -6
- package/dist/esm/global-account/react/components/ManageAccount/SettingsProfileCard.d.ts +0 -2
- package/dist/esm/global-account/react/components/ManageAccount/SettingsProfileCard.js +0 -36
- package/dist/esm/global-account/react/components/ManageAccount/TokenContent.d.ts +0 -2
- package/dist/esm/global-account/react/components/ManageAccount/TokenContent.js +0 -20
- package/dist/esm/global-account/react/components/ModalHeader/ModalHeader.d.ts +0 -10
- package/dist/esm/global-account/react/components/ModalHeader/ModalHeader.js +0 -10
- package/dist/esm/global-account/react/components/Send/Send.d.ts +0 -5
- package/dist/esm/global-account/react/components/Send/Send.js +0 -181
- package/dist/esm/global-account/react/components/icons/BellIcon.d.ts +0 -3
- package/dist/esm/global-account/react/components/icons/BellIcon.js +0 -3
- package/dist/esm/global-account/react/components/icons/ChevronDownIcon.d.ts +0 -2
- package/dist/esm/global-account/react/components/icons/ChevronDownIcon.js +0 -4
- package/dist/esm/global-account/react/components/icons/CopyIcon.d.ts +0 -2
- package/dist/esm/global-account/react/components/icons/CopyIcon.js +0 -4
- package/dist/esm/global-account/react/components/icons/LinkIcon.d.ts +0 -3
- package/dist/esm/global-account/react/components/icons/LinkIcon.js +0 -3
- package/dist/esm/global-account/react/components/icons/LockIcon.d.ts +0 -3
- package/dist/esm/global-account/react/components/icons/LockIcon.js +0 -3
- package/dist/esm/global-account/react/components/icons/WalletIcon.d.ts +0 -2
- package/dist/esm/global-account/react/components/icons/WalletIcon.js +0 -4
- package/dist/esm/global-account/react/stores/useRecentAddressesStore.d.ts +0 -25
- package/dist/esm/global-account/react/stores/useRecentAddressesStore.js +0 -33
- package/dist/types/global-account/react/components/Deposit/Deposit.d.ts +0 -1
- package/dist/types/global-account/react/components/LinkAccount/LinkNewAccount.d.ts +0 -4
- package/dist/types/global-account/react/components/ManageAccount/AppsContent.d.ts +0 -6
- package/dist/types/global-account/react/components/ManageAccount/BottomNavigation.d.ts +0 -2
- package/dist/types/global-account/react/components/ManageAccount/Header.d.ts +0 -3
- package/dist/types/global-account/react/components/ManageAccount/HomeActions.d.ts +0 -5
- package/dist/types/global-account/react/components/ManageAccount/HomeContent.d.ts +0 -6
- package/dist/types/global-account/react/components/ManageAccount/NFTContent.d.ts +0 -2
- package/dist/types/global-account/react/components/ManageAccount/ProfileSection.d.ts +0 -2
- package/dist/types/global-account/react/components/ManageAccount/SettingsContent.d.ts +0 -7
- package/dist/types/global-account/react/components/ManageAccount/SettingsMenuItem.d.ts +0 -9
- package/dist/types/global-account/react/components/ManageAccount/SettingsProfileCard.d.ts +0 -2
- package/dist/types/global-account/react/components/ManageAccount/TokenContent.d.ts +0 -2
- package/dist/types/global-account/react/components/ModalHeader/ModalHeader.d.ts +0 -10
- package/dist/types/global-account/react/components/Send/Send.d.ts +0 -5
- package/dist/types/global-account/react/components/icons/BellIcon.d.ts +0 -3
- package/dist/types/global-account/react/components/icons/ChevronDownIcon.d.ts +0 -2
- package/dist/types/global-account/react/components/icons/CopyIcon.d.ts +0 -2
- package/dist/types/global-account/react/components/icons/LinkIcon.d.ts +0 -3
- package/dist/types/global-account/react/components/icons/LockIcon.d.ts +0 -3
- package/dist/types/global-account/react/components/icons/WalletIcon.d.ts +0 -2
- package/dist/types/global-account/react/stores/useRecentAddressesStore.d.ts +0 -25
- package/src/global-account/react/components/Deposit/Deposit.tsx +0 -211
- package/src/global-account/react/components/LinkAccount/LinkNewAccount.tsx +0 -490
- package/src/global-account/react/components/ManageAccount/AppsContent.tsx +0 -79
- package/src/global-account/react/components/ManageAccount/BottomNavigation.tsx +0 -83
- package/src/global-account/react/components/ManageAccount/Header.tsx +0 -230
- package/src/global-account/react/components/ManageAccount/HomeActions.tsx +0 -118
- package/src/global-account/react/components/ManageAccount/HomeContent.tsx +0 -42
- package/src/global-account/react/components/ManageAccount/NFTContent.tsx +0 -24
- package/src/global-account/react/components/ManageAccount/ProfileSection.tsx +0 -74
- package/src/global-account/react/components/ManageAccount/SettingsContent.tsx +0 -87
- package/src/global-account/react/components/ManageAccount/SettingsMenuItem.tsx +0 -31
- package/src/global-account/react/components/ManageAccount/SettingsProfileCard.tsx +0 -74
- package/src/global-account/react/components/ManageAccount/TokenContent.tsx +0 -41
- package/src/global-account/react/components/ModalHeader/ModalHeader.tsx +0 -50
- package/src/global-account/react/components/Send/Send.tsx +0 -585
- package/src/global-account/react/components/icons/BellIcon.tsx +0 -15
- package/src/global-account/react/components/icons/ChevronDownIcon.tsx +0 -17
- package/src/global-account/react/components/icons/CopyIcon.tsx +0 -22
- package/src/global-account/react/components/icons/LinkIcon.tsx +0 -15
- package/src/global-account/react/components/icons/LockIcon.tsx +0 -15
- package/src/global-account/react/components/icons/WalletIcon.tsx +0 -21
- package/src/global-account/react/stores/useRecentAddressesStore.ts +0 -55
|
@@ -12,11 +12,8 @@ import {
|
|
|
12
12
|
Button,
|
|
13
13
|
ShinyButton,
|
|
14
14
|
StyleRoot,
|
|
15
|
-
TabsPrimitive,
|
|
16
15
|
TransitionPanel,
|
|
17
16
|
useAccountWallet,
|
|
18
|
-
useB3,
|
|
19
|
-
useModalStore,
|
|
20
17
|
useProfile,
|
|
21
18
|
useRouter,
|
|
22
19
|
useSearchParamsSSR,
|
|
@@ -24,7 +21,6 @@ import {
|
|
|
24
21
|
useTokenData,
|
|
25
22
|
useTokenFromUrl,
|
|
26
23
|
} from "@b3dotfun/sdk/global-account/react";
|
|
27
|
-
import BottomNavigation from "@b3dotfun/sdk/global-account/react/components/ManageAccount/BottomNavigation";
|
|
28
24
|
import { cn } from "@b3dotfun/sdk/shared/utils/cn";
|
|
29
25
|
import { formatTokenAmount } from "@b3dotfun/sdk/shared/utils/number";
|
|
30
26
|
import invariant from "invariant";
|
|
@@ -32,7 +28,6 @@ import { ArrowDown, HistoryIcon, Loader2 } from "lucide-react";
|
|
|
32
28
|
import { motion } from "motion/react";
|
|
33
29
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
34
30
|
import { toast } from "sonner";
|
|
35
|
-
import { defineChain } from "thirdweb";
|
|
36
31
|
import { parseUnits } from "viem";
|
|
37
32
|
import { base, mainnet } from "viem/chains";
|
|
38
33
|
import { components } from "../../types/api";
|
|
@@ -125,31 +120,6 @@ function AnySpendInner({
|
|
|
125
120
|
const searchParams = useSearchParamsSSR();
|
|
126
121
|
const router = useRouter();
|
|
127
122
|
|
|
128
|
-
const { partnerId } = useB3();
|
|
129
|
-
const setB3ModalContentType = useModalStore(state => state.setB3ModalContentType);
|
|
130
|
-
|
|
131
|
-
// Define base chain with RPC for modal props
|
|
132
|
-
const baseChain = useMemo(
|
|
133
|
-
() =>
|
|
134
|
-
defineChain({
|
|
135
|
-
id: 8453,
|
|
136
|
-
name: "Base",
|
|
137
|
-
nativeCurrency: {
|
|
138
|
-
name: "Ether",
|
|
139
|
-
symbol: "ETH",
|
|
140
|
-
decimals: 18,
|
|
141
|
-
},
|
|
142
|
-
rpc: "https://mainnet.base.org",
|
|
143
|
-
blockExplorers: [
|
|
144
|
-
{
|
|
145
|
-
name: "Basescan",
|
|
146
|
-
url: "https://basescan.org",
|
|
147
|
-
},
|
|
148
|
-
],
|
|
149
|
-
}),
|
|
150
|
-
[],
|
|
151
|
-
);
|
|
152
|
-
|
|
153
123
|
// Determine if we're in "buy mode" based on whether destination token props are provided
|
|
154
124
|
const isBuyMode = !!(destinationTokenAddress && destinationTokenChainId);
|
|
155
125
|
|
|
@@ -799,10 +769,6 @@ function AnySpendInner({
|
|
|
799
769
|
const onClickHistory = () => {
|
|
800
770
|
setOrderId(undefined);
|
|
801
771
|
navigateToPanel(PanelView.HISTORY, "forward");
|
|
802
|
-
setB3ModalContentType({
|
|
803
|
-
type: "anySpendOrderHistory",
|
|
804
|
-
showBackButton: false,
|
|
805
|
-
});
|
|
806
772
|
// Remove orderId and paymentMethod from URL when going back to history
|
|
807
773
|
const params = new URLSearchParams(searchParams.toString());
|
|
808
774
|
params.delete("orderId");
|
|
@@ -986,7 +952,7 @@ function AnySpendInner({
|
|
|
986
952
|
);
|
|
987
953
|
|
|
988
954
|
const orderDetailsView = (
|
|
989
|
-
<div className={"mx-auto w-[460px] max-w-full
|
|
955
|
+
<div className={"mx-auto w-[460px] max-w-full"}>
|
|
990
956
|
<div className="relative flex flex-col gap-4">
|
|
991
957
|
{oat && (
|
|
992
958
|
<OrderDetails
|
|
@@ -1013,209 +979,185 @@ function AnySpendInner({
|
|
|
1013
979
|
|
|
1014
980
|
const mainView = (
|
|
1015
981
|
<div className={"mx-auto flex w-[460px] max-w-full flex-col items-center gap-2"}>
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
<
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
className="border-as-stroke h-12 w-12 rounded-full border-2 shadow-md"
|
|
1026
|
-
/>
|
|
1027
|
-
</div>
|
|
1028
|
-
)}
|
|
1029
|
-
<div>
|
|
1030
|
-
<h1 className="text-as-primary text-xl font-bold">Buy {selectedDstToken.symbol}</h1>
|
|
1031
|
-
</div>
|
|
1032
|
-
</div>
|
|
1033
|
-
)}
|
|
1034
|
-
|
|
1035
|
-
{/* Tab section */}
|
|
1036
|
-
<TabSection
|
|
1037
|
-
activeTab={activeTab}
|
|
1038
|
-
setActiveTab={setActiveTab}
|
|
1039
|
-
setSelectedCryptoPaymentMethod={setSelectedCryptoPaymentMethod}
|
|
1040
|
-
setSelectedFiatPaymentMethod={setSelectedFiatPaymentMethod}
|
|
1041
|
-
/>
|
|
1042
|
-
|
|
1043
|
-
<div className="relative flex w-full max-w-[calc(100vw-32px)] flex-col gap-2">
|
|
1044
|
-
{/* Send section */}
|
|
1045
|
-
{activeTab === "crypto" ? (
|
|
1046
|
-
<CryptoPaySection
|
|
1047
|
-
selectedSrcChainId={selectedSrcChainId}
|
|
1048
|
-
setSelectedSrcChainId={setSelectedSrcChainId}
|
|
1049
|
-
selectedSrcToken={selectedSrcToken}
|
|
1050
|
-
setSelectedSrcToken={setSelectedSrcToken}
|
|
1051
|
-
srcAmount={srcAmount}
|
|
1052
|
-
setSrcAmount={setSrcAmount}
|
|
1053
|
-
isSrcInputDirty={isSrcInputDirty}
|
|
1054
|
-
setIsSrcInputDirty={setIsSrcInputDirty}
|
|
1055
|
-
selectedCryptoPaymentMethod={selectedCryptoPaymentMethod}
|
|
1056
|
-
onSelectCryptoPaymentMethod={() => navigateToPanel(PanelView.CRYPTO_PAYMENT_METHOD, "forward")}
|
|
1057
|
-
anyspendQuote={anyspendQuote}
|
|
1058
|
-
onTokenSelect={onTokenSelect}
|
|
1059
|
-
onShowFeeDetail={() => navigateToPanel(PanelView.FEE_DETAIL, "forward")}
|
|
1060
|
-
/>
|
|
1061
|
-
) : (
|
|
1062
|
-
<motion.div
|
|
1063
|
-
initial={{ opacity: 0, y: 20, filter: "blur(10px)" }}
|
|
1064
|
-
animate={{ opacity: 1, y: 0, filter: "blur(0px)" }}
|
|
1065
|
-
transition={{ duration: 0.3, delay: 0, ease: "easeInOut" }}
|
|
1066
|
-
>
|
|
1067
|
-
<PanelOnramp
|
|
1068
|
-
srcAmountOnRamp={srcAmountOnRamp}
|
|
1069
|
-
setSrcAmountOnRamp={setSrcAmountOnRamp}
|
|
1070
|
-
selectedPaymentMethod={selectedFiatPaymentMethod}
|
|
1071
|
-
setActivePanel={(panelIndex: number) => {
|
|
1072
|
-
// Map panel index to navigation with direction
|
|
1073
|
-
const panelsWithForwardNav = [PanelView.FIAT_PAYMENT_METHOD, PanelView.RECIPIENT_SELECTION];
|
|
1074
|
-
if (panelsWithForwardNav.includes(panelIndex)) {
|
|
1075
|
-
navigateToPanel(panelIndex, "forward");
|
|
1076
|
-
} else {
|
|
1077
|
-
setActivePanel(panelIndex);
|
|
1078
|
-
}
|
|
1079
|
-
}}
|
|
1080
|
-
_recipientAddress={recipientAddress}
|
|
1081
|
-
destinationToken={selectedDstToken}
|
|
1082
|
-
destinationChainId={selectedDstChainId}
|
|
1083
|
-
destinationAmount={dstAmount}
|
|
1084
|
-
onDestinationTokenChange={setSelectedDstToken}
|
|
1085
|
-
onDestinationChainChange={setSelectedDstChainId}
|
|
1086
|
-
fiatPaymentMethodIndex={PanelView.FIAT_PAYMENT_METHOD}
|
|
1087
|
-
recipientSelectionPanelIndex={PanelView.RECIPIENT_SELECTION}
|
|
1088
|
-
hideDstToken={isBuyMode}
|
|
1089
|
-
anyspendQuote={anyspendQuote}
|
|
1090
|
-
onShowPointsDetail={() => navigateToPanel(PanelView.POINTS_DETAIL, "forward")}
|
|
1091
|
-
onShowFeeDetail={() => navigateToPanel(PanelView.FEE_DETAIL, "forward")}
|
|
1092
|
-
customUsdInputValues={customUsdInputValues}
|
|
982
|
+
{/* Token Header - Show when in buy mode */}
|
|
983
|
+
{isBuyMode && (
|
|
984
|
+
<div className="mb-4 flex flex-col items-center gap-3 text-center">
|
|
985
|
+
{selectedDstToken.metadata?.logoURI && (
|
|
986
|
+
<div className="relative">
|
|
987
|
+
<img
|
|
988
|
+
src={selectedDstToken.metadata.logoURI}
|
|
989
|
+
alt={selectedDstToken.symbol}
|
|
990
|
+
className="border-as-stroke h-12 w-12 rounded-full border-2 shadow-md"
|
|
1093
991
|
/>
|
|
1094
|
-
</
|
|
992
|
+
</div>
|
|
1095
993
|
)}
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
994
|
+
<div>
|
|
995
|
+
<h1 className="text-as-primary text-xl font-bold">Buy {selectedDstToken.symbol}</h1>
|
|
996
|
+
</div>
|
|
997
|
+
</div>
|
|
998
|
+
)}
|
|
999
|
+
|
|
1000
|
+
{/* Tab section */}
|
|
1001
|
+
<TabSection
|
|
1002
|
+
activeTab={activeTab}
|
|
1003
|
+
setActiveTab={setActiveTab}
|
|
1004
|
+
setSelectedCryptoPaymentMethod={setSelectedCryptoPaymentMethod}
|
|
1005
|
+
setSelectedFiatPaymentMethod={setSelectedFiatPaymentMethod}
|
|
1006
|
+
/>
|
|
1007
|
+
|
|
1008
|
+
<div className="relative flex w-full max-w-[calc(100vw-32px)] flex-col gap-2">
|
|
1009
|
+
{/* Send section */}
|
|
1010
|
+
{activeTab === "crypto" ? (
|
|
1011
|
+
<CryptoPaySection
|
|
1012
|
+
selectedSrcChainId={selectedSrcChainId}
|
|
1013
|
+
setSelectedSrcChainId={setSelectedSrcChainId}
|
|
1014
|
+
selectedSrcToken={selectedSrcToken}
|
|
1015
|
+
setSelectedSrcToken={setSelectedSrcToken}
|
|
1016
|
+
srcAmount={srcAmount}
|
|
1017
|
+
setSrcAmount={setSrcAmount}
|
|
1018
|
+
isSrcInputDirty={isSrcInputDirty}
|
|
1019
|
+
setIsSrcInputDirty={setIsSrcInputDirty}
|
|
1020
|
+
selectedCryptoPaymentMethod={selectedCryptoPaymentMethod}
|
|
1021
|
+
onSelectCryptoPaymentMethod={() => navigateToPanel(PanelView.CRYPTO_PAYMENT_METHOD, "forward")}
|
|
1022
|
+
anyspendQuote={anyspendQuote}
|
|
1023
|
+
onTokenSelect={onTokenSelect}
|
|
1024
|
+
onShowFeeDetail={() => navigateToPanel(PanelView.FEE_DETAIL, "forward")}
|
|
1025
|
+
/>
|
|
1026
|
+
) : (
|
|
1027
|
+
<motion.div
|
|
1028
|
+
initial={{ opacity: 0, y: 20, filter: "blur(10px)" }}
|
|
1029
|
+
animate={{ opacity: 1, y: 0, filter: "blur(0px)" }}
|
|
1030
|
+
transition={{ duration: 0.3, delay: 0, ease: "easeInOut" }}
|
|
1128
1031
|
>
|
|
1129
|
-
<
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
onSelectRecipient={() => navigateToPanel(PanelView.RECIPIENT_SELECTION, "forward")}
|
|
1142
|
-
setRecipientAddress={setRecipientAddress}
|
|
1143
|
-
recipientAddressFromProps={recipientAddressFromProps}
|
|
1144
|
-
globalAddress={globalAddress}
|
|
1145
|
-
dstAmount={dstAmount}
|
|
1146
|
-
dstToken={selectedDstToken}
|
|
1147
|
-
selectedDstChainId={selectedDstChainId}
|
|
1148
|
-
setSelectedDstChainId={setSelectedDstChainId}
|
|
1149
|
-
setSelectedDstToken={setSelectedDstToken}
|
|
1150
|
-
isSrcInputDirty={isSrcInputDirty}
|
|
1151
|
-
onChangeDstAmount={value => {
|
|
1152
|
-
setIsSrcInputDirty(false);
|
|
1153
|
-
setDstAmount(value);
|
|
1032
|
+
<PanelOnramp
|
|
1033
|
+
srcAmountOnRamp={srcAmountOnRamp}
|
|
1034
|
+
setSrcAmountOnRamp={setSrcAmountOnRamp}
|
|
1035
|
+
selectedPaymentMethod={selectedFiatPaymentMethod}
|
|
1036
|
+
setActivePanel={(panelIndex: number) => {
|
|
1037
|
+
// Map panel index to navigation with direction
|
|
1038
|
+
const panelsWithForwardNav = [PanelView.FIAT_PAYMENT_METHOD, PanelView.RECIPIENT_SELECTION];
|
|
1039
|
+
if (panelsWithForwardNav.includes(panelIndex)) {
|
|
1040
|
+
navigateToPanel(panelIndex, "forward");
|
|
1041
|
+
} else {
|
|
1042
|
+
setActivePanel(panelIndex);
|
|
1043
|
+
}
|
|
1154
1044
|
}}
|
|
1045
|
+
_recipientAddress={recipientAddress}
|
|
1046
|
+
destinationToken={selectedDstToken}
|
|
1047
|
+
destinationChainId={selectedDstChainId}
|
|
1048
|
+
destinationAmount={dstAmount}
|
|
1049
|
+
onDestinationTokenChange={setSelectedDstToken}
|
|
1050
|
+
onDestinationChainChange={setSelectedDstChainId}
|
|
1051
|
+
fiatPaymentMethodIndex={PanelView.FIAT_PAYMENT_METHOD}
|
|
1052
|
+
recipientSelectionPanelIndex={PanelView.RECIPIENT_SELECTION}
|
|
1053
|
+
hideDstToken={isBuyMode}
|
|
1155
1054
|
anyspendQuote={anyspendQuote}
|
|
1156
1055
|
onShowPointsDetail={() => navigateToPanel(PanelView.POINTS_DETAIL, "forward")}
|
|
1157
1056
|
onShowFeeDetail={() => navigateToPanel(PanelView.FEE_DETAIL, "forward")}
|
|
1158
|
-
|
|
1057
|
+
customUsdInputValues={customUsdInputValues}
|
|
1159
1058
|
/>
|
|
1160
|
-
|
|
1161
|
-
|
|
1059
|
+
</motion.div>
|
|
1060
|
+
)}
|
|
1162
1061
|
|
|
1163
|
-
{/*
|
|
1164
|
-
<
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
className={cn(
|
|
1175
|
-
"as-main-button relative w-full",
|
|
1176
|
-
btnInfo.error ? "!bg-as-red" : btnInfo.disable ? "!bg-as-on-surface-2" : "!bg-as-brand",
|
|
1177
|
-
)}
|
|
1178
|
-
textClassName={cn(btnInfo.error ? "text-white" : btnInfo.disable ? "text-as-secondary" : "text-white")}
|
|
1179
|
-
>
|
|
1180
|
-
<div className="flex items-center justify-center gap-2">
|
|
1181
|
-
{btnInfo.loading && <Loader2 className="h-4 w-4 animate-spin" />}
|
|
1182
|
-
{btnInfo.text}
|
|
1183
|
-
</div>
|
|
1184
|
-
</ShinyButton>
|
|
1185
|
-
|
|
1186
|
-
{!hideTransactionHistoryButton && (globalAddress || recipientAddress) ? (
|
|
1187
|
-
<Button
|
|
1188
|
-
variant="link"
|
|
1189
|
-
onClick={onClickHistory}
|
|
1190
|
-
className="text-as-primary/50 hover:text-as-primary flex items-center gap-1 transition-colors"
|
|
1191
|
-
>
|
|
1192
|
-
<HistoryIcon className="h-4 w-4" /> <span className="pr-4">Transaction History</span>
|
|
1193
|
-
</Button>
|
|
1194
|
-
) : null}
|
|
1195
|
-
</motion.div>
|
|
1196
|
-
</div>
|
|
1197
|
-
<div className="w-full">
|
|
1198
|
-
<TabsPrimitive
|
|
1199
|
-
defaultValue="swap"
|
|
1200
|
-
onValueChange={value => {
|
|
1201
|
-
if (value === "settings" || value === "home") {
|
|
1202
|
-
setB3ModalContentType({
|
|
1203
|
-
type: "manageAccount",
|
|
1204
|
-
activeTab: value,
|
|
1205
|
-
setActiveTab: () => {},
|
|
1206
|
-
chain: baseChain,
|
|
1207
|
-
partnerId,
|
|
1208
|
-
});
|
|
1209
|
-
} else if (value === "swap") {
|
|
1210
|
-
setB3ModalContentType({
|
|
1211
|
-
type: "anySpend",
|
|
1212
|
-
});
|
|
1062
|
+
{/* Reverse swap direction section */}
|
|
1063
|
+
<Button
|
|
1064
|
+
variant="ghost"
|
|
1065
|
+
className={cn(
|
|
1066
|
+
"border-as-stroke bg-as-surface-primary absolute left-1/2 top-1/2 z-10 h-10 w-10 -translate-x-1/2 -translate-y-1/2 rounded-xl border-2 sm:h-8 sm:w-8 sm:rounded-xl",
|
|
1067
|
+
isBuyMode && "top-[calc(50%+56px)] cursor-default",
|
|
1068
|
+
activeTab === "fiat" && "hidden",
|
|
1069
|
+
)}
|
|
1070
|
+
onClick={() => {
|
|
1071
|
+
if (activeTab === "fiat" || isBuyMode) {
|
|
1072
|
+
return;
|
|
1213
1073
|
}
|
|
1074
|
+
|
|
1075
|
+
// Swap chain selections
|
|
1076
|
+
const tempSrcChainId = selectedSrcChainId;
|
|
1077
|
+
const tempDstChainId = selectedDstChainId;
|
|
1078
|
+
setSelectedSrcChainId(tempDstChainId);
|
|
1079
|
+
setSelectedDstChainId(tempSrcChainId);
|
|
1080
|
+
|
|
1081
|
+
// Swap token selections
|
|
1082
|
+
const tempSrcToken = selectedSrcToken;
|
|
1083
|
+
const tempDstToken = selectedDstToken;
|
|
1084
|
+
setSelectedSrcToken(tempDstToken);
|
|
1085
|
+
setSelectedDstToken(tempSrcToken);
|
|
1086
|
+
|
|
1087
|
+
// Swap amounts
|
|
1088
|
+
const tempSrcAmount = srcAmount;
|
|
1089
|
+
const tempDstAmount = dstAmount;
|
|
1090
|
+
setSrcAmount(tempDstAmount);
|
|
1091
|
+
setDstAmount(tempSrcAmount);
|
|
1214
1092
|
}}
|
|
1215
1093
|
>
|
|
1216
|
-
<
|
|
1217
|
-
|
|
1094
|
+
<div className="relative flex items-center justify-center transition-opacity">
|
|
1095
|
+
<ArrowDown className="text-as-primary/50 h-5 w-5" />
|
|
1096
|
+
</div>
|
|
1097
|
+
</Button>
|
|
1098
|
+
|
|
1099
|
+
{/* Receive section - Hidden when fiat tab is active */}
|
|
1100
|
+
{activeTab === "crypto" && (
|
|
1101
|
+
<CryptoReceiveSection
|
|
1102
|
+
isDepositMode={false}
|
|
1103
|
+
isBuyMode={isBuyMode}
|
|
1104
|
+
selectedRecipientAddress={recipientAddress}
|
|
1105
|
+
recipientName={recipientName || undefined}
|
|
1106
|
+
onSelectRecipient={() => navigateToPanel(PanelView.RECIPIENT_SELECTION, "forward")}
|
|
1107
|
+
setRecipientAddress={setRecipientAddress}
|
|
1108
|
+
recipientAddressFromProps={recipientAddressFromProps}
|
|
1109
|
+
globalAddress={globalAddress}
|
|
1110
|
+
dstAmount={dstAmount}
|
|
1111
|
+
dstToken={selectedDstToken}
|
|
1112
|
+
selectedDstChainId={selectedDstChainId}
|
|
1113
|
+
setSelectedDstChainId={setSelectedDstChainId}
|
|
1114
|
+
setSelectedDstToken={setSelectedDstToken}
|
|
1115
|
+
isSrcInputDirty={isSrcInputDirty}
|
|
1116
|
+
onChangeDstAmount={value => {
|
|
1117
|
+
setIsSrcInputDirty(false);
|
|
1118
|
+
setDstAmount(value);
|
|
1119
|
+
}}
|
|
1120
|
+
anyspendQuote={anyspendQuote}
|
|
1121
|
+
onShowPointsDetail={() => navigateToPanel(PanelView.POINTS_DETAIL, "forward")}
|
|
1122
|
+
onShowFeeDetail={() => navigateToPanel(PanelView.FEE_DETAIL, "forward")}
|
|
1123
|
+
selectedCryptoPaymentMethod={selectedCryptoPaymentMethod}
|
|
1124
|
+
/>
|
|
1125
|
+
)}
|
|
1218
1126
|
</div>
|
|
1127
|
+
|
|
1128
|
+
{/* Main button section */}
|
|
1129
|
+
<motion.div
|
|
1130
|
+
initial={{ opacity: 0, y: 20, filter: "blur(10px)" }}
|
|
1131
|
+
animate={{ opacity: 1, y: 0, filter: "blur(0px)" }}
|
|
1132
|
+
transition={{ duration: 0.3, delay: 0.2, ease: "easeInOut" }}
|
|
1133
|
+
className={cn("mt-4 flex w-full max-w-[460px] flex-col gap-2")}
|
|
1134
|
+
>
|
|
1135
|
+
<ShinyButton
|
|
1136
|
+
accentColor={"hsl(var(--as-brand))"}
|
|
1137
|
+
disabled={btnInfo.disable}
|
|
1138
|
+
onClick={onMainButtonClick}
|
|
1139
|
+
className={cn(
|
|
1140
|
+
"as-main-button relative w-full",
|
|
1141
|
+
btnInfo.error ? "!bg-as-red" : btnInfo.disable ? "!bg-as-on-surface-2" : "!bg-as-brand",
|
|
1142
|
+
)}
|
|
1143
|
+
textClassName={cn(btnInfo.error ? "text-white" : btnInfo.disable ? "text-as-secondary" : "text-white")}
|
|
1144
|
+
>
|
|
1145
|
+
<div className="flex items-center justify-center gap-2">
|
|
1146
|
+
{btnInfo.loading && <Loader2 className="h-4 w-4 animate-spin" />}
|
|
1147
|
+
{btnInfo.text}
|
|
1148
|
+
</div>
|
|
1149
|
+
</ShinyButton>
|
|
1150
|
+
|
|
1151
|
+
{!hideTransactionHistoryButton && (globalAddress || recipientAddress) ? (
|
|
1152
|
+
<Button
|
|
1153
|
+
variant="link"
|
|
1154
|
+
onClick={onClickHistory}
|
|
1155
|
+
className="text-as-primary/50 hover:text-as-primary flex items-center gap-1 transition-colors"
|
|
1156
|
+
>
|
|
1157
|
+
<HistoryIcon className="h-4 w-4" /> <span className="pr-4">Transaction History</span>
|
|
1158
|
+
</Button>
|
|
1159
|
+
) : null}
|
|
1160
|
+
</motion.div>
|
|
1219
1161
|
</div>
|
|
1220
1162
|
);
|
|
1221
1163
|
|
|
@@ -664,7 +664,7 @@ function AnySpendCustomInner({
|
|
|
664
664
|
const historyView = (
|
|
665
665
|
<div
|
|
666
666
|
className={cn(
|
|
667
|
-
"mx-auto flex w-full max-w-2xl flex-col items-center",
|
|
667
|
+
"mx-auto flex w-full max-w-2xl flex-col items-center p-5",
|
|
668
668
|
mode === "modal" && "bg-b3-react-background",
|
|
669
669
|
)}
|
|
670
670
|
>
|
|
@@ -192,7 +192,7 @@ export function CryptoPaymentMethod({
|
|
|
192
192
|
};
|
|
193
193
|
|
|
194
194
|
return (
|
|
195
|
-
<div className="crypto-payment-method mx-auto h-fit w-[460px] max-w-full
|
|
195
|
+
<div className="crypto-payment-method mx-auto h-fit w-[460px] max-w-full">
|
|
196
196
|
<div className={cn("relative flex flex-col gap-10")}>
|
|
197
197
|
{/* Header */}
|
|
198
198
|
<button
|
|
@@ -83,7 +83,7 @@ export function FeeDetailPanel({ fee, transactionAmountUsd, onBack }: FeeDetailP
|
|
|
83
83
|
const [showAllDiscountTiers, setShowAllDiscountTiers] = useState(false);
|
|
84
84
|
|
|
85
85
|
return (
|
|
86
|
-
<div className="mx-auto flex w-[460px] max-w-full flex-col items-center gap-3
|
|
86
|
+
<div className="mx-auto flex w-[460px] max-w-full flex-col items-center gap-3">
|
|
87
87
|
<div className="flex w-full flex-col gap-3">
|
|
88
88
|
<div className="text-center">
|
|
89
89
|
<h3 className="text-as-primary text-lg font-bold">Fee Breakdown</h3>
|
|
@@ -81,7 +81,7 @@ export function FiatPaymentMethodComponent({
|
|
|
81
81
|
// Show loading state while checking geo availability
|
|
82
82
|
if (isLoadingGeoOnramp) {
|
|
83
83
|
return (
|
|
84
|
-
<div className="fiat-payment-method mx-auto w-[460px] max-w-full
|
|
84
|
+
<div className="fiat-payment-method mx-auto w-[460px] max-w-full">
|
|
85
85
|
<div className="flex flex-col gap-6">
|
|
86
86
|
<div className="flex items-center gap-4">
|
|
87
87
|
<button
|
|
@@ -104,7 +104,7 @@ export function FiatPaymentMethodComponent({
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
return (
|
|
107
|
-
<div className="fiat-payment-method mx-auto w-[460px] max-w-full
|
|
107
|
+
<div className="fiat-payment-method mx-auto w-[460px] max-w-full">
|
|
108
108
|
<div className="flex flex-col gap-6">
|
|
109
109
|
{/* Header */}
|
|
110
110
|
<div className="flex items-center gap-4">
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
import { useAnyspendOrderHistory } from "@b3dotfun/sdk/anyspend/react";
|
|
4
4
|
import { Button, Skeleton, useAccountWallet } from "@b3dotfun/sdk/global-account/react";
|
|
5
|
-
import
|
|
6
|
-
import { RefreshCcw } from "lucide-react";
|
|
5
|
+
import { ArrowLeft, RefreshCcw } from "lucide-react";
|
|
7
6
|
import { OrderHistoryItem } from "./OrderHistoryItem";
|
|
8
7
|
|
|
9
8
|
interface OrderHistoryProps {
|
|
10
9
|
mode: "modal" | "page";
|
|
11
|
-
onBack
|
|
10
|
+
onBack: () => void;
|
|
12
11
|
onSelectOrder?: (orderId: string) => void;
|
|
13
12
|
}
|
|
14
13
|
|
|
@@ -18,7 +17,13 @@ export function OrderHistory({ mode, onBack, onSelectOrder }: OrderHistoryProps)
|
|
|
18
17
|
|
|
19
18
|
return (
|
|
20
19
|
<>
|
|
21
|
-
<
|
|
20
|
+
<div className="mb-8 flex w-full items-center gap-3">
|
|
21
|
+
<Button onClick={onBack} variant="ghost" size="icon" className="hover:bg-as-surface-secondary">
|
|
22
|
+
<ArrowLeft className="h-5 w-5" />
|
|
23
|
+
</Button>
|
|
24
|
+
<div className="flex-1">
|
|
25
|
+
<h3 className="text-as-primary text-2xl font-bold">Order History</h3>
|
|
26
|
+
</div>
|
|
22
27
|
<Button
|
|
23
28
|
variant="ghost"
|
|
24
29
|
size="icon"
|
|
@@ -29,20 +34,20 @@ export function OrderHistory({ mode, onBack, onSelectOrder }: OrderHistoryProps)
|
|
|
29
34
|
>
|
|
30
35
|
<RefreshCcw className="text-as-secondary hover:text-as-primary h-5 w-5 cursor-pointer transition-all hover:rotate-180" />
|
|
31
36
|
</Button>
|
|
32
|
-
</
|
|
37
|
+
</div>
|
|
33
38
|
|
|
34
39
|
{isLoadingOrderHistory ? (
|
|
35
|
-
<div className="w-full space-y-3
|
|
40
|
+
<div className="w-full space-y-3">
|
|
36
41
|
{[1, 2, 3].map(i => (
|
|
37
42
|
<Skeleton key={i} className="h-[180px] w-full rounded-2xl" />
|
|
38
43
|
))}
|
|
39
44
|
</div>
|
|
40
45
|
) : !orderHistory?.length ? (
|
|
41
|
-
<div className="bg-as-surface-secondary w-full rounded-2xl p-12
|
|
46
|
+
<div className="bg-as-surface-secondary w-full rounded-2xl p-12 text-center">
|
|
42
47
|
<p className="text-as-secondary text-sm">No order history found</p>
|
|
43
48
|
</div>
|
|
44
49
|
) : (
|
|
45
|
-
<div className="mb-12 w-full space-y-3
|
|
50
|
+
<div className="mb-12 w-full space-y-3">
|
|
46
51
|
{[...orderHistory]
|
|
47
52
|
.sort((a, b) => b.createdAt - a.createdAt)
|
|
48
53
|
.map(order => (
|
|
@@ -150,7 +150,7 @@ function PanelOnrampPaymentInner(props: PanelOnrampPaymentProps) {
|
|
|
150
150
|
};
|
|
151
151
|
|
|
152
152
|
return (
|
|
153
|
-
<div className="mx-auto flex w-full max-w-[460px] flex-col gap-6
|
|
153
|
+
<div className="mx-auto flex w-full max-w-[460px] flex-col gap-6">
|
|
154
154
|
{/* Order Summary Section */}
|
|
155
155
|
<>
|
|
156
156
|
<h2 className="-mb-3 text-lg font-semibold">Order summary</h2>
|
|
@@ -9,7 +9,7 @@ interface PointsDetailPanelProps {
|
|
|
9
9
|
|
|
10
10
|
export function PointsDetailPanel({ pointsAmount = 0, onBack }: PointsDetailPanelProps) {
|
|
11
11
|
return (
|
|
12
|
-
<div className="mx-auto flex w-[460px] max-w-full flex-col items-center gap-4
|
|
12
|
+
<div className="mx-auto flex w-[460px] max-w-full flex-col items-center gap-4">
|
|
13
13
|
<div className="flex flex-col items-center gap-4 text-center">
|
|
14
14
|
<h3 className="text-as-primary text-xl font-bold">Earn Points with Every Swap</h3>
|
|
15
15
|
<p className="text-as-primary/70 text-balance text-sm leading-relaxed">
|
|
@@ -88,7 +88,7 @@ export function RecipientSelection({
|
|
|
88
88
|
const canConfirm = recipientAddress && isAddressValid;
|
|
89
89
|
|
|
90
90
|
return (
|
|
91
|
-
<div className="recipient-selection mx-auto w-[460px] max-w-full
|
|
91
|
+
<div className="recipient-selection mx-auto w-[460px] max-w-full">
|
|
92
92
|
<div className="flex flex-col gap-6">
|
|
93
93
|
{/* Header */}
|
|
94
94
|
<div className="flex justify-around">
|