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: fix spinner display in NFT tab #30427

Merged
merged 1 commit into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
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
28 changes: 19 additions & 9 deletions ui/components/app/assets/nfts/nft-grid/nft-grid.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import React from 'react';
import { useSelector } from 'react-redux';
import { Hex } from '@metamask/utils';
import { Display } from '../../../../../helpers/constants/design-system';
import {
AlignItems,
Display,
JustifyContent,
} from '../../../../../helpers/constants/design-system';
import { Box } from '../../../../component-library';
import Spinner from '../../../../ui/spinner';
import { getNftImageAlt } from '../../../../../helpers/utils/nfts';
Expand Down Expand Up @@ -99,15 +103,21 @@ export default function NftGrid({
</Box>
);
})}
{nftsStillFetchingIndication ? (
<Box className="nfts-tab__fetching">
<Spinner
color="var(--color-warning-default)"
className="loading-overlay__spinner"
/>
</Box>
) : null}
</Box>
{nftsStillFetchingIndication ? (
<Box
className="nfts-tab__fetching"
justifyContent={JustifyContent.center}
alignItems={AlignItems.center}
display={Display.Flex}
marginTop={4}
>
<Spinner
color="var(--color-warning-default)"
className="loading-overlay__spinner"
/>
</Box>
) : null}
</Box>
);
}
8 changes: 7 additions & 1 deletion ui/components/app/assets/nfts/nfts-tab/nfts-tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,13 @@ export default function NftsTab() {

if (!hasAnyNfts && nftsStillFetchingIndication) {
return (
<Box className="nfts-tab__loading">
<Box
className="nfts-tab__loading"
justifyContent={JustifyContent.center}
alignItems={AlignItems.center}
display={Display.Flex}
marginTop={4}
>
<Spinner
color="var(--color-warning-default)"
className="loading-overlay__spinner"
Expand Down
Loading