From 40c752f587145cdc8bd16eb8f27aa5256135a867 Mon Sep 17 00:00:00 2001 From: Geolffrey Mena Date: Wed, 8 Jan 2025 08:03:31 -0600 Subject: [PATCH] refactor: logic complexity --- .../components/finance-balance-statistics.tsx | 4 ++-- .../finance/components/finance-contacts.tsx | 20 +++++++++---------- .../finance-deposit-from-stripe.tsx | 3 ++- .../finance-quick-transfer-modal.tsx | 3 +-- .../components/finance-quick-transfer.tsx | 13 ++++++------ 5 files changed, 22 insertions(+), 21 deletions(-) diff --git a/src/sections/finance/components/finance-balance-statistics.tsx b/src/sections/finance/components/finance-balance-statistics.tsx index 06e48422..b6522ed9 100644 --- a/src/sections/finance/components/finance-balance-statistics.tsx +++ b/src/sections/finance/components/finance-balance-statistics.tsx @@ -245,8 +245,8 @@ export default function FinanceBalanceStatistics() { <> { This feature is coming soon. - We’re working hard to bring this section to life. Check back soon! + We’re working hard to bring this feature to life. +
Check back soon!
diff --git a/src/sections/finance/components/finance-quick-transfer-modal.tsx b/src/sections/finance/components/finance-quick-transfer-modal.tsx index b3d64610..bcc45624 100644 --- a/src/sections/finance/components/finance-quick-transfer-modal.tsx +++ b/src/sections/finance/components/finance-quick-transfer-modal.tsx @@ -50,11 +50,10 @@ function FinanceQuickTransferModal({ }: ConfirmTransferDialogProps) { const sessionData = useSelector((state: any) => state.auth.session); const { generatePayload } = useNotificationPayload(sessionData); + const { transfer, loading: transferLoading, error } = useTransfer(); const { sendNotification } = useNotifications(); const [message, setMessage] = useState(''); - const { transfer, loading: transferLoading, error } = useTransfer(); - // Check if we have a valid profile or not const hasProfile = !!contactInfo; diff --git a/src/sections/finance/components/finance-quick-transfer.tsx b/src/sections/finance/components/finance-quick-transfer.tsx index 2edc85e4..62d2620f 100644 --- a/src/sections/finance/components/finance-quick-transfer.tsx +++ b/src/sections/finance/components/finance-quick-transfer.tsx @@ -149,12 +149,13 @@ export default function FinanceQuickTransfer({ useEffect(() => { const currentProfile = list?.[carousel.currentIndex]; if (currentProfile?.ownedBy?.address) { - setWalletAddress(currentProfile.ownedBy.address); - dispatch( - storeAddress({ address: currentProfile.ownedBy.address, profileId: currentProfile.id }) - ); + const profileId = currentProfile.id + const address = currentProfile.ownedBy.address; + + setWalletAddress(address); + dispatch(storeAddress({ address, profileId })); } - }, [carousel.currentIndex, list, dispatch]); + }, [carousel.currentIndex, list]); // Merge initialList into local list when it changes useEffect(() => { @@ -311,7 +312,7 @@ export default function FinanceQuickTransfer({ sx={{ width: 1, mx: 'auto', - maxWidth: AVATAR_SIZE * 7 + 160, + // maxWidth: AVATAR_SIZE * 7 + 160, }} > {list?.map((profile, index) => (