Resolve eslint and prettier issues on balance load changes
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user