@b3dotfun/sdk 0.0.65-alpha.0 → 0.0.65-test.3
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 +77 -35
- package/dist/cjs/anyspend/react/components/AnySpendCustom.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +1 -1
- package/dist/cjs/anyspend/react/components/AnyspendDepositHype.js +1 -1
- package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.d.ts +0 -6
- package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.js +5 -3
- 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 +7 -3
- 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/anyspend/react/hooks/useSigMint.d.ts +1 -1
- package/dist/cjs/global-account/react/components/AccountAssets/AccountAssets.js +38 -2
- package/dist/cjs/global-account/react/components/AvatarEditor/AvatarEditor.js +184 -35
- package/dist/cjs/global-account/react/components/B3DynamicModal.js +23 -12
- package/dist/cjs/global-account/react/components/Deposit/Deposit.d.ts +1 -0
- package/dist/cjs/global-account/react/components/Deposit/Deposit.js +65 -0
- package/dist/cjs/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.d.ts +39 -0
- package/dist/cjs/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.js +37 -0
- package/dist/cjs/global-account/react/components/LinkAccount/LinkAccount.d.ts +6 -4
- package/dist/cjs/global-account/react/components/LinkAccount/LinkAccount.js +113 -279
- package/dist/cjs/global-account/react/components/LinkAccount/LinkNewAccount.d.ts +4 -0
- package/dist/cjs/global-account/react/components/LinkAccount/LinkNewAccount.js +331 -0
- package/dist/cjs/global-account/react/components/ManageAccount/AppsContent.d.ts +6 -0
- package/dist/cjs/global-account/react/components/ManageAccount/AppsContent.js +34 -0
- package/dist/cjs/global-account/react/components/ManageAccount/BalanceContent.js +6 -5
- package/dist/cjs/global-account/react/components/ManageAccount/BottomNavigation.d.ts +2 -0
- package/dist/cjs/global-account/react/components/ManageAccount/BottomNavigation.js +23 -0
- package/dist/cjs/global-account/react/components/ManageAccount/Header.d.ts +3 -0
- package/dist/cjs/global-account/react/components/ManageAccount/Header.js +120 -0
- package/dist/cjs/global-account/react/components/ManageAccount/HomeActions.d.ts +5 -0
- package/dist/cjs/global-account/react/components/ManageAccount/HomeActions.js +43 -0
- package/dist/cjs/global-account/react/components/ManageAccount/HomeContent.d.ts +6 -0
- package/dist/cjs/global-account/react/components/ManageAccount/HomeContent.js +16 -0
- package/dist/cjs/global-account/react/components/ManageAccount/ManageAccount.js +24 -193
- package/dist/cjs/global-account/react/components/ManageAccount/NFTContent.d.ts +2 -0
- package/dist/cjs/global-account/react/components/ManageAccount/NFTContent.js +15 -0
- package/dist/cjs/global-account/react/components/ManageAccount/ProfileSection.d.ts +2 -0
- package/dist/cjs/global-account/react/components/ManageAccount/ProfileSection.js +47 -0
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsContent.d.ts +7 -0
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsContent.js +50 -0
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsMenuItem.d.ts +9 -0
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsMenuItem.js +8 -0
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsProfileCard.d.ts +2 -0
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsProfileCard.js +106 -0
- package/dist/cjs/global-account/react/components/ManageAccount/TokenContent.d.ts +2 -0
- package/dist/cjs/global-account/react/components/ManageAccount/TokenContent.js +22 -0
- package/dist/cjs/global-account/react/components/ModalHeader/ModalHeader.d.ts +10 -0
- package/dist/cjs/global-account/react/components/ModalHeader/ModalHeader.js +12 -0
- package/dist/cjs/global-account/react/components/Send/Send.d.ts +5 -0
- package/dist/cjs/global-account/react/components/Send/Send.js +187 -0
- package/dist/cjs/global-account/react/components/SignInWithB3/SignIn.js +3 -1
- package/dist/cjs/global-account/react/components/icons/BellIcon.d.ts +3 -0
- package/dist/cjs/global-account/react/components/icons/BellIcon.js +5 -0
- package/dist/cjs/global-account/react/components/icons/ChevronDownIcon.d.ts +2 -0
- package/dist/cjs/global-account/react/components/icons/ChevronDownIcon.js +7 -0
- package/dist/cjs/global-account/react/components/icons/CopyIcon.d.ts +2 -0
- package/dist/cjs/global-account/react/components/icons/CopyIcon.js +7 -0
- package/dist/cjs/global-account/react/components/icons/LinkIcon.d.ts +3 -0
- package/dist/cjs/global-account/react/components/icons/LinkIcon.js +5 -0
- package/dist/cjs/global-account/react/components/icons/LockIcon.d.ts +3 -0
- package/dist/cjs/global-account/react/components/icons/LockIcon.js +5 -0
- package/dist/cjs/global-account/react/components/icons/WalletIcon.d.ts +2 -0
- package/dist/cjs/global-account/react/components/icons/WalletIcon.js +7 -0
- package/dist/cjs/global-account/react/components/index.d.ts +5 -4
- package/dist/cjs/global-account/react/components/index.js +14 -9
- 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 +3 -1
- package/dist/cjs/global-account/react/hooks/useAccountWallet.d.ts +1 -0
- package/dist/cjs/global-account/react/hooks/useAccountWallet.js +18 -0
- package/dist/cjs/global-account/react/hooks/useAuthentication.d.ts +2 -2
- package/dist/cjs/global-account/react/hooks/useB3BalanceFromAddresses.js +1 -0
- package/dist/cjs/global-account/react/hooks/useUserQuery.d.ts +2 -2
- package/dist/cjs/global-account/react/stores/index.d.ts +1 -0
- package/dist/cjs/global-account/react/stores/index.js +3 -1
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +31 -6
- package/dist/cjs/global-account/react/stores/useRecentAddressesStore.d.ts +25 -0
- package/dist/cjs/global-account/react/stores/useRecentAddressesStore.js +36 -0
- package/dist/cjs/global-account/react/utils/profileDisplay.d.ts +2 -0
- package/dist/cjs/global-account/react/utils/profileDisplay.js +2 -2
- package/dist/cjs/shared/constants/chains/supported.d.ts +3 -3
- package/dist/cjs/shared/utils/ipfs.js +10 -3
- package/dist/esm/anyspend/react/components/AnySpend.js +78 -36
- package/dist/esm/anyspend/react/components/AnySpendCustom.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +1 -1
- package/dist/esm/anyspend/react/components/AnyspendDepositHype.js +1 -1
- package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.d.ts +0 -6
- package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.js +5 -3
- 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 +6 -5
- 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/anyspend/react/hooks/useSigMint.d.ts +1 -1
- package/dist/esm/global-account/react/components/AccountAssets/AccountAssets.js +38 -2
- package/dist/esm/global-account/react/components/AvatarEditor/AvatarEditor.js +186 -37
- package/dist/esm/global-account/react/components/B3DynamicModal.js +23 -12
- package/dist/esm/global-account/react/components/Deposit/Deposit.d.ts +1 -0
- package/dist/esm/global-account/react/components/Deposit/Deposit.js +59 -0
- package/dist/esm/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.d.ts +39 -0
- package/dist/esm/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.js +34 -0
- package/dist/esm/global-account/react/components/LinkAccount/LinkAccount.d.ts +6 -4
- package/dist/esm/global-account/react/components/LinkAccount/LinkAccount.js +113 -280
- package/dist/esm/global-account/react/components/LinkAccount/LinkNewAccount.d.ts +4 -0
- package/dist/esm/global-account/react/components/LinkAccount/LinkNewAccount.js +325 -0
- package/dist/esm/global-account/react/components/ManageAccount/AppsContent.d.ts +6 -0
- package/dist/esm/global-account/react/components/ManageAccount/AppsContent.js +32 -0
- package/dist/esm/global-account/react/components/ManageAccount/BalanceContent.js +6 -5
- package/dist/esm/global-account/react/components/ManageAccount/BottomNavigation.d.ts +2 -0
- package/dist/esm/global-account/react/components/ManageAccount/BottomNavigation.js +21 -0
- package/dist/esm/global-account/react/components/ManageAccount/Header.d.ts +3 -0
- package/dist/esm/global-account/react/components/ManageAccount/Header.js +81 -0
- package/dist/esm/global-account/react/components/ManageAccount/HomeActions.d.ts +5 -0
- package/dist/esm/global-account/react/components/ManageAccount/HomeActions.js +41 -0
- package/dist/esm/global-account/react/components/ManageAccount/HomeContent.d.ts +6 -0
- package/dist/esm/global-account/react/components/ManageAccount/HomeContent.js +10 -0
- package/dist/esm/global-account/react/components/ManageAccount/ManageAccount.js +26 -195
- package/dist/esm/global-account/react/components/ManageAccount/NFTContent.d.ts +2 -0
- package/dist/esm/global-account/react/components/ManageAccount/NFTContent.js +13 -0
- package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.d.ts +2 -0
- package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.js +45 -0
- package/dist/esm/global-account/react/components/ManageAccount/SettingsContent.d.ts +7 -0
- package/dist/esm/global-account/react/components/ManageAccount/SettingsContent.js +45 -0
- package/dist/esm/global-account/react/components/ManageAccount/SettingsMenuItem.d.ts +9 -0
- package/dist/esm/global-account/react/components/ManageAccount/SettingsMenuItem.js +6 -0
- package/dist/esm/global-account/react/components/ManageAccount/SettingsProfileCard.d.ts +2 -0
- package/dist/esm/global-account/react/components/ManageAccount/SettingsProfileCard.js +101 -0
- package/dist/esm/global-account/react/components/ManageAccount/TokenContent.d.ts +2 -0
- package/dist/esm/global-account/react/components/ManageAccount/TokenContent.js +20 -0
- package/dist/esm/global-account/react/components/ModalHeader/ModalHeader.d.ts +10 -0
- package/dist/esm/global-account/react/components/ModalHeader/ModalHeader.js +10 -0
- package/dist/esm/global-account/react/components/Send/Send.d.ts +5 -0
- package/dist/esm/global-account/react/components/Send/Send.js +181 -0
- package/dist/esm/global-account/react/components/SignInWithB3/SignIn.js +4 -2
- package/dist/esm/global-account/react/components/icons/BellIcon.d.ts +3 -0
- package/dist/esm/global-account/react/components/icons/BellIcon.js +3 -0
- package/dist/esm/global-account/react/components/icons/ChevronDownIcon.d.ts +2 -0
- package/dist/esm/global-account/react/components/icons/ChevronDownIcon.js +4 -0
- package/dist/esm/global-account/react/components/icons/CopyIcon.d.ts +2 -0
- package/dist/esm/global-account/react/components/icons/CopyIcon.js +4 -0
- package/dist/esm/global-account/react/components/icons/LinkIcon.d.ts +3 -0
- package/dist/esm/global-account/react/components/icons/LinkIcon.js +3 -0
- package/dist/esm/global-account/react/components/icons/LockIcon.d.ts +3 -0
- package/dist/esm/global-account/react/components/icons/LockIcon.js +3 -0
- package/dist/esm/global-account/react/components/icons/WalletIcon.d.ts +2 -0
- package/dist/esm/global-account/react/components/icons/WalletIcon.js +4 -0
- package/dist/esm/global-account/react/components/index.d.ts +5 -4
- package/dist/esm/global-account/react/components/index.js +9 -5
- 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/useAccountWallet.d.ts +1 -0
- package/dist/esm/global-account/react/hooks/useAccountWallet.js +17 -0
- package/dist/esm/global-account/react/hooks/useAuthentication.d.ts +2 -2
- package/dist/esm/global-account/react/hooks/useB3BalanceFromAddresses.js +1 -0
- package/dist/esm/global-account/react/hooks/useUserQuery.d.ts +2 -2
- package/dist/esm/global-account/react/stores/index.d.ts +1 -0
- package/dist/esm/global-account/react/stores/index.js +1 -0
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +31 -6
- package/dist/esm/global-account/react/stores/useRecentAddressesStore.d.ts +25 -0
- package/dist/esm/global-account/react/stores/useRecentAddressesStore.js +33 -0
- package/dist/esm/global-account/react/utils/profileDisplay.d.ts +2 -0
- package/dist/esm/global-account/react/utils/profileDisplay.js +2 -2
- package/dist/esm/shared/constants/chains/supported.d.ts +3 -3
- package/dist/esm/shared/utils/ipfs.js +10 -3
- package/dist/styles/index.css +1 -1
- package/dist/types/anyspend/react/components/common/CryptoPaymentMethod.d.ts +0 -6
- package/dist/types/anyspend/react/components/common/OrderHistory.d.ts +1 -1
- package/dist/types/anyspend/react/hooks/useSigMint.d.ts +1 -1
- package/dist/types/global-account/react/components/Deposit/Deposit.d.ts +1 -0
- package/dist/types/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.d.ts +39 -0
- package/dist/types/global-account/react/components/LinkAccount/LinkAccount.d.ts +6 -4
- package/dist/types/global-account/react/components/LinkAccount/LinkNewAccount.d.ts +4 -0
- package/dist/types/global-account/react/components/ManageAccount/AppsContent.d.ts +6 -0
- package/dist/types/global-account/react/components/ManageAccount/BottomNavigation.d.ts +2 -0
- package/dist/types/global-account/react/components/ManageAccount/Header.d.ts +3 -0
- package/dist/types/global-account/react/components/ManageAccount/HomeActions.d.ts +5 -0
- package/dist/types/global-account/react/components/ManageAccount/HomeContent.d.ts +6 -0
- package/dist/types/global-account/react/components/ManageAccount/NFTContent.d.ts +2 -0
- package/dist/types/global-account/react/components/ManageAccount/ProfileSection.d.ts +2 -0
- package/dist/types/global-account/react/components/ManageAccount/SettingsContent.d.ts +7 -0
- package/dist/types/global-account/react/components/ManageAccount/SettingsMenuItem.d.ts +9 -0
- package/dist/types/global-account/react/components/ManageAccount/SettingsProfileCard.d.ts +2 -0
- package/dist/types/global-account/react/components/ManageAccount/TokenContent.d.ts +2 -0
- package/dist/types/global-account/react/components/ModalHeader/ModalHeader.d.ts +10 -0
- package/dist/types/global-account/react/components/Send/Send.d.ts +5 -0
- package/dist/types/global-account/react/components/icons/BellIcon.d.ts +3 -0
- package/dist/types/global-account/react/components/icons/ChevronDownIcon.d.ts +2 -0
- package/dist/types/global-account/react/components/icons/CopyIcon.d.ts +2 -0
- package/dist/types/global-account/react/components/icons/LinkIcon.d.ts +3 -0
- package/dist/types/global-account/react/components/icons/LockIcon.d.ts +3 -0
- package/dist/types/global-account/react/components/icons/WalletIcon.d.ts +2 -0
- package/dist/types/global-account/react/components/index.d.ts +5 -4
- package/dist/types/global-account/react/hooks/index.d.ts +1 -1
- package/dist/types/global-account/react/hooks/useAccountWallet.d.ts +1 -0
- package/dist/types/global-account/react/hooks/useAuthentication.d.ts +2 -2
- package/dist/types/global-account/react/hooks/useUserQuery.d.ts +2 -2
- package/dist/types/global-account/react/stores/index.d.ts +1 -0
- package/dist/types/global-account/react/stores/useModalStore.d.ts +31 -6
- package/dist/types/global-account/react/stores/useRecentAddressesStore.d.ts +25 -0
- package/dist/types/global-account/react/utils/profileDisplay.d.ts +2 -0
- package/dist/types/shared/constants/chains/supported.d.ts +3 -3
- package/package.json +1 -1
- package/src/anyspend/react/components/AnySpend.tsx +229 -170
- package/src/anyspend/react/components/AnySpendCustom.tsx +1 -3
- package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +0 -2
- package/src/anyspend/react/components/AnyspendDepositHype.tsx +0 -2
- package/src/anyspend/react/components/common/CryptoPaymentMethod.tsx +7 -14
- 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 +8 -13
- 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 +115 -25
- package/src/global-account/react/components/AvatarEditor/AvatarEditor.tsx +360 -128
- package/src/global-account/react/components/B3DynamicModal.tsx +28 -14
- package/src/global-account/react/components/Deposit/Deposit.tsx +211 -0
- package/src/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.tsx +84 -0
- package/src/global-account/react/components/LinkAccount/LinkAccount.tsx +332 -433
- package/src/global-account/react/components/LinkAccount/LinkNewAccount.tsx +490 -0
- package/src/global-account/react/components/ManageAccount/AppsContent.tsx +79 -0
- package/src/global-account/react/components/ManageAccount/BalanceContent.tsx +6 -10
- package/src/global-account/react/components/ManageAccount/BottomNavigation.tsx +83 -0
- package/src/global-account/react/components/ManageAccount/Header.tsx +230 -0
- package/src/global-account/react/components/ManageAccount/HomeActions.tsx +118 -0
- package/src/global-account/react/components/ManageAccount/HomeContent.tsx +42 -0
- package/src/global-account/react/components/ManageAccount/ManageAccount.tsx +73 -589
- package/src/global-account/react/components/ManageAccount/NFTContent.tsx +24 -0
- package/src/global-account/react/components/ManageAccount/ProfileSection.tsx +72 -0
- package/src/global-account/react/components/ManageAccount/SettingsContent.tsx +87 -0
- package/src/global-account/react/components/ManageAccount/SettingsMenuItem.tsx +31 -0
- package/src/global-account/react/components/ManageAccount/SettingsProfileCard.tsx +180 -0
- package/src/global-account/react/components/ManageAccount/TokenContent.tsx +41 -0
- package/src/global-account/react/components/ModalHeader/ModalHeader.tsx +50 -0
- package/src/global-account/react/components/Send/Send.tsx +585 -0
- package/src/global-account/react/components/SignInWithB3/SignIn.tsx +11 -7
- package/src/global-account/react/components/icons/BellIcon.tsx +15 -0
- package/src/global-account/react/components/icons/ChevronDownIcon.tsx +17 -0
- package/src/global-account/react/components/icons/CopyIcon.tsx +22 -0
- package/src/global-account/react/components/icons/LinkIcon.tsx +15 -0
- package/src/global-account/react/components/icons/LockIcon.tsx +15 -0
- package/src/global-account/react/components/icons/WalletIcon.tsx +21 -0
- package/src/global-account/react/components/index.ts +11 -5
- package/src/global-account/react/components/ui/Tabs.tsx +5 -13
- package/src/global-account/react/components/ui/dialog.tsx +32 -14
- package/src/global-account/react/hooks/index.ts +3 -0
- package/src/global-account/react/hooks/useAccountWallet.tsx +26 -0
- package/src/global-account/react/hooks/useB3BalanceFromAddresses.ts +1 -0
- package/src/global-account/react/stores/index.ts +1 -0
- package/src/global-account/react/stores/useModalStore.ts +35 -6
- package/src/global-account/react/stores/useRecentAddressesStore.ts +55 -0
- package/src/global-account/react/utils/profileDisplay.ts +4 -2
- package/src/shared/utils/ipfs.ts +10 -3
- package/src/styles/index.css +6 -1
- package/dist/cjs/global-account/react/components/ProfileEditor/ProfileEditor.d.ts +0 -6
- package/dist/cjs/global-account/react/components/ProfileEditor/ProfileEditor.js +0 -141
- package/dist/esm/global-account/react/components/ProfileEditor/ProfileEditor.d.ts +0 -6
- package/dist/esm/global-account/react/components/ProfileEditor/ProfileEditor.js +0 -135
- package/dist/types/global-account/react/components/ProfileEditor/ProfileEditor.d.ts +0 -6
- package/src/global-account/react/components/ProfileEditor/ProfileEditor.tsx +0 -265
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SVGProps } from "react";
|
|
2
|
+
|
|
3
|
+
export function CopyIcon({ className, ...props }: SVGProps<SVGSVGElement>) {
|
|
4
|
+
return (
|
|
5
|
+
<svg
|
|
6
|
+
width="12"
|
|
7
|
+
height="12"
|
|
8
|
+
viewBox="0 0 12 12"
|
|
9
|
+
fill="none"
|
|
10
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
11
|
+
className={className}
|
|
12
|
+
{...props}
|
|
13
|
+
>
|
|
14
|
+
<path
|
|
15
|
+
d="M3.33333 3.33333V2C3.33333 1.63181 3.63181 1.33333 4 1.33333H10C10.3682 1.33333 10.6667 1.63181 10.6667 2V8C10.6667 8.36819 10.3682 8.66667 10 8.66667H8.66667M2 3.33333H8C8.36819 3.33333 8.66667 3.63181 8.66667 4V10C8.66667 10.3682 8.36819 10.6667 8 10.6667H2C1.63181 10.6667 1.33333 10.3682 1.33333 10V4C1.33333 3.63181 1.63181 3.33333 2 3.33333Z"
|
|
16
|
+
stroke="currentColor"
|
|
17
|
+
strokeLinecap="round"
|
|
18
|
+
strokeLinejoin="round"
|
|
19
|
+
/>
|
|
20
|
+
</svg>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SVGProps } from "react";
|
|
2
|
+
|
|
3
|
+
const LinkIcon = (props: SVGProps<SVGSVGElement>) => (
|
|
4
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
|
|
5
|
+
<path
|
|
6
|
+
d="M10.8333 9.16667L15.8333 4.16667M17.5 2.5L15.8333 4.16667L17.5 2.5ZM11.6667 4.16667H15.8333V8.33333L11.6667 4.16667ZM9.16667 10.8333L4.16667 15.8333L9.16667 10.8333ZM8.33333 15.8333H4.16667V11.6667L8.33333 15.8333ZM15.8333 10V15.8333H10L15.8333 10ZM4.16667 4.16667V10L10 4.16667H4.16667Z"
|
|
7
|
+
stroke="currentColor"
|
|
8
|
+
strokeWidth="1.5"
|
|
9
|
+
strokeLinecap="round"
|
|
10
|
+
strokeLinejoin="round"
|
|
11
|
+
/>
|
|
12
|
+
</svg>
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
export default LinkIcon;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SVGProps } from "react";
|
|
2
|
+
|
|
3
|
+
const LockIcon = (props: SVGProps<SVGSVGElement>) => (
|
|
4
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
|
|
5
|
+
<path
|
|
6
|
+
d="M14.1667 9.16667V6.66667C14.1667 4.36548 12.3012 2.5 10 2.5C7.69881 2.5 5.83333 4.36548 5.83333 6.66667V9.16667M7.5 14.1667C7.5 15.0871 8.24619 15.8333 9.16667 15.8333H10.8333C11.7538 15.8333 12.5 15.0871 12.5 14.1667C12.5 13.2462 11.7538 12.5 10.8333 12.5H9.16667C8.24619 12.5 7.5 11.7538 7.5 10.8333C7.5 9.91286 8.24619 9.16667 9.16667 9.16667H10.8333C11.7538 9.16667 12.5 9.91286 12.5 10.8333"
|
|
7
|
+
stroke="currentColor"
|
|
8
|
+
strokeWidth="1.5"
|
|
9
|
+
strokeLinecap="round"
|
|
10
|
+
strokeLinejoin="round"
|
|
11
|
+
/>
|
|
12
|
+
</svg>
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
export default LockIcon;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SVGProps } from "react";
|
|
2
|
+
|
|
3
|
+
export function WalletIcon({ className, ...props }: SVGProps<SVGSVGElement>) {
|
|
4
|
+
return (
|
|
5
|
+
<svg
|
|
6
|
+
width="40"
|
|
7
|
+
height="40"
|
|
8
|
+
viewBox="0 0 40 40"
|
|
9
|
+
fill="none"
|
|
10
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
11
|
+
className={className}
|
|
12
|
+
{...props}
|
|
13
|
+
>
|
|
14
|
+
<rect width="40" height="40" rx="20" fill="#F4F4F5" />
|
|
15
|
+
<path
|
|
16
|
+
d="M28 16H27V14C27 13.4696 26.7893 12.9609 26.4142 12.5858C26.0391 12.2107 25.5304 12 25 12H15C14.4696 12 13.9609 12.2107 13.5858 12.5858C13.2107 12.9609 13 13.4696 13 14V26C13 26.5304 13.2107 27.0391 13.5858 27.4142C13.9609 27.7893 14.4696 28 15 28H27C27.5304 28 28.0391 27.7893 28.4142 27.4142C28.7893 27.0391 29 26.5304 29 26V18C29 17.4696 28.7893 16.9609 28.4142 16.5858C28.0391 16.2107 27.5304 16 27 16ZM15 14H25V16H15V14ZM27 22H25C24.7348 22 24.4804 21.8946 24.2929 21.7071C24.1054 21.5196 24 21.2652 24 21C24 20.7348 24.1054 20.4804 24.2929 20.2929C24.4804 20.1054 24.7348 20 25 20H27V22Z"
|
|
17
|
+
fill="#71717A"
|
|
18
|
+
/>
|
|
19
|
+
</svg>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// TODO woj: Barrel file for all components, this might be reason of bundle size issues
|
|
1
2
|
// Core Components
|
|
2
3
|
export { B3DynamicModal } from "./B3DynamicModal";
|
|
3
4
|
export { B3Provider, InnerProvider } from "./B3Provider/B3Provider";
|
|
@@ -19,9 +20,14 @@ export { getConnectOptionsFromStrategy, isWalletType, type AllowedStrategy } fro
|
|
|
19
20
|
// ManageAccount Components
|
|
20
21
|
export { ManageAccount } from "./ManageAccount/ManageAccount";
|
|
21
22
|
|
|
22
|
-
//
|
|
23
|
-
export {
|
|
24
|
-
|
|
23
|
+
// Deposit Components
|
|
24
|
+
export { Deposit } from "./Deposit/Deposit";
|
|
25
|
+
|
|
26
|
+
// Send Components
|
|
27
|
+
export { Send } from "./Send/Send";
|
|
28
|
+
|
|
29
|
+
// Media Components
|
|
30
|
+
export { IPFSMediaRenderer } from "./IPFSMediaRenderer/IPFSMediaRenderer";
|
|
25
31
|
|
|
26
32
|
// RequestPermissions Components
|
|
27
33
|
export { RequestPermissions } from "./RequestPermissions/RequestPermissions";
|
|
@@ -100,12 +106,12 @@ export { ScrollArea, ScrollBar } from "./ui/scroll-area";
|
|
|
100
106
|
export { ShinyButton } from "./ui/ShinyButton";
|
|
101
107
|
export { Skeleton } from "./ui/skeleton";
|
|
102
108
|
export {
|
|
103
|
-
TabTrigger as TabTriggerPrimitive,
|
|
104
109
|
TabsContent as TabsContentPrimitive,
|
|
105
110
|
TabsList as TabsListPrimitive,
|
|
106
111
|
Tabs as TabsPrimitive,
|
|
112
|
+
TabTrigger as TabTriggerPrimitive,
|
|
107
113
|
} from "./ui/Tabs";
|
|
108
|
-
export {
|
|
114
|
+
export { Tabs, TabsContent, TabsList, TabsTransitionWrapper, TabTrigger } from "./ui/TabSystem";
|
|
109
115
|
export { TextLoop } from "./ui/text-loop";
|
|
110
116
|
export { TextShimmer } from "./ui/text-shimmer";
|
|
111
117
|
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./ui/tooltip";
|
|
@@ -16,26 +16,18 @@ export const Tabs = ({
|
|
|
16
16
|
);
|
|
17
17
|
|
|
18
18
|
export function TabsList({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.List>) {
|
|
19
|
-
return (
|
|
20
|
-
<TabsPrimitive.List
|
|
21
|
-
className={cn(
|
|
22
|
-
"border-b3-react-border bg-b3-react-background inline-flex h-12 w-full items-center justify-center rounded-lg border",
|
|
23
|
-
className,
|
|
24
|
-
)}
|
|
25
|
-
{...props}
|
|
26
|
-
/>
|
|
27
|
-
);
|
|
19
|
+
return <TabsPrimitive.List className={cn("", className)} {...props} />;
|
|
28
20
|
}
|
|
29
21
|
|
|
30
22
|
export function TabTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger>) {
|
|
31
23
|
return (
|
|
32
24
|
<TabsPrimitive.Trigger
|
|
33
25
|
className={cn(
|
|
34
|
-
"inline-flex h-full items-center justify-center whitespace-nowrap px-3
|
|
26
|
+
"text-md inline-flex h-full items-center justify-center whitespace-nowrap px-3 font-semibold transition-all",
|
|
35
27
|
"focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50",
|
|
36
|
-
"data-[state=active]:
|
|
37
|
-
"
|
|
38
|
-
"flex-1
|
|
28
|
+
"data-[state=active]:text-b3-react-primary data-[state=active]:font-bold",
|
|
29
|
+
"hover:text-b3-react-foreground data-[state=inactive]:text-b3-react-muted-foreground",
|
|
30
|
+
"flex-1",
|
|
39
31
|
className,
|
|
40
32
|
)}
|
|
41
33
|
{...props}
|
|
@@ -42,7 +42,7 @@ type DialogContentProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.
|
|
|
42
42
|
|
|
43
43
|
const DialogContent: React.ForwardRefExoticComponent<DialogContentProps & React.RefAttributes<DialogContentElement>> =
|
|
44
44
|
React.forwardRef<DialogContentElement, DialogContentProps>(
|
|
45
|
-
({ className, children, hideCloseButton =
|
|
45
|
+
({ className, children, hideCloseButton = true, closeBtnClassName, ...props }, ref) => {
|
|
46
46
|
const container = typeof window !== "undefined" ? document.getElementById("b3-root") : null;
|
|
47
47
|
return (
|
|
48
48
|
<DialogPortal container={container}>
|
|
@@ -50,7 +50,7 @@ const DialogContent: React.ForwardRefExoticComponent<DialogContentProps & React.
|
|
|
50
50
|
<DialogPrimitive.Content
|
|
51
51
|
ref={ref}
|
|
52
52
|
className={cn(
|
|
53
|
-
"
|
|
53
|
+
"fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 border shadow-lg !outline-none",
|
|
54
54
|
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 duration-500",
|
|
55
55
|
"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
56
56
|
"data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",
|
|
@@ -60,18 +60,36 @@ const DialogContent: React.ForwardRefExoticComponent<DialogContentProps & React.
|
|
|
60
60
|
)}
|
|
61
61
|
{...props}
|
|
62
62
|
>
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
63
|
+
<div className="flex flex-1 flex-col overflow-hidden rounded-xl border border-[#D1D1D6] bg-white shadow-[0_20px_24px_-4px_rgba(10,13,18,0.08),0_8px_8px_-4px_rgba(10,13,18,0.03),0_3px_3px_-1.5px_rgba(10,13,18,0.04)]">
|
|
64
|
+
{children}
|
|
65
|
+
{!hideCloseButton && (
|
|
66
|
+
<DialogPrimitive.Close
|
|
67
|
+
className={cn(
|
|
68
|
+
"modal-close-button data-[state=open]:bg-b3-react-background data-[state=open]:text-b3-react-muted-foreground absolute right-2 top-2 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none disabled:pointer-events-none dark:data-[state=open]:bg-gray-800 dark:data-[state=open]:text-gray-400",
|
|
69
|
+
closeBtnClassName,
|
|
70
|
+
)}
|
|
71
|
+
>
|
|
72
|
+
<X className="h-5 w-5" />
|
|
73
|
+
<span className="sr-only">Close</span>
|
|
74
|
+
</DialogPrimitive.Close>
|
|
75
|
+
)}
|
|
76
|
+
</div>
|
|
77
|
+
{/* Global Account Footer */}
|
|
78
|
+
<div className="flex items-center justify-center gap-1.5 pt-[10px]">
|
|
79
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
80
|
+
<path
|
|
81
|
+
d="M2 4.66667C2 3.19391 3.19391 2 4.66667 2H11.3333C12.8061 2 14 3.19391 14 4.66667V11.3333C14 12.8061 12.8061 14 11.3333 14H4.66667C3.19391 14 2 12.8061 2 11.3333V4.66667Z"
|
|
82
|
+
fill="#0B57C2"
|
|
83
|
+
/>
|
|
84
|
+
<path
|
|
85
|
+
d="M5.33333 6C5.33333 5.63181 5.63181 5.33333 6 5.33333H10C10.3682 5.33333 10.6667 5.63181 10.6667 6V10C10.6667 10.3682 10.3682 10.6667 10 10.6667H6C5.63181 10.6667 5.33333 10.3682 5.33333 10V6Z"
|
|
86
|
+
fill="white"
|
|
87
|
+
/>
|
|
88
|
+
</svg>
|
|
89
|
+
<span className="font-neue-montreal-semibold text-xs uppercase leading-none tracking-[0.72px] text-[#0B57C2]">
|
|
90
|
+
Global Account
|
|
91
|
+
</span>
|
|
92
|
+
</div>
|
|
75
93
|
</DialogPrimitive.Content>
|
|
76
94
|
</DialogPortal>
|
|
77
95
|
);
|
|
@@ -26,9 +26,12 @@ export { useOneBalance } from "./useOneBalance";
|
|
|
26
26
|
export {
|
|
27
27
|
useProfile,
|
|
28
28
|
useProfilePreference,
|
|
29
|
+
useProfileSettings,
|
|
30
|
+
useDisplayName,
|
|
29
31
|
type CombinedProfile,
|
|
30
32
|
type PreferenceRequestBody,
|
|
31
33
|
type Profile,
|
|
34
|
+
type DisplayNameRequestBody,
|
|
32
35
|
} from "./useProfile";
|
|
33
36
|
export { useQueryB3 } from "./useQueryB3";
|
|
34
37
|
export { useQueryBSMNT } from "./useQueryBSMNT";
|
|
@@ -112,3 +112,29 @@ export function useAccountWallet(): {
|
|
|
112
112
|
|
|
113
113
|
return res;
|
|
114
114
|
}
|
|
115
|
+
|
|
116
|
+
export function useAccountWalletImage(): string {
|
|
117
|
+
const { account, user } = useB3();
|
|
118
|
+
|
|
119
|
+
const activeWallet = useActiveWallet();
|
|
120
|
+
const connectedWallets = useConnectedWallets();
|
|
121
|
+
|
|
122
|
+
const connectedSmartWallet = connectedWallets.find(wallet => wallet.id === ecosystemWalletId);
|
|
123
|
+
const connectedEOAWallet = connectedWallets.find(wallet => wallet.id !== ecosystemWalletId);
|
|
124
|
+
const isActiveSmartWallet = activeWallet?.id === connectedSmartWallet?.id;
|
|
125
|
+
|
|
126
|
+
const { data: walletImage } = useWalletImage(connectedEOAWallet?.id);
|
|
127
|
+
|
|
128
|
+
// If not EOA sign in, then we need to show the smart wallet icon
|
|
129
|
+
const lastAuthProvider = useLastAuthProvider();
|
|
130
|
+
|
|
131
|
+
const smartWalletIcon =
|
|
132
|
+
lastAuthProvider && !connectedEOAWallet
|
|
133
|
+
? socialIcons[lastAuthProvider as keyof typeof socialIcons]
|
|
134
|
+
: "https://gradvatar.com/0x0000000000000000000000000000000000000000"; // show smart wallet of eoa wallet is gradvatar
|
|
135
|
+
|
|
136
|
+
const { data: profileData } = useProfile({ address: account?.address });
|
|
137
|
+
const avatarUrl = user?.avatar || profileData?.avatar;
|
|
138
|
+
|
|
139
|
+
return avatarUrl || (isActiveSmartWallet ? smartWalletIcon : walletImage) || "";
|
|
140
|
+
}
|
|
@@ -104,6 +104,7 @@ export function useB3BalanceFromAddresses(
|
|
|
104
104
|
enabled: (options?.enabled ?? true) && normalizedAddresses.length > 0,
|
|
105
105
|
refetchInterval: options?.refetchInterval ?? 30000, // Default 30s refresh
|
|
106
106
|
staleTime: 10000, // Consider data stale after 10s
|
|
107
|
+
structuralSharing: false, // Disable structural sharing because data contains BigInt values
|
|
107
108
|
});
|
|
108
109
|
}
|
|
109
110
|
|
|
@@ -82,9 +82,9 @@ export interface ManageAccountModalProps extends BaseModalProps {
|
|
|
82
82
|
/** Partner ID */
|
|
83
83
|
partnerId: string;
|
|
84
84
|
/** Active Tab */
|
|
85
|
-
activeTab?: "
|
|
85
|
+
activeTab?: "home" | "tokens" | "nfts" | "apps" | "settings" | "swap";
|
|
86
86
|
/** Function to set the active tab */
|
|
87
|
-
setActiveTab?: (tab: "
|
|
87
|
+
setActiveTab?: (tab: "home" | "tokens" | "nfts" | "apps" | "settings" | "swap") => void;
|
|
88
88
|
/** Whether to show the referral information */
|
|
89
89
|
showReferralInfo?: boolean;
|
|
90
90
|
/** Whether to show the swap button */
|
|
@@ -345,6 +345,16 @@ export interface LinkAccountModalProps extends BaseModalProps {
|
|
|
345
345
|
chain: Chain;
|
|
346
346
|
}
|
|
347
347
|
|
|
348
|
+
export interface LinkNewAccountModalProps extends BaseModalProps {
|
|
349
|
+
type: "linkNewAccount";
|
|
350
|
+
showBackButton?: boolean;
|
|
351
|
+
onSuccess?: () => void;
|
|
352
|
+
onError?: (error: Error) => void;
|
|
353
|
+
onClose?: () => void;
|
|
354
|
+
partnerId: string;
|
|
355
|
+
chain: Chain;
|
|
356
|
+
}
|
|
357
|
+
|
|
348
358
|
export interface AnySpendDepositHypeProps extends BaseModalProps {
|
|
349
359
|
/** Modal type identifier */
|
|
350
360
|
type: "anySpendDepositHype";
|
|
@@ -373,13 +383,30 @@ export interface AvatarEditorModalProps extends BaseModalProps {
|
|
|
373
383
|
onSuccess?: () => void;
|
|
374
384
|
}
|
|
375
385
|
|
|
376
|
-
|
|
386
|
+
/**
|
|
387
|
+
* Props for the Deposit modal
|
|
388
|
+
* Allows users to deposit tokens into their global account
|
|
389
|
+
*/
|
|
390
|
+
export interface DepositModalProps extends BaseModalProps {
|
|
377
391
|
/** Modal type identifier */
|
|
378
|
-
type: "
|
|
379
|
-
/** Callback function called when
|
|
392
|
+
type: "deposit";
|
|
393
|
+
/** Callback function called when deposit is successful */
|
|
380
394
|
onSuccess?: () => void;
|
|
381
395
|
}
|
|
382
396
|
|
|
397
|
+
/**
|
|
398
|
+
* Props for the Send modal
|
|
399
|
+
* Allows users to send tokens from their global account to another address
|
|
400
|
+
*/
|
|
401
|
+
export interface SendModalProps extends BaseModalProps {
|
|
402
|
+
/** Modal type identifier */
|
|
403
|
+
type: "send";
|
|
404
|
+
/** Pre-filled recipient address (optional) */
|
|
405
|
+
recipientAddress?: string;
|
|
406
|
+
/** Callback function called when send is successful */
|
|
407
|
+
onSuccess?: (txHash?: string) => void;
|
|
408
|
+
}
|
|
409
|
+
|
|
383
410
|
/**
|
|
384
411
|
* Union type of all possible modal content types
|
|
385
412
|
*/
|
|
@@ -401,9 +428,11 @@ export type ModalContentType =
|
|
|
401
428
|
| AnySpendSignatureMintProps
|
|
402
429
|
| AnySpendBondKitProps
|
|
403
430
|
| LinkAccountModalProps
|
|
431
|
+
| LinkNewAccountModalProps
|
|
404
432
|
| AnySpendDepositHypeProps
|
|
405
433
|
| AvatarEditorModalProps
|
|
406
|
-
|
|
|
434
|
+
| DepositModalProps
|
|
435
|
+
| SendModalProps;
|
|
407
436
|
// Add other modal types here like: | OtherModalProps | AnotherModalProps
|
|
408
437
|
|
|
409
438
|
/**
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { create } from "zustand";
|
|
2
|
+
import { persist } from "zustand/middleware";
|
|
3
|
+
|
|
4
|
+
interface RecentAddress {
|
|
5
|
+
address: string;
|
|
6
|
+
timestamp: number;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
interface RecentAddressesStore {
|
|
10
|
+
recentAddresses: RecentAddress[];
|
|
11
|
+
addRecentAddress: (address: string) => void;
|
|
12
|
+
clearRecentAddresses: () => void;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Store for managing recently used addresses in the Send flow
|
|
17
|
+
* Persists to localStorage and keeps the last 6 unique addresses
|
|
18
|
+
*/
|
|
19
|
+
export const useRecentAddressesStore = create<RecentAddressesStore>()(
|
|
20
|
+
persist(
|
|
21
|
+
set => ({
|
|
22
|
+
recentAddresses: [],
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Add a new address to the recent addresses list
|
|
26
|
+
* Deduplicates and maintains a maximum of 6 addresses
|
|
27
|
+
*/
|
|
28
|
+
addRecentAddress: (address: string) => {
|
|
29
|
+
set(state => {
|
|
30
|
+
// Remove any existing entry with the same address
|
|
31
|
+
const filtered = state.recentAddresses.filter(item => item.address.toLowerCase() !== address.toLowerCase());
|
|
32
|
+
|
|
33
|
+
// Add the new address at the beginning
|
|
34
|
+
const updated = [{ address, timestamp: Date.now() }, ...filtered];
|
|
35
|
+
|
|
36
|
+
// Keep only the last 6 addresses
|
|
37
|
+
return {
|
|
38
|
+
recentAddresses: updated.slice(0, 6),
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Clear all recent addresses
|
|
45
|
+
*/
|
|
46
|
+
clearRecentAddresses: () => {
|
|
47
|
+
set({ recentAddresses: [] });
|
|
48
|
+
},
|
|
49
|
+
}),
|
|
50
|
+
{
|
|
51
|
+
name: "b3-recent-addresses-storage",
|
|
52
|
+
},
|
|
53
|
+
),
|
|
54
|
+
);
|
|
55
|
+
|
|
@@ -71,6 +71,8 @@ export interface ExtendedProfileDetails {
|
|
|
71
71
|
name?: string;
|
|
72
72
|
username?: string;
|
|
73
73
|
profileImageUrl?: string;
|
|
74
|
+
picture?: string; // Google OAuth uses 'picture' field
|
|
75
|
+
pfpUrl?: string; // Farcaster uses 'pfpUrl' field
|
|
74
76
|
}
|
|
75
77
|
|
|
76
78
|
export interface ExtendedProfile extends Omit<Profile, "details"> {
|
|
@@ -112,7 +114,7 @@ export function getProfileDisplayInfo(profile: ExtendedProfile): ProfileDisplayI
|
|
|
112
114
|
displayInfo = {
|
|
113
115
|
title: details.name || details.username || "Unknown",
|
|
114
116
|
subtitle: details.username ? `@${details.username}` : "Farcaster Account",
|
|
115
|
-
imageUrl: validateImageUrl(details.profileImageUrl),
|
|
117
|
+
imageUrl: validateImageUrl(details.pfpUrl || details.profileImageUrl),
|
|
116
118
|
initial: "F",
|
|
117
119
|
type,
|
|
118
120
|
};
|
|
@@ -121,7 +123,7 @@ export function getProfileDisplayInfo(profile: ExtendedProfile): ProfileDisplayI
|
|
|
121
123
|
displayInfo = {
|
|
122
124
|
title: details.name || details.email || "Unknown",
|
|
123
125
|
subtitle: details.email || "Google Account",
|
|
124
|
-
imageUrl: validateImageUrl(details.profileImageUrl),
|
|
126
|
+
imageUrl: validateImageUrl(details.picture || details.profileImageUrl),
|
|
125
127
|
initial: "G",
|
|
126
128
|
type,
|
|
127
129
|
};
|
package/src/shared/utils/ipfs.ts
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* List of IPFS gateways to use for converting ipfs:// URLs to HTTP URLs
|
|
3
|
+
* These gateways must match the allowed list in profileDisplay.ts validateImageUrl()
|
|
4
|
+
*/
|
|
1
5
|
const IPFS_GATEWAYS = [
|
|
2
|
-
"https://ipfs.
|
|
3
|
-
"https://
|
|
4
|
-
//
|
|
6
|
+
"https://cloudflare-ipfs.com/ipfs", // Primary gateway - fast and reliable
|
|
7
|
+
"https://ipfs.io/ipfs", // Fallback gateway
|
|
8
|
+
"https://gateway.pinata.cloud/ipfs", // Additional option
|
|
9
|
+
"https://dweb.link/ipfs", // Additional option
|
|
10
|
+
"https://nftstorage.link/ipfs", // Additional option
|
|
11
|
+
"https://w3s.link/ipfs", // Additional option
|
|
5
12
|
] as const;
|
|
6
13
|
|
|
7
14
|
/**
|
package/src/styles/index.css
CHANGED
|
@@ -278,10 +278,15 @@ html[data-theme="dark"] .b3-root,
|
|
|
278
278
|
|
|
279
279
|
/* Custom component styles */
|
|
280
280
|
.b3-modal {
|
|
281
|
-
@apply
|
|
281
|
+
@apply text-b3-react-foreground rounded-2xl border;
|
|
282
282
|
border: 1px solid var(--border);
|
|
283
283
|
overflow: hidden;
|
|
284
284
|
outline: none;
|
|
285
|
+
padding: 10px;
|
|
286
|
+
|
|
287
|
+
@media (min-width: 768px) {
|
|
288
|
+
background: #e4e4e7;
|
|
289
|
+
}
|
|
285
290
|
}
|
|
286
291
|
|
|
287
292
|
.b3-modal-freestyle {
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
"use client";
|
|
3
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
-
};
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.ProfileEditor = ProfileEditor;
|
|
8
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
9
|
-
const app_1 = __importDefault(require("../../../../global-account/app"));
|
|
10
|
-
const react_1 = require("../../../../global-account/react");
|
|
11
|
-
const profileDisplay_1 = require("../../../../global-account/react/utils/profileDisplay");
|
|
12
|
-
const cn_1 = require("../../../../shared/utils/cn");
|
|
13
|
-
const debug_1 = require("../../../../shared/utils/debug");
|
|
14
|
-
const ipfs_1 = require("../../../../shared/utils/ipfs");
|
|
15
|
-
const thirdweb_1 = require("../../../../shared/utils/thirdweb");
|
|
16
|
-
const lucide_react_1 = require("lucide-react");
|
|
17
|
-
const react_2 = require("react");
|
|
18
|
-
const sonner_1 = require("sonner");
|
|
19
|
-
const react_3 = require("thirdweb/react");
|
|
20
|
-
const storage_1 = require("thirdweb/storage");
|
|
21
|
-
const debug = (0, debug_1.debugB3React)("ProfileEditor");
|
|
22
|
-
function ProfileEditor({ onSuccess, className }) {
|
|
23
|
-
const [selectedFile, setSelectedFile] = (0, react_2.useState)(null);
|
|
24
|
-
const [previewUrl, setPreviewUrl] = (0, react_2.useState)(null);
|
|
25
|
-
const [username, setUsername] = (0, react_2.useState)("");
|
|
26
|
-
const [isUploading, setIsUploading] = (0, react_2.useState)(false);
|
|
27
|
-
const [isSaving, setIsSaving] = (0, react_2.useState)(false);
|
|
28
|
-
const fileInputRef = (0, react_2.useRef)(null);
|
|
29
|
-
const { user, setUser } = (0, react_1.useB3)();
|
|
30
|
-
const account = (0, react_3.useActiveAccount)();
|
|
31
|
-
const { data: profile, refetch: refreshProfile } = (0, react_1.useProfile)({
|
|
32
|
-
address: account?.address,
|
|
33
|
-
fresh: true,
|
|
34
|
-
});
|
|
35
|
-
const rawAvatarUrl = user?.avatar ? (0, ipfs_1.getIpfsUrl)(user?.avatar) : profile?.avatar;
|
|
36
|
-
const avatarUrl = (0, profileDisplay_1.validateImageUrl)(rawAvatarUrl);
|
|
37
|
-
const safePreviewUrl = (0, profileDisplay_1.validateImageUrl)(previewUrl);
|
|
38
|
-
const hasAvatar = !!avatarUrl;
|
|
39
|
-
const currentUsername = user?.username || "";
|
|
40
|
-
const handleFileSelect = (event) => {
|
|
41
|
-
const file = event.target.files?.[0];
|
|
42
|
-
if (file) {
|
|
43
|
-
// Validate file type
|
|
44
|
-
if (!file.type.startsWith("image/")) {
|
|
45
|
-
sonner_1.toast.error("Please select an image file");
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
// Validate file size (max 5MB)
|
|
49
|
-
if (file.size > 5 * 1024 * 1024) {
|
|
50
|
-
sonner_1.toast.error("File size must be less than 5MB");
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
setSelectedFile(file);
|
|
54
|
-
// Create preview URL
|
|
55
|
-
const url = URL.createObjectURL(file);
|
|
56
|
-
setPreviewUrl(url);
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
const handleRemoveFile = () => {
|
|
60
|
-
setSelectedFile(null);
|
|
61
|
-
if (previewUrl) {
|
|
62
|
-
URL.revokeObjectURL(previewUrl);
|
|
63
|
-
setPreviewUrl(null);
|
|
64
|
-
}
|
|
65
|
-
if (fileInputRef.current) {
|
|
66
|
-
fileInputRef.current.value = "";
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
const handleSave = async () => {
|
|
70
|
-
// Check if there are any changes
|
|
71
|
-
const hasAvatarChange = selectedFile !== null;
|
|
72
|
-
const hasUsernameChange = username.trim() !== "" && username !== currentUsername;
|
|
73
|
-
if (!hasAvatarChange && !hasUsernameChange) {
|
|
74
|
-
sonner_1.toast.error("Please make at least one change");
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
setIsSaving(true);
|
|
78
|
-
try {
|
|
79
|
-
let ipfsUrl;
|
|
80
|
-
// Upload avatar if selected
|
|
81
|
-
if (hasAvatarChange && selectedFile) {
|
|
82
|
-
debug("Starting upload to IPFS", selectedFile);
|
|
83
|
-
setIsUploading(true);
|
|
84
|
-
ipfsUrl = await (0, storage_1.upload)({
|
|
85
|
-
client: thirdweb_1.client,
|
|
86
|
-
files: [selectedFile],
|
|
87
|
-
});
|
|
88
|
-
debug("Upload successful", ipfsUrl);
|
|
89
|
-
setIsUploading(false);
|
|
90
|
-
}
|
|
91
|
-
// Update user profile
|
|
92
|
-
let updatedUser = user;
|
|
93
|
-
// If both avatar and username need updating, do them sequentially
|
|
94
|
-
// Update avatar first if uploaded
|
|
95
|
-
if (ipfsUrl) {
|
|
96
|
-
// @ts-expect-error this resolved fine, look into why expect-error needed
|
|
97
|
-
updatedUser = await app_1.default.service("users").setAvatar({
|
|
98
|
-
avatar: ipfsUrl,
|
|
99
|
-
},
|
|
100
|
-
// @ts-expect-error - our typed client is expecting context even though it's set elsewhere
|
|
101
|
-
{});
|
|
102
|
-
}
|
|
103
|
-
// Update username if changed (this will use the updated user from avatar change if both were updated)
|
|
104
|
-
if (hasUsernameChange && user?._id) {
|
|
105
|
-
// @ts-expect-error this resolved fine, look into why expect-error needed
|
|
106
|
-
updatedUser = await app_1.default.service("users").registerUsername({ username: username },
|
|
107
|
-
// @ts-expect-error - our typed client is expecting context even though it's set elsewhere
|
|
108
|
-
{});
|
|
109
|
-
}
|
|
110
|
-
// Update user state
|
|
111
|
-
setUser(updatedUser);
|
|
112
|
-
// Refresh profile to get updated data
|
|
113
|
-
await refreshProfile();
|
|
114
|
-
// Show success message
|
|
115
|
-
const changes = [];
|
|
116
|
-
if (hasAvatarChange)
|
|
117
|
-
changes.push("avatar");
|
|
118
|
-
if (hasUsernameChange)
|
|
119
|
-
changes.push("username");
|
|
120
|
-
sonner_1.toast.success(`Successfully updated ${changes.join(" and ")}!`);
|
|
121
|
-
onSuccess?.();
|
|
122
|
-
// Clean up
|
|
123
|
-
handleRemoveFile();
|
|
124
|
-
setUsername("");
|
|
125
|
-
}
|
|
126
|
-
catch (error) {
|
|
127
|
-
debug("Error updating profile:", error);
|
|
128
|
-
sonner_1.toast.error("Failed to update profile. Please try again.");
|
|
129
|
-
}
|
|
130
|
-
finally {
|
|
131
|
-
setIsUploading(false);
|
|
132
|
-
setIsSaving(false);
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
const handleFileInputClick = () => {
|
|
136
|
-
fileInputRef.current?.click();
|
|
137
|
-
};
|
|
138
|
-
const isLoading = isUploading || isSaving;
|
|
139
|
-
const hasChanges = selectedFile !== null || (username.trim() !== "" && username !== currentUsername);
|
|
140
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, cn_1.cn)("flex flex-col items-center justify-center space-y-6 p-8", className), children: [(0, jsx_runtime_1.jsxs)("div", { className: "space-y-2 text-center", children: [(0, jsx_runtime_1.jsx)("h2", { className: "font-neue-montreal-semibold text-b3-grey text-2xl", children: "Edit Your Profile" }), (0, jsx_runtime_1.jsx)("p", { className: "text-b3-foreground-muted font-neue-montreal-medium", children: "Update your avatar and username" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "w-full max-w-md space-y-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "space-y-2", children: [(0, jsx_runtime_1.jsx)("label", { className: "text-b3-grey font-neue-montreal-semibold text-sm", children: "Avatar" }), (0, jsx_runtime_1.jsx)("div", { className: "flex justify-center", children: safePreviewUrl || avatarUrl ? ((0, jsx_runtime_1.jsxs)("div", { className: "relative", children: [(0, jsx_runtime_1.jsx)("div", { className: "border-b3-primary-blue h-32 w-32 overflow-hidden rounded-full border-4", children: (0, jsx_runtime_1.jsx)("img", { src: safePreviewUrl || avatarUrl || "", alt: safePreviewUrl ? "Preview" : "Current avatar", className: "h-full w-full object-cover" }) }), safePreviewUrl && ((0, jsx_runtime_1.jsx)("button", { onClick: handleRemoveFile, className: "bg-b3-negative absolute -right-2 -top-2 flex h-8 w-8 items-center justify-center rounded-full text-white transition-colors hover:bg-red-600", disabled: isLoading, children: (0, jsx_runtime_1.jsx)(lucide_react_1.X, { size: 16 }) }))] })) : ((0, jsx_runtime_1.jsx)("div", { className: "bg-b3-primary-wash h-32 w-32 rounded-full" })) }), !selectedFile && ((0, jsx_runtime_1.jsxs)(react_1.Button, { variant: "outline", onClick: handleFileInputClick, disabled: isLoading, className: "w-full", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Upload, { className: "mr-2 h-4 w-4" }), hasAvatar ? "Change Avatar" : "Upload Avatar"] })), (0, jsx_runtime_1.jsx)("input", { ref: fileInputRef, type: "file", accept: "image/*", onChange: handleFileSelect, className: "hidden" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-2", children: [(0, jsx_runtime_1.jsx)("label", { htmlFor: "username", className: "text-b3-grey font-neue-montreal-semibold text-sm", children: "Username" }), (0, jsx_runtime_1.jsx)("input", { id: "username", type: "text", value: username, onChange: e => setUsername(e.target.value), placeholder: currentUsername || "Enter username", className: "border-b3-line bg-b3-background text-b3-grey placeholder:text-b3-foreground-muted font-neue-montreal-medium focus:border-b3-primary-blue w-full rounded-lg border px-4 py-3 transition-colors focus:outline-none", disabled: isLoading }), currentUsername && ((0, jsx_runtime_1.jsxs)("p", { className: "text-b3-foreground-muted font-neue-montreal-medium text-xs", children: ["Current: ", currentUsername] }))] })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex w-full max-w-md gap-3", children: (0, jsx_runtime_1.jsx)(react_1.Button, { onClick: handleSave, disabled: isLoading || !hasChanges, className: "bg-b3-primary-blue hover:bg-b3-primary-blue/90 flex-1 text-white disabled:opacity-50", children: isLoading ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "mr-2 h-4 w-4 animate-spin" }), isUploading ? "Uploading..." : "Saving..."] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Check, { className: "mr-2 h-4 w-4" }), "Save Changes"] })) }) }), (0, jsx_runtime_1.jsx)("div", { className: "text-b3-foreground-muted font-neue-montreal-medium max-w-md text-center text-xs", children: (0, jsx_runtime_1.jsx)("p", { children: "Your avatar will be uploaded to IPFS and stored securely. Make sure you have the rights to use this image." }) })] }));
|
|
141
|
-
}
|