Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/l1 wearables #1737

Merged
merged 3 commits into from
May 30, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat: removed favorites and creator for items in ethereum
flobarreto committed May 30, 2023
commit 59b3c8a45c7a536549b6568462915960976e0173
14 changes: 8 additions & 6 deletions webapp/src/components/AssetCard/AssetCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useCallback, useMemo } from 'react'
import { Item, RentalListing } from '@dcl/schemas'
import { Item, Network, RentalListing } from '@dcl/schemas'
import { useInView } from 'react-intersection-observer'
import { t } from 'decentraland-dapps/dist/modules/translation/utils'
import { Profile } from 'decentraland-dapps/dist/containers'
@@ -217,11 +217,13 @@ const AssetCard = (props: Props) => {
className={isCatalogItem(asset) ? 'catalogTitle' : 'title'}
>
<span className={'textOverflow'}>{title}</span>
{!isNFT(asset) && isCatalogItem(asset) && (
<span className="creator">
<Profile address={asset.creator} textOnly />
</span>
)}
{!isNFT(asset) &&
isCatalogItem(asset) &&
asset.network === Network.MATIC && (
<span className="creator">
<Profile address={asset.creator} textOnly />
</span>
)}
</div>
{!isCatalogItem(asset) && price ? (
<Mana network={asset.network} inline>
51 changes: 42 additions & 9 deletions webapp/src/components/AssetPage/BuyNFTBox/BuyNFTBox.tsx
Original file line number Diff line number Diff line change
@@ -26,9 +26,10 @@ const BuyNFTBox = ({ nft, address }: Props) => {
} | null>(null)

const [canBid, setCanBid] = useState(false)
const isOwner = nft && nft?.owner === address

useEffect(() => {
if (nft && nft?.owner !== address) {
if (!isOwner && nft) {
bidAPI
.fetchByNFT(
nft.contractAddress,
@@ -46,7 +47,7 @@ const BuyNFTBox = ({ nft, address }: Props) => {
console.error(error)
})
}
}, [nft, address])
}, [nft, address, isOwner])

useEffect(() => {
if (nft) {
@@ -116,13 +117,45 @@ const BuyNFTBox = ({ nft, address }: Props) => {
</div>
</div>
</div>
<BuyNFTButtons
assetType={AssetType.NFT}
contractAddress={nft.contractAddress}
network={nft.network}
tokenId={nft.tokenId}
buyWithCardClassName={styles.buyWithCardClassName}
/>
{isOwner ? (
listing ? (
<>
<Button
as={Link}
to={locations.sell(nft.contractAddress, nft.tokenId)}
primary
fluid
>
{t('asset_page.actions.update')}
</Button>
<Button
as={Link}
to={locations.cancel(nft.contractAddress, nft.tokenId)}
fluid
inverted
>
{t('asset_page.actions.cancel_sale')}
</Button>
</>
) : (
<Button
as={Link}
to={locations.sell(nft.contractAddress, nft.tokenId)}
primary
fluid
>
{t('asset_page.actions.sell')}
</Button>
)
) : (
<BuyNFTButtons
assetType={AssetType.NFT}
contractAddress={nft.contractAddress}
network={nft.network}
tokenId={nft.tokenId}
buyWithCardClassName={styles.buyWithCardClassName}
/>
)}
{canBid && (
<Button
inverted
4 changes: 2 additions & 2 deletions webapp/src/components/AssetPage/ItemDetail/ItemDetail.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useMemo, useRef } from 'react'
import { BodyShape, EmotePlayMode, NFTCategory } from '@dcl/schemas'
import { BodyShape, EmotePlayMode, NFTCategory, Network } from '@dcl/schemas'
import { t } from 'decentraland-dapps/dist/modules/translation/utils'
import { locations } from '../../../modules/routing/locations'
import { Section } from '../../../modules/vendor/decentraland'
@@ -117,7 +117,7 @@ const ItemDetail = ({ item }: Props) => {
}
>
<div className={styles.basicRow}>
<Owner asset={item} />
{item.network === Network.MATIC ? <Owner asset={item} /> : null}
<Collection asset={item} />
</div>
<BestBuyingOption asset={item} tableRef={tableRef} />
6 changes: 5 additions & 1 deletion webapp/src/components/AssetPage/OnBack/OnBack.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react'
import { Network } from '@dcl/schemas'
import { Button } from 'decentraland-ui'
import { useMobileMediaQuery } from 'decentraland-ui/dist/components/Media'
import { t } from 'decentraland-dapps/dist/modules/translation/utils'
@@ -74,7 +75,10 @@ const OnBack = ({ asset, isFavoritesEnabled, onBack }: Props) => {
<img src={onBackIcon} alt={t('global.back')} />
{t('global.back')}
</Button>
{isFavoritesEnabled && isMobile && !isNFT(asset) ? (
{isFavoritesEnabled &&
isMobile &&
!isNFT(asset) &&
asset.network === Network.MATIC ? (
<FavoritesCounter isCollapsed className="favorites" item={asset} />
) : null}
</div>
6 changes: 5 additions & 1 deletion webapp/src/components/AssetPage/Title/Title.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react'
import { Network } from '@dcl/schemas'
import { useMobileMediaQuery } from 'decentraland-ui/dist/components/Media'
import { getAssetName, isNFT } from '../../../modules/asset/utils'
import { FavoritesCounter } from '../../FavoritesCounter'
@@ -14,7 +15,10 @@ const Title = ({ asset, isFavoritesEnabled }: Props) => {
{getAssetName(asset)} {isNFT(asset) ? `#${asset.issuedId}` : ''}{' '}
</span>
{/* TODO (lists): this may be moved after the new detail page for unified markets */}
{isFavoritesEnabled && !isMobile && !isNFT(asset) ? (
{isFavoritesEnabled &&
!isMobile &&
!isNFT(asset) &&
asset.network === Network.MATIC ? (
<FavoritesCounter
isCollapsed
className={styles.favorites}