Resolve eslint and prettier issues on balance load changes

This commit is contained in:
Tommy Verrall
2026-06-08 18:24:35 +02:00
parent b9cd2aa12e
commit 500200db45
4 changed files with 24 additions and 20 deletions
+1 -1
View File
@@ -251,7 +251,7 @@ export const useGetBalance = (clientDetails?: Account): TUseuserBalance => {
}
setIsLoading(true);
setError(undefined);
void refreshBalances();
refreshBalances().catch((e) => Console.error(String(e)));
}, [clientDetails?.client_address]);
return {
+3 -3
View File
@@ -29,9 +29,9 @@ export function useNymUsdPrice(network: Network | undefined): UseNymUsdPrice {
return undefined;
}
const cached = getCachedNymPrice(url);
if (cached) {
setUsdPerNym(cached.quotes.USD.price);
const cachedPrice = getCachedNymPrice(url);
if (cachedPrice) {
setUsdPerNym(cachedPrice.quotes.USD.price);
setLoading(false);
setError(undefined);
return undefined;
+1 -5
View File
@@ -49,11 +49,7 @@ export const BalanceCard = ({
usdApproximationRow = <Skeleton width={140} height={22} />;
} else if (usdApproxLabel) {
usdApproximationRow = (
<Typography
variant="body2"
sx={{ color: 'nym.text.muted', fontWeight: 500 }}
data-testid="balance-usd-approx"
>
<Typography variant="body2" sx={{ color: 'nym.text.muted', fontWeight: 500 }} data-testid="balance-usd-approx">
{`${usdApproxLabel}`}
</Typography>
);
@@ -418,6 +418,24 @@ export const NetworkOverviewSection: React.FC = () => {
);
};
const delegationsCountBody = () => {
if (delegationsErr) {
return (
<Typography color="error" variant="body2">
{delegationsErr}
</Typography>
);
}
if (delegationsCount !== undefined) {
return (
<Typography variant="h5" sx={{ fontWeight: 700 }}>
{formatCompactNumber(delegationsCount)}
</Typography>
);
}
return <Skeleton width={72} height={32} />;
};
const showTrafficChartToggle = trafficChartData.length > 0;
return (
@@ -539,17 +557,7 @@ export const NetworkOverviewSection: React.FC = () => {
<Typography variant="caption" color="text.secondary">
Number of delegations
</Typography>
{delegationsErr ? (
<Typography color="error" variant="body2">
{delegationsErr}
</Typography>
) : delegationsCount !== undefined ? (
<Typography variant="h5" sx={{ fontWeight: 700 }}>
{formatCompactNumber(delegationsCount)}
</Typography>
) : (
<Skeleton width={72} height={32} />
)}
{delegationsCountBody()}
</Box>
<Box>
<Typography variant="caption" color="text.secondary">