mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
Add error state for chart on the address page.
This commit is contained in:
@@ -7,6 +7,7 @@ import type { Address } from 'types/api/address';
|
||||
import appConfig from 'configs/app/config';
|
||||
import useApiQuery from 'lib/api/useApiQuery';
|
||||
import ChartWidget from 'ui/shared/chart/ChartWidget';
|
||||
import DataFetchAlert from 'ui/shared/DataFetchAlert';
|
||||
|
||||
interface Props {
|
||||
addressQuery: UseQueryResult<Address>;
|
||||
@@ -23,12 +24,16 @@ const AddressCoinBalanceChart = ({ addressQuery }: Props) => {
|
||||
value: BigNumber(value).div(10 ** appConfig.network.currency.decimals).toNumber(),
|
||||
})), [ data ]);
|
||||
|
||||
if (isError) {
|
||||
return <DataFetchAlert/>;
|
||||
}
|
||||
|
||||
return (
|
||||
<ChartWidget
|
||||
chartHeight="200px"
|
||||
title="Balances"
|
||||
items={ items }
|
||||
isLoading={ isLoading || isError }
|
||||
isLoading={ isLoading }
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user