Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update tabs counters type #1284

Merged
merged 1 commit into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion stubs/address.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export const ADDRESS_COUNTERS: AddressCounters = {
};

export const ADDRESS_TABS_COUNTERS: AddressTabsCounters = {
coin_balances_count: 10,
internal_txs_count: 10,
logs_count: 10,
token_balances_count: 10,
Expand Down
15 changes: 7 additions & 8 deletions types/api/address.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,11 @@ export type AddressWithdrawalsItem = {
}

export type AddressTabsCounters = {
coin_balances_count: number;
internal_txs_count: number;
logs_count: number;
token_balances_count: number;
token_transfers_count: number;
transactions_count: number;
validations_count: number;
withdrawals_count: number;
internal_txs_count: number | null;
logs_count: number | null;
token_balances_count: number | null;
token_transfers_count: number | null;
transactions_count: number | null;
validations_count: number | null;
withdrawals_count: number | null;
}
1 change: 0 additions & 1 deletion ui/pages/Address.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ const AddressPageContent = () => {
{
id: 'coin_balance_history',
title: 'Coin balance history',
count: addressTabsCountersQuery.data?.coin_balances_count,
component: <AddressCoinBalance/>,
},
config.chain.verificationType === 'validation' && addressTabsCountersQuery.data?.validations_count ?
Expand Down
8 changes: 4 additions & 4 deletions ui/shared/Tabs/TabCounter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import React from 'react';
const COUNTER_OVERLOAD = 50;

type Props = {
count?: number;
count?: number | null;
parentClassName: string;
}

const TasCounter = ({ count, parentClassName }: Props) => {
const TabCounter = ({ count, parentClassName }: Props) => {

const zeroCountColor = useColorModeValue('blackAlpha.400', 'whiteAlpha.400');

if (count === undefined) {
if (count === undefined || count === null) {
return null;
}

Expand All @@ -35,4 +35,4 @@ const TasCounter = ({ count, parentClassName }: Props) => {
);
};

export default TasCounter;
export default TabCounter;
2 changes: 1 addition & 1 deletion ui/shared/Tabs/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type React from 'react';
export interface TabItem {
id: string;
title: string | (() => React.ReactNode);
count?: number;
count?: number | null;
component: React.ReactNode;
}

Expand Down
Loading