fix: give a bunch of list renders keys (#5158)
* fix: give a bunch of list renders keys * pr feedback * pr feedback
This commit is contained in:
parent
4438818f38
commit
4ef4ea8f58
@ -6,7 +6,9 @@ import { useIsCollectionLoading } from 'nft/hooks'
|
||||
|
||||
import * as styles from './ActivitySwitcher.css'
|
||||
|
||||
export const ActivitySwitcherLoading = new Array(2).fill(<div className={styles.styledLoading} />)
|
||||
export const ActivitySwitcherLoading = new Array(2)
|
||||
.fill(null)
|
||||
.map((_, index) => <div className={styles.styledLoading} key={`ActivitySwitcherLoading-key-${index}`} />)
|
||||
|
||||
export const ActivitySwitcher = ({
|
||||
showActivity,
|
||||
|
@ -255,14 +255,19 @@ const StatsItem = ({ children, label, shouldHide }: { children: ReactNode; label
|
||||
}
|
||||
|
||||
const statsLoadingSkeleton = (isMobile: boolean) =>
|
||||
new Array(5).fill(
|
||||
<>
|
||||
<Box display="flex" flexDirection={isMobile ? 'row' : 'column'} alignItems="baseline" gap="2" height="min">
|
||||
<div className={styles.statsLabelLoading} />
|
||||
<span className={styles.statsValueLoading} />
|
||||
</Box>
|
||||
</>
|
||||
)
|
||||
new Array(5).fill(null).map((_, index) => (
|
||||
<Box
|
||||
display="flex"
|
||||
flexDirection={isMobile ? 'row' : 'column'}
|
||||
alignItems="baseline"
|
||||
gap="2"
|
||||
height="min"
|
||||
key={`statsLoadingSkeleton-key-${index}`}
|
||||
>
|
||||
<div className={styles.statsLabelLoading} />
|
||||
<span className={styles.statsValueLoading} />
|
||||
</Box>
|
||||
))
|
||||
|
||||
const StatsRow = ({ stats, isMobile, ...props }: { stats: GenieCollection; isMobile?: boolean } & BoxProps) => {
|
||||
const uniqueOwnersPercentage = stats?.stats?.total_supply
|
||||
|
@ -227,12 +227,15 @@ export const CarouselCard = ({ collection, onClick }: CarouselCardProps) => {
|
||||
const marketplace = gqlCollection.marketplaceCount?.find(
|
||||
(marketplace) => marketplace.marketplace === market
|
||||
)
|
||||
if (!marketplace) {
|
||||
return null
|
||||
}
|
||||
return (
|
||||
<MarketplaceRow
|
||||
key={'trendingCollection' + collection.address}
|
||||
key={`CarouselCard-key-${collection.address}-${marketplace.marketplace}`}
|
||||
marketplace={MARKETS_ENUM_TO_NAME[market]}
|
||||
listings={marketplace?.count?.toString()}
|
||||
floor={marketplace?.floorPrice?.toString()}
|
||||
listings={marketplace.count.toString()}
|
||||
floor={marketplace.floorPrice.toString()}
|
||||
/>
|
||||
)
|
||||
})}
|
||||
|
Loading…
Reference in New Issue
Block a user