Skip to content

Commit

Permalink
fix: size of nft skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurgeron committed Feb 12, 2025
1 parent bfb6000 commit a67facc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const BalanceNFTs = ({

return (
<Box css={styles.root}>
{isLoading && !collections.length && (
{isLoading && (
<Box css={styles.gridLoading}>
<NFTImageLoading />
<NFTImageLoading />
Expand All @@ -54,7 +54,7 @@ export const BalanceNFTs = ({
hideFaucet
/>
)}
{!!collections.length && (
{!isLoading && !!collections.length && (
<Accordion type="multiple" defaultValue={defaultValue}>
{collections.map((collection) => (
<Accordion.Item key={collection.name} value={collection.name}>
Expand Down Expand Up @@ -115,8 +115,10 @@ const styles = {
borderBottom: '1px solid $border',
borderRadius: '$none',

svg: {
width: '$3',
'.empty': {
svg: {
width: '$3',
},
},
},
'.fuel_Accordion-content': {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface NFTImageProps {

function Empty() {
return (
<Box css={styles.noImage}>
<Box css={styles.noImage} className="empty">
<Icon icon={Icon.is('FileOff')} />
</Box>
);
Expand All @@ -36,6 +36,7 @@ const _NFTImage = ({ assetId, image }: NFTImageProps) => {

if (!image || !!fallback) return <Empty />;


return (
<Box css={styles.item}>
{isLoading && <NFTImageLoading />}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { cssObj } from '@fuel-ui/css';
import { ContentLoader } from '@fuel-ui/react';

export function NFTImageLoading({ height = 89 }: { height?: number }) {
export function NFTImageLoading({ size = 89 }: { size?: number }) {
return (
<ContentLoader
width="100%"
height={height ?? '100%'}
viewBox={`0 0 22 ${height}`}
width={size}
height={size}
viewBox={`0 0 ${size} ${size}`}
style={cssObj({
borderRadius: '12px',
})}
>
<rect x="0" y="0" rx="0" ry="0" width="22" height="89" />
<rect x="0" y="0" rx="0" ry="0" width={size} height={size} />
</ContentLoader>
);
}

0 comments on commit a67facc

Please sign in to comment.