Commit bbec6bcd authored by isstuev's avatar isstuev

propRename

parent 086ef3da
...@@ -26,10 +26,10 @@ const getFilterValue = (getFilterValueFromQuery<NovesHistoryFilterValue>).bind(n ...@@ -26,10 +26,10 @@ const getFilterValue = (getFilterValueFromQuery<NovesHistoryFilterValue>).bind(n
type Props = { type Props = {
scrollRef?: React.RefObject<HTMLDivElement>; scrollRef?: React.RefObject<HTMLDivElement>;
isTabsLoading?: boolean; shouldRender?: boolean;
} }
const AddressAccountHistory = ({ scrollRef, isTabsLoading }: Props) => { const AddressAccountHistory = ({ scrollRef, shouldRender = true }: Props) => {
const router = useRouter(); const router = useRouter();
const isMounted = useIsMounted(); const isMounted = useIsMounted();
...@@ -52,7 +52,7 @@ const AddressAccountHistory = ({ scrollRef, isTabsLoading }: Props) => { ...@@ -52,7 +52,7 @@ const AddressAccountHistory = ({ scrollRef, isTabsLoading }: Props) => {
setFilterValue(newVal); setFilterValue(newVal);
}, [ ]); }, [ ]);
if (!isMounted || isTabsLoading) { if (!isMounted || !shouldRender) {
return null; return null;
} }
......
...@@ -26,10 +26,10 @@ import AddressBlocksValidatedTableItem from './blocksValidated/AddressBlocksVali ...@@ -26,10 +26,10 @@ import AddressBlocksValidatedTableItem from './blocksValidated/AddressBlocksVali
interface Props { interface Props {
scrollRef?: React.RefObject<HTMLDivElement>; scrollRef?: React.RefObject<HTMLDivElement>;
isTabsLoading?: boolean; shouldRender?: boolean;
} }
const AddressBlocksValidated = ({ scrollRef, isTabsLoading }: Props) => { const AddressBlocksValidated = ({ scrollRef, shouldRender = true }: Props) => {
const [ socketAlert, setSocketAlert ] = React.useState(false); const [ socketAlert, setSocketAlert ] = React.useState(false);
const queryClient = useQueryClient(); const queryClient = useQueryClient();
const router = useRouter(); const router = useRouter();
...@@ -87,7 +87,7 @@ const AddressBlocksValidated = ({ scrollRef, isTabsLoading }: Props) => { ...@@ -87,7 +87,7 @@ const AddressBlocksValidated = ({ scrollRef, isTabsLoading }: Props) => {
handler: handleNewSocketMessage, handler: handleNewSocketMessage,
}); });
if (!isMounted || isTabsLoading) { if (!isMounted || !shouldRender) {
return null; return null;
} }
......
...@@ -19,10 +19,10 @@ import AddressCoinBalanceChart from './coinBalance/AddressCoinBalanceChart'; ...@@ -19,10 +19,10 @@ import AddressCoinBalanceChart from './coinBalance/AddressCoinBalanceChart';
import AddressCoinBalanceHistory from './coinBalance/AddressCoinBalanceHistory'; import AddressCoinBalanceHistory from './coinBalance/AddressCoinBalanceHistory';
type Props = { type Props = {
isTabsLoading?: boolean; shouldRender?: boolean;
} }
const AddressCoinBalance = ({ isTabsLoading }: Props) => { const AddressCoinBalance = ({ shouldRender = true }: Props) => {
const [ socketAlert, setSocketAlert ] = React.useState(false); const [ socketAlert, setSocketAlert ] = React.useState(false);
const queryClient = useQueryClient(); const queryClient = useQueryClient();
const router = useRouter(); const router = useRouter();
...@@ -85,7 +85,7 @@ const AddressCoinBalance = ({ isTabsLoading }: Props) => { ...@@ -85,7 +85,7 @@ const AddressCoinBalance = ({ isTabsLoading }: Props) => {
handler: handleNewSocketMessage, handler: handleNewSocketMessage,
}); });
if (!isMounted || isTabsLoading) { if (!isMounted || !shouldRender) {
return null; return null;
} }
......
...@@ -25,9 +25,9 @@ const getFilterValue = (getFilterValueFromQuery<AddressFromToFilter>).bind(null, ...@@ -25,9 +25,9 @@ const getFilterValue = (getFilterValueFromQuery<AddressFromToFilter>).bind(null,
type Props = { type Props = {
scrollRef?: React.RefObject<HTMLDivElement>; scrollRef?: React.RefObject<HTMLDivElement>;
isTabsLoading?: boolean; shouldRender?: boolean;
} }
const AddressInternalTxs = ({ scrollRef, isTabsLoading }: Props) => { const AddressInternalTxs = ({ scrollRef, shouldRender = true }: Props) => {
const router = useRouter(); const router = useRouter();
const isMounted = useIsMounted(); const isMounted = useIsMounted();
...@@ -62,7 +62,7 @@ const AddressInternalTxs = ({ scrollRef, isTabsLoading }: Props) => { ...@@ -62,7 +62,7 @@ const AddressInternalTxs = ({ scrollRef, isTabsLoading }: Props) => {
onFilterChange({ filter: newVal }); onFilterChange({ filter: newVal });
}, [ onFilterChange ]); }, [ onFilterChange ]);
if (!isMounted || isTabsLoading) { if (!isMounted || !shouldRender) {
return null; return null;
} }
......
...@@ -15,10 +15,10 @@ import AddressCsvExportLink from './AddressCsvExportLink'; ...@@ -15,10 +15,10 @@ import AddressCsvExportLink from './AddressCsvExportLink';
type Props ={ type Props ={
scrollRef?: React.RefObject<HTMLDivElement>; scrollRef?: React.RefObject<HTMLDivElement>;
isTabsLoading?: boolean; shouldRender?: boolean;
} }
const AddressLogs = ({ scrollRef, isTabsLoading }: Props) => { const AddressLogs = ({ scrollRef, shouldRender = true }: Props) => {
const router = useRouter(); const router = useRouter();
const isMounted = useIsMounted(); const isMounted = useIsMounted();
...@@ -48,7 +48,7 @@ const AddressLogs = ({ scrollRef, isTabsLoading }: Props) => { ...@@ -48,7 +48,7 @@ const AddressLogs = ({ scrollRef, isTabsLoading }: Props) => {
</ActionBar> </ActionBar>
); );
if (!isMounted || isTabsLoading) { if (!isMounted || !shouldRender) {
return null; return null;
} }
......
...@@ -64,12 +64,12 @@ const matchFilters = (filters: Filters, tokenTransfer: TokenTransfer, address?: ...@@ -64,12 +64,12 @@ const matchFilters = (filters: Filters, tokenTransfer: TokenTransfer, address?:
type Props = { type Props = {
scrollRef?: React.RefObject<HTMLDivElement>; scrollRef?: React.RefObject<HTMLDivElement>;
isTabsLoading?: boolean; shouldRender?: boolean;
// for tests only // for tests only
overloadCount?: number; overloadCount?: number;
} }
const AddressTokenTransfers = ({ scrollRef, overloadCount = OVERLOAD_COUNT, isTabsLoading }: Props) => { const AddressTokenTransfers = ({ scrollRef, overloadCount = OVERLOAD_COUNT, shouldRender = true }: Props) => {
const router = useRouter(); const router = useRouter();
const queryClient = useQueryClient(); const queryClient = useQueryClient();
const isMobile = useIsMobile(); const isMobile = useIsMobile();
...@@ -190,7 +190,7 @@ const AddressTokenTransfers = ({ scrollRef, overloadCount = OVERLOAD_COUNT, isTa ...@@ -190,7 +190,7 @@ const AddressTokenTransfers = ({ scrollRef, overloadCount = OVERLOAD_COUNT, isTa
type: 'ERC-20' as const, type: 'ERC-20' as const,
}), [ tokenFilter ]); }), [ tokenFilter ]);
if (!isMounted || isTabsLoading) { if (!isMounted || !shouldRender) {
return null; return null;
} }
......
...@@ -43,10 +43,10 @@ const TAB_LIST_PROPS_MOBILE = { ...@@ -43,10 +43,10 @@ const TAB_LIST_PROPS_MOBILE = {
const getTokenFilterValue = (getFilterValuesFromQuery<NFTTokenType>).bind(null, NFT_TOKEN_TYPE_IDS); const getTokenFilterValue = (getFilterValuesFromQuery<NFTTokenType>).bind(null, NFT_TOKEN_TYPE_IDS);
type Props = { type Props = {
isTabsLoading?: boolean; shouldRender?: boolean;
} }
const AddressTokens = ({ isTabsLoading }: Props) => { const AddressTokens = ({ shouldRender = true }: Props) => {
const router = useRouter(); const router = useRouter();
const isMobile = useIsMobile(); const isMobile = useIsMobile();
const isMounted = useIsMounted(); const isMounted = useIsMounted();
...@@ -105,7 +105,7 @@ const AddressTokens = ({ isTabsLoading }: Props) => { ...@@ -105,7 +105,7 @@ const AddressTokens = ({ isTabsLoading }: Props) => {
setTokenTypes(value); setTokenTypes(value);
}, [ nftsQuery, collectionsQuery ]); }, [ nftsQuery, collectionsQuery ]);
if (!isMounted || isTabsLoading) { if (!isMounted || !shouldRender) {
return null; return null;
} }
......
...@@ -48,12 +48,12 @@ const matchFilter = (filterValue: AddressFromToFilter, transaction: Transaction, ...@@ -48,12 +48,12 @@ const matchFilter = (filterValue: AddressFromToFilter, transaction: Transaction,
type Props = { type Props = {
scrollRef?: React.RefObject<HTMLDivElement>; scrollRef?: React.RefObject<HTMLDivElement>;
isTabsLoading?: boolean; shouldRender?: boolean;
// for tests only // for tests only
overloadCount?: number; overloadCount?: number;
} }
const AddressTxs = ({ scrollRef, overloadCount = OVERLOAD_COUNT, isTabsLoading }: Props) => { const AddressTxs = ({ scrollRef, overloadCount = OVERLOAD_COUNT, shouldRender = true }: Props) => {
const router = useRouter(); const router = useRouter();
const queryClient = useQueryClient(); const queryClient = useQueryClient();
const isMounted = useIsMounted(); const isMounted = useIsMounted();
...@@ -159,7 +159,7 @@ const AddressTxs = ({ scrollRef, overloadCount = OVERLOAD_COUNT, isTabsLoading } ...@@ -159,7 +159,7 @@ const AddressTxs = ({ scrollRef, overloadCount = OVERLOAD_COUNT, isTabsLoading }
handler: handleNewSocketMessage, handler: handleNewSocketMessage,
}); });
if (!isMounted || isTabsLoading) { if (!isMounted || !shouldRender) {
return null; return null;
} }
......
...@@ -10,10 +10,10 @@ import UserOpsContent from 'ui/userOps/UserOpsContent'; ...@@ -10,10 +10,10 @@ import UserOpsContent from 'ui/userOps/UserOpsContent';
type Props = { type Props = {
scrollRef?: React.RefObject<HTMLDivElement>; scrollRef?: React.RefObject<HTMLDivElement>;
isTabsLoading?: boolean; shouldRender?: boolean;
} }
const AddressUserOps = ({ scrollRef, isTabsLoading }: Props) => { const AddressUserOps = ({ scrollRef, shouldRender = true }: Props) => {
const router = useRouter(); const router = useRouter();
const isMounted = useIsMounted(); const isMounted = useIsMounted();
...@@ -32,7 +32,7 @@ const AddressUserOps = ({ scrollRef, isTabsLoading }: Props) => { ...@@ -32,7 +32,7 @@ const AddressUserOps = ({ scrollRef, isTabsLoading }: Props) => {
filters: { sender: hash }, filters: { sender: hash },
}); });
if (!isMounted || isTabsLoading) { if (!isMounted || !shouldRender) {
return null; return null;
} }
......
...@@ -15,9 +15,9 @@ import BeaconChainWithdrawalsTable from 'ui/withdrawals/beaconChain/BeaconChainW ...@@ -15,9 +15,9 @@ import BeaconChainWithdrawalsTable from 'ui/withdrawals/beaconChain/BeaconChainW
type Props = { type Props = {
scrollRef?: React.RefObject<HTMLDivElement>; scrollRef?: React.RefObject<HTMLDivElement>;
isTabsLoading?: boolean; shouldRender?: boolean;
} }
const AddressWithdrawals = ({ scrollRef, isTabsLoading }: Props) => { const AddressWithdrawals = ({ scrollRef, shouldRender = true }: Props) => {
const router = useRouter(); const router = useRouter();
const isMounted = useIsMounted(); const isMounted = useIsMounted();
...@@ -35,7 +35,7 @@ const AddressWithdrawals = ({ scrollRef, isTabsLoading }: Props) => { ...@@ -35,7 +35,7 @@ const AddressWithdrawals = ({ scrollRef, isTabsLoading }: Props) => {
}, },
}); });
if (!isMounted || isTabsLoading) { if (!isMounted || !shouldRender) {
return null; return null;
} }
......
...@@ -83,13 +83,13 @@ const AddressPageContent = () => { ...@@ -83,13 +83,13 @@ const AddressPageContent = () => {
id: 'txs', id: 'txs',
title: 'Transactions', title: 'Transactions',
count: addressTabsCountersQuery.data?.transactions_count, count: addressTabsCountersQuery.data?.transactions_count,
component: <AddressTxs scrollRef={ tabsScrollRef } isTabsLoading={ isTabsLoading }/>, component: <AddressTxs scrollRef={ tabsScrollRef } shouldRender={ !isTabsLoading }/>,
}, },
txInterpretation.isEnabled && txInterpretation.provider === 'noves' ? txInterpretation.isEnabled && txInterpretation.provider === 'noves' ?
{ {
id: 'account_history', id: 'account_history',
title: 'Account history', title: 'Account history',
component: <AddressAccountHistory scrollRef={ tabsScrollRef } isTabsLoading={ isTabsLoading }/>, component: <AddressAccountHistory scrollRef={ tabsScrollRef } shouldRender={ !isTabsLoading }/>,
} : } :
undefined, undefined,
config.features.userOps.isEnabled && Boolean(userOpsAccountQuery.data?.total_ops) ? config.features.userOps.isEnabled && Boolean(userOpsAccountQuery.data?.total_ops) ?
...@@ -97,7 +97,7 @@ const AddressPageContent = () => { ...@@ -97,7 +97,7 @@ const AddressPageContent = () => {
id: 'user_ops', id: 'user_ops',
title: 'User operations', title: 'User operations',
count: userOpsAccountQuery.data?.total_ops, count: userOpsAccountQuery.data?.total_ops,
component: <AddressUserOps isTabsLoading={ isTabsLoading }/>, component: <AddressUserOps shouldRender={ !isTabsLoading }/>,
} : } :
undefined, undefined,
config.features.beaconChain.isEnabled && addressTabsCountersQuery.data?.withdrawals_count ? config.features.beaconChain.isEnabled && addressTabsCountersQuery.data?.withdrawals_count ?
...@@ -105,39 +105,39 @@ const AddressPageContent = () => { ...@@ -105,39 +105,39 @@ const AddressPageContent = () => {
id: 'withdrawals', id: 'withdrawals',
title: 'Withdrawals', title: 'Withdrawals',
count: addressTabsCountersQuery.data?.withdrawals_count, count: addressTabsCountersQuery.data?.withdrawals_count,
component: <AddressWithdrawals scrollRef={ tabsScrollRef } isTabsLoading={ isTabsLoading }/>, component: <AddressWithdrawals scrollRef={ tabsScrollRef } shouldRender={ !isTabsLoading }/>,
} : } :
undefined, undefined,
{ {
id: 'token_transfers', id: 'token_transfers',
title: 'Token transfers', title: 'Token transfers',
count: addressTabsCountersQuery.data?.token_transfers_count, count: addressTabsCountersQuery.data?.token_transfers_count,
component: <AddressTokenTransfers scrollRef={ tabsScrollRef } isTabsLoading={ isTabsLoading }/>, component: <AddressTokenTransfers scrollRef={ tabsScrollRef } shouldRender={ !isTabsLoading }/>,
}, },
{ {
id: 'tokens', id: 'tokens',
title: 'Tokens', title: 'Tokens',
count: addressTabsCountersQuery.data?.token_balances_count, count: addressTabsCountersQuery.data?.token_balances_count,
component: <AddressTokens isTabsLoading={ isTabsLoading }/>, component: <AddressTokens shouldRender={ !isTabsLoading }/>,
subTabs: TOKEN_TABS, subTabs: TOKEN_TABS,
}, },
{ {
id: 'internal_txns', id: 'internal_txns',
title: 'Internal txns', title: 'Internal txns',
count: addressTabsCountersQuery.data?.internal_txs_count, count: addressTabsCountersQuery.data?.internal_txs_count,
component: <AddressInternalTxs scrollRef={ tabsScrollRef } isTabsLoading={ isTabsLoading }/>, component: <AddressInternalTxs scrollRef={ tabsScrollRef } shouldRender={ !isTabsLoading }/>,
}, },
{ {
id: 'coin_balance_history', id: 'coin_balance_history',
title: 'Coin balance history', title: 'Coin balance history',
component: <AddressCoinBalance isTabsLoading={ isTabsLoading }/>, component: <AddressCoinBalance shouldRender={ !isTabsLoading }/>,
}, },
config.chain.verificationType === 'validation' && addressTabsCountersQuery.data?.validations_count ? config.chain.verificationType === 'validation' && addressTabsCountersQuery.data?.validations_count ?
{ {
id: 'blocks_validated', id: 'blocks_validated',
title: 'Blocks validated', title: 'Blocks validated',
count: addressTabsCountersQuery.data?.validations_count, count: addressTabsCountersQuery.data?.validations_count,
component: <AddressBlocksValidated scrollRef={ tabsScrollRef } isTabsLoading={ isTabsLoading }/>, component: <AddressBlocksValidated scrollRef={ tabsScrollRef } shouldRender={ !isTabsLoading }/>,
} : } :
undefined, undefined,
addressTabsCountersQuery.data?.logs_count ? addressTabsCountersQuery.data?.logs_count ?
...@@ -145,7 +145,7 @@ const AddressPageContent = () => { ...@@ -145,7 +145,7 @@ const AddressPageContent = () => {
id: 'logs', id: 'logs',
title: 'Logs', title: 'Logs',
count: addressTabsCountersQuery.data?.logs_count, count: addressTabsCountersQuery.data?.logs_count,
component: <AddressLogs scrollRef={ tabsScrollRef } isTabsLoading={ isTabsLoading }/>, component: <AddressLogs scrollRef={ tabsScrollRef } shouldRender={ !isTabsLoading }/>,
} : } :
undefined, undefined,
...@@ -186,7 +186,7 @@ const AddressPageContent = () => { ...@@ -186,7 +186,7 @@ const AddressPageContent = () => {
const content = (addressQuery.isError || addressQuery.isDegradedData) ? const content = (addressQuery.isError || addressQuery.isDegradedData) ?
null : null :
<RoutedTabs tabs={ tabs } tabListProps={{ mt: 8 }} isLoading={ isLoading || addressTabsCountersQuery.isPlaceholderData }/>; <RoutedTabs tabs={ tabs } tabListProps={{ mt: 8 }} isLoading={ isTabsLoading }/>;
const backLink = React.useMemo(() => { const backLink = React.useMemo(() => {
const hasGoBackLink = appProps.referrer && appProps.referrer.includes('/accounts'); const hasGoBackLink = appProps.referrer && appProps.referrer.includes('/accounts');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment