Commit 4ef4ea8f authored by Jordan Frankfurt's avatar Jordan Frankfurt Committed by GitHub

fix: give a bunch of list renders keys (#5158)

* fix: give a bunch of list renders keys

* pr feedback

* pr feedback
parent 4438818f
...@@ -6,7 +6,9 @@ import { useIsCollectionLoading } from 'nft/hooks' ...@@ -6,7 +6,9 @@ import { useIsCollectionLoading } from 'nft/hooks'
import * as styles from './ActivitySwitcher.css' 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 = ({ export const ActivitySwitcher = ({
showActivity, showActivity,
......
...@@ -255,14 +255,19 @@ const StatsItem = ({ children, label, shouldHide }: { children: ReactNode; label ...@@ -255,14 +255,19 @@ const StatsItem = ({ children, label, shouldHide }: { children: ReactNode; label
} }
const statsLoadingSkeleton = (isMobile: boolean) => const statsLoadingSkeleton = (isMobile: boolean) =>
new Array(5).fill( new Array(5).fill(null).map((_, index) => (
<> <Box
<Box display="flex" flexDirection={isMobile ? 'row' : 'column'} alignItems="baseline" gap="2" height="min"> display="flex"
flexDirection={isMobile ? 'row' : 'column'}
alignItems="baseline"
gap="2"
height="min"
key={`statsLoadingSkeleton-key-${index}`}
>
<div className={styles.statsLabelLoading} /> <div className={styles.statsLabelLoading} />
<span className={styles.statsValueLoading} /> <span className={styles.statsValueLoading} />
</Box> </Box>
</> ))
)
const StatsRow = ({ stats, isMobile, ...props }: { stats: GenieCollection; isMobile?: boolean } & BoxProps) => { const StatsRow = ({ stats, isMobile, ...props }: { stats: GenieCollection; isMobile?: boolean } & BoxProps) => {
const uniqueOwnersPercentage = stats?.stats?.total_supply const uniqueOwnersPercentage = stats?.stats?.total_supply
......
...@@ -227,12 +227,15 @@ export const CarouselCard = ({ collection, onClick }: CarouselCardProps) => { ...@@ -227,12 +227,15 @@ export const CarouselCard = ({ collection, onClick }: CarouselCardProps) => {
const marketplace = gqlCollection.marketplaceCount?.find( const marketplace = gqlCollection.marketplaceCount?.find(
(marketplace) => marketplace.marketplace === market (marketplace) => marketplace.marketplace === market
) )
if (!marketplace) {
return null
}
return ( return (
<MarketplaceRow <MarketplaceRow
key={'trendingCollection' + collection.address} key={`CarouselCard-key-${collection.address}-${marketplace.marketplace}`}
marketplace={MARKETS_ENUM_TO_NAME[market]} marketplace={MARKETS_ENUM_TO_NAME[market]}
listings={marketplace?.count?.toString()} listings={marketplace.count.toString()}
floor={marketplace?.floorPrice?.toString()} floor={marketplace.floorPrice.toString()}
/> />
) )
})} })}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment