Skip to content

Commit

Permalink
Add loop ids
Browse files Browse the repository at this point in the history
  • Loading branch information
sophialittlejohn committed Oct 23, 2023
1 parent 176bbd0 commit 1ebce79
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions centrifuge-app/src/components/PoolList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ export function PoolList() {
? Array(6)
.fill(true)
.map((_, index) => (
<Box as="li" key={index}>
<Box as="li" key={`pool-list-loading-${index}`}>
<PoolCard isLoading={true} />
</Box>
))
: filteredPools.map((pool) => (
<PoolCardBox as="li" key={pool.poolId} status={pool.status}>
<PoolCardBox as="li" key={`pool-list-${pool.poolId}-${Math.random()}`} status={pool.status}>
<PoolCard {...pool} />
</PoolCardBox>
))}
Expand Down
4 changes: 2 additions & 2 deletions centrifuge-app/src/components/Portfolio/AssetAllocation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export function AssetAllocation({ address }: { address: string }) {
<AssetClassChart data={shares} currency="USD" total={total.toNumber()} />
<Shelf as="ul" alignSelf="stretch" alignItems="stretch" flex={1} gap={6}>
{shares.map((cell, i) => (
<>
<Box key={`asset-allocation-${cell.name}-${i}`}>

This comment has been minimized.

Copy link
@onnovisser

onnovisser Oct 24, 2023

Collaborator

My bad 😅
You can make this a React.Fragment, so you can have the key without the extra box

{i > 0 && <Box width="1px" backgroundColor="borderSecondary" />}
<LabelValueStack
label={
Expand All @@ -84,7 +84,7 @@ export function AssetAllocation({ address }: { address: string }) {
}
key={i}
/>
</>
</Box>
))}
</Shelf>
</Shelf>
Expand Down

0 comments on commit 1ebce79

Please sign in to comment.