diff --git a/src/app/address/[principal]/TokenBalanceCard/NftAvatar.tsx b/src/app/address/[principal]/TokenBalanceCard/NftAvatar.tsx index 46120dc17..880e64b7c 100644 --- a/src/app/address/[principal]/TokenBalanceCard/NftAvatar.tsx +++ b/src/app/address/[principal]/TokenBalanceCard/NftAvatar.tsx @@ -15,7 +15,9 @@ interface NftAvatarProps { export function NftAvatar({ token, contractId, firstNftValue, asset }: NftAvatarProps) { const { data: tokenMetadata } = useNftMetadata( { contractId, tokenId: Number(firstNftValue) }, - { enabled: !!firstNftValue, retry: 1, retryDelay: 2000 } + // { enabled: !!firstNftValue, retry: 1, retryDelay: 2000 } + { enabled: !!firstNftValue } + ); return ; } diff --git a/src/app/token/[tokenId]/skeleton.tsx b/src/app/token/[tokenId]/skeleton.tsx index ea8c14082..3f3e3bace 100644 --- a/src/app/token/[tokenId]/skeleton.tsx +++ b/src/app/token/[tokenId]/skeleton.tsx @@ -21,8 +21,6 @@ export default function Skeleton() { {}} - tabId={'confirmed'} tabs={[ { title: 'Confirmed', diff --git a/src/app/transactions/skeleton.tsx b/src/app/transactions/skeleton.tsx index ff73e5375..2d0a5feea 100644 --- a/src/app/transactions/skeleton.tsx +++ b/src/app/transactions/skeleton.tsx @@ -21,8 +21,6 @@ export default function Skeleton() { {}} - tabId={'confirmed'} tabs={[ { title: 'Confirmed', diff --git a/src/common/components/TabsContainer.tsx b/src/common/components/TabsContainer.tsx index 04598c42d..fc4b49a4f 100644 --- a/src/common/components/TabsContainer.tsx +++ b/src/common/components/TabsContainer.tsx @@ -6,14 +6,21 @@ import { Section } from './Section'; export const TabsContainer: FC< { - title?: string | ReactNode; tabs: TxListTab[]; + onTabChange?: (id: string) => void; + title?: string | ReactNode; actions?: ReactNode; } & FlexProps -> = ({ title, tabs, actions, ...props }) => { +> = ({ onTabChange, title, tabs, actions, ...props }) => { return (
- + { + onTabChange?.(id); + }} + defaultValue={tabs[0].id} + > { - // TODO: fix this test it('renders tabs with correct title', () => { const { getAllByRole } = render( - + ); const tabList = getAllByRole('tab'); @@ -35,11 +33,9 @@ describe('TabsContainer', () => { it('displays correct tab content when a tab is clicked', async () => { function TestWrapper() { - const [currentTabId, setCurrentTabId] = useState('tab-1'); - return ( - + ); } diff --git a/src/features/txs-list/tabs/TxListTabsBase.tsx b/src/features/txs-list/tabs/TxListTabsBase.tsx index a96c6d1f6..4d89eff89 100644 --- a/src/features/txs-list/tabs/TxListTabsBase.tsx +++ b/src/features/txs-list/tabs/TxListTabsBase.tsx @@ -44,8 +44,7 @@ export const TxListTabsBase: FC< return (