Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: split loading effects for different tokens in totalTreasury component #1403 #1449

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 17 additions & 10 deletions site/src/pages/Overview/polkadot/totalTreasury.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,17 +135,24 @@ export default function OverviewTotalTreasury() {
totalMythTokenValue,
).toString();

const isLoading =
const isDotLoading =
relayChainAssetsBalance.isLoading ||
hydration.isLoading ||
bountiesTotalBalance.isLoading ||
fellowshipSalaryUsdtBalance.isLoading ||
fellowshipTreasuryDotBalance.isLoading ||
loansCentrifugeUsdcBalance.isLoading ||
loansBifrostDotBalance.isLoading ||
loansPendulumDotBalance.isLoading ||
mythTokenAssetsBalance.isLoading ||
isFiatPriceLoading;
loansPendulumDotBalance.isLoading;

const isUSDtLoading =
hydration.isLoading || fellowshipSalaryUsdtBalance.isLoading;

const isUSDCLoading =
hydration.isLoading || loansCentrifugeUsdcBalance.isLoading;

const isMYTHLoading = mythTokenAssetsBalance.isLoading;

const isLoading =
isDotLoading || isUSDtLoading || isUSDCLoading || isMYTHLoading;

return (
<Wrapper>
Expand All @@ -166,22 +173,22 @@ export default function OverviewTotalTreasury() {
>
<TokenItem
icon="asset-dot.svg"
isLoading={isLoading}
isLoading={isDotLoading}
totalValue={totalDot}
precision={polkadot.decimals}
symbol={polkadot.symbol}
/>
</Tooltip>
<TokenItem
icon="asset-usdt.svg"
isLoading={isLoading}
isLoading={isUSDtLoading}
totalValue={totalUSDt}
precision={USDt.decimals}
symbol={USDt.symbol}
/>
<TokenItem
icon="asset-usdc.svg"
isLoading={isLoading}
isLoading={isUSDCLoading}
totalValue={totalUSDC}
precision={USDC.decimals}
symbol={USDC.symbol}
Expand All @@ -193,7 +200,7 @@ export default function OverviewTotalTreasury() {
>
<TokenItem
icon="asset-myth.svg"
isLoading={isLoading}
isLoading={isMYTHLoading}
totalValue={totalMythToken}
precision={MYTH.decimals}
symbol={MYTH.symbol}
Expand Down