From 1a9f30c16ef84b50a787c3ce12f3cf8493252945 Mon Sep 17 00:00:00 2001 From: martines3000 Date: Mon, 13 Jan 2025 16:17:01 +0100 Subject: [PATCH] chore: update loading states --- .../MarketsView/MarketCollateralsTable.tsx | 1 - .../components/MarketsView/MarketOverview.tsx | 2 +- .../components/MarketsView/MarketTableRow.tsx | 4 ++-- apps/frontend/src/configs/envs/testnet.ts | 16 ++++++++-------- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/apps/frontend/src/components/MarketsView/MarketCollateralsTable.tsx b/apps/frontend/src/components/MarketsView/MarketCollateralsTable.tsx index 644f4a1d..d37cd71c 100644 --- a/apps/frontend/src/components/MarketsView/MarketCollateralsTable.tsx +++ b/apps/frontend/src/components/MarketsView/MarketCollateralsTable.tsx @@ -98,7 +98,6 @@ export const MarketCollateralsTable = ({ }: { marketName: string }) => { const { data: collateralConfigurations } = useCollateralConfigurations(marketName); - const { data: marketConfiguration } = useMarketConfiguration(marketName); const collaterals = useMemo(() => { if (!collateralConfigurations) return []; diff --git a/apps/frontend/src/components/MarketsView/MarketOverview.tsx b/apps/frontend/src/components/MarketsView/MarketOverview.tsx index c28ab8fe..10f55aaa 100644 --- a/apps/frontend/src/components/MarketsView/MarketOverview.tsx +++ b/apps/frontend/src/components/MarketsView/MarketOverview.tsx @@ -50,7 +50,7 @@ export default function MarketOverview({ }: MarketOverviewProps) { const { data: totalReserves } = useTotalReserves(baseAsset); - const { data: aprData, isPending: isAprPending } = useApr(); + const { data: aprData, isPending: isAprPending } = useApr(baseAsset); const { data: collateralConfigurations } = useCollateralConfigurations(baseAsset); diff --git a/apps/frontend/src/components/MarketsView/MarketTableRow.tsx b/apps/frontend/src/components/MarketsView/MarketTableRow.tsx index c7fa0677..724640bb 100644 --- a/apps/frontend/src/components/MarketsView/MarketTableRow.tsx +++ b/apps/frontend/src/components/MarketsView/MarketTableRow.tsx @@ -74,7 +74,7 @@ export const MarketTableRow = ({ const { data: marketConfiguration } = useMarketConfiguration(); const { data: utilization } = useUtilization(marketName); - const { data: aprData, isPending: isAprPending } = useApr(); + const { data: aprData, isPending: isAprPending } = useApr(marketName); const { data: collateralConfigurations, @@ -119,7 +119,7 @@ export const MarketTableRow = ({ ); }, [totalCollateral, priceData]); - return isPendingCollateralConfigurations ? ( + return isPendingCollateralConfigurations || isAprPending ? ( SkeletonRow ) : (