fix: no title for unavailable nft (#5397)

This commit is contained in:
Jack Short 2022-11-23 19:16:46 -05:00 committed by GitHub
parent d53ba64218
commit 4240908c4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 52 additions and 46 deletions

@ -56,6 +56,10 @@ export const BagContent = () => {
if (hasAssets) setBagStatus(BagStatus.CONFIRM_REVIEW)
else setBagStatus(BagStatus.ADDING_TO_BAG)
}
if (bagStatus === BagStatus.CONFIRM_REVIEW && !hasAssets) {
setBagStatus(BagStatus.ADDING_TO_BAG)
}
}, [bagStatus, itemsInBag, priceChangedAssets, setBagStatus, fetchedPriceData])
return (

@ -278,57 +278,59 @@ export const UnavailableAssetsHeaderRow = ({
if (!assets || assets.length === 0) return null
const moreThanOneUnavailable = assets.length > 1
const isShowingAssets = isOpen || !moreThanOneUnavailable
return (
<Column className={styles.unavailableAssetsContainer}>
{assets.length === 1 && (
<BagRow asset={assets[0]} usdPrice={usdPrice} removeAsset={() => undefined} grayscale isMobile={isMobile} />
)}
{assets.length > 1 && (
<Column>
<Row
justifyContent="space-between"
marginBottom={isOpen ? '12' : '0'}
cursor="pointer"
onClick={() => {
<Column>
<Row
justifyContent="space-between"
marginBottom={isShowingAssets ? '12' : '0'}
cursor={moreThanOneUnavailable ? 'pointer' : 'default'}
onClick={() => {
if (moreThanOneUnavailable) {
!didOpenUnavailableAssets && setDidOpenUnavailableAssets(true)
toggleOpen()
}}
>
<Row gap="12" color="textPrimary" className={bodySmall}>
{!isOpen && <UnavailableAssetsPreview assets={assets.slice(0, 5)} />}
No longer available
</Row>
<Row color="textSecondary">{isOpen ? <ChevronUpBagIcon /> : <ChevronDownBagIcon />}</Row>
{!didOpenUnavailableAssets && (
<Row
position="relative"
width="20"
height="20"
color="textPrimary"
justifyContent="center"
cursor="pointer"
onClick={clearUnavailableAssets}
>
<TimedLoader />
<CloseTimerIcon />
</Row>
)}
}
}}
>
<Row gap="12" color="textSecondary" className={bodySmall}>
{!isShowingAssets && <UnavailableAssetsPreview assets={assets.slice(0, 5)} />}
No longer available
</Row>
<Column gap="8" style={{ marginLeft: '-8px', marginRight: '-8px' }}>
{isOpen &&
assets.map((asset) => (
<BagRow
key={asset.id}
asset={asset}
usdPrice={usdPrice}
removeAsset={() => undefined}
grayscale
isMobile={isMobile}
/>
))}
</Column>
{moreThanOneUnavailable && (
<Row color="textSecondary">{isOpen ? <ChevronUpBagIcon /> : <ChevronDownBagIcon />}</Row>
)}
{!didOpenUnavailableAssets && (
<Row
position="relative"
width="20"
height="20"
color="textPrimary"
justifyContent="center"
cursor="pointer"
onClick={clearUnavailableAssets}
>
<TimedLoader />
<CloseTimerIcon />
</Row>
)}
</Row>
<Column gap="8" style={{ marginLeft: '-8px', marginRight: '-8px' }}>
{isShowingAssets &&
assets.map((asset) => (
<BagRow
key={asset.id}
asset={asset}
usdPrice={usdPrice}
removeAsset={() => undefined}
grayscale
isMobile={isMobile}
/>
))}
</Column>
)}
</Column>
</Column>
)
}

@ -15,7 +15,7 @@ const Circle = styled.circle`
-webkit-animation: ${dash} linear;
animation: ${dash} linear;
animation-duration: 160s;
stroke: ${({ theme }) => theme.accentActive};
stroke: ${({ theme }) => theme.accentAction};
`
export const TimedLoader = () => {
const stroke = 1.5