Commit bbec6bcd authored by isstuev's avatar isstuev

propRename

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