From b0b11381813fc65888070bb5a01d26b8a18ff898 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Santana=20Gon=C3=A7alves?= Date: Wed, 4 Dec 2024 15:09:21 -0300 Subject: [PATCH] Do not load the NFT holders table if the holders amount is zero --- src/app/treasury/HoldersSection.tsx | 2 +- src/app/user/Delegation/DelegateModal.tsx | 21 ++++++++++++++++++++- src/pages/communities/nft/[address].tsx | 2 +- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/app/treasury/HoldersSection.tsx b/src/app/treasury/HoldersSection.tsx index a1b04ca9..54263aa3 100644 --- a/src/app/treasury/HoldersSection.tsx +++ b/src/app/treasury/HoldersSection.tsx @@ -43,7 +43,7 @@ export const HoldersSection = () => { {isError && ( )} - {!isError && holders && holders?.length > 0 && ( + {!isError && holders?.length > 0 && ( <> {paginationElement} diff --git a/src/app/user/Delegation/DelegateModal.tsx b/src/app/user/Delegation/DelegateModal.tsx index aa7d0d0a..73ac541e 100644 --- a/src/app/user/Delegation/DelegateModal.tsx +++ b/src/app/user/Delegation/DelegateModal.tsx @@ -8,6 +8,7 @@ import { isAddressRegex, isChecksumValid } from '@/app/proposals/shared/utils' import { useAlertContext } from '@/app/providers' import { TX_MESSAGES } from '@/shared/txMessages' import { CHAIN_ID } from '@/lib/constants' +import { Address, checksumAddress } from 'viem' interface DelegateModalProps { onClose: () => void @@ -81,7 +82,25 @@ export const DelegateModal = ({ onClose, onDelegateTxStarted }: DelegateModalPro fullWidth labelWrapperProps={{ className: 'text-left mb-[10px]' }} /> - {error &&

{error}

} + {error && ( +

+ {error === 'Address has invalid checksum.' ? ( + <> + {error + ' '} + + onAddressChange(checksumAddress(addressToDelegateTo as Address, Number(CHAIN_ID))) + } + > + Fix address. + + + ) : ( + error + )} +

+ )} {/* Button */}
diff --git a/src/pages/communities/nft/[address].tsx b/src/pages/communities/nft/[address].tsx index b4569e67..d4f724d0 100644 --- a/src/pages/communities/nft/[address].tsx +++ b/src/pages/communities/nft/[address].tsx @@ -322,7 +322,7 @@ export default function Page() {
{/* Holders list */} - + {membersCount > 0 && } ) }