Skip to content

Commit

Permalink
Merge pull request #96 from P4-Games/fix/nft-image
Browse files Browse the repository at this point in the history
merge fix/nft-image into develop
  • Loading branch information
dappsar authored Sep 24, 2024
2 parents 258ea9d + 13cba0f commit ee288dc
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
6 changes: 1 addition & 5 deletions src/sections/nfts/nft-item-claim.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,17 @@ import { BOT_WAPP_URL, NFT_MARKETPLACE } from 'src/config-global'

import { varFade } from 'src/components/animate'

import { INFTMetadata } from 'src/types/wallet'

// ----------------------------------------------------------------------

type NftItemClaimProps = {
nftId: string
nftData: INFTMetadata
nftData: { image: string; description: string }
}

export default function NftItemClaim({ nftId, nftData }: NftItemClaimProps) {
const mdUp = useResponsive('up', 'md')
const { t } = useTranslate()

console.log('xxxxxxxxx', nftData)

const handleOpenOpenSea = () => {
const url = `${NFT_MARKETPLACE.replace('ID', nftId)}`
window.open(url, '_blank')
Expand Down
2 changes: 1 addition & 1 deletion src/sections/nfts/nft-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export default function NftItem({ nft }: Props) {
>
<Avatar
alt='nft'
src={metadata.image}
src={metadata.image_url}
variant='rounded'
sx={{
position: 'absolute',
Expand Down
15 changes: 10 additions & 5 deletions src/sections/nfts/view/nft-mint-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import EmptyContent from 'src/components/empty-content'
import { useSettingsContext } from 'src/components/settings'
import { LoadingScreen } from 'src/components/loading-screen'

import { INFTMetadata } from 'src/types/wallet'

import NftItemClaim from '../nft-item-claim'

// ----------------------------------------------------------------------
Expand All @@ -22,10 +20,17 @@ export default function NftMintView({ nftId }: NftItemProps) {
const { t } = useTranslate()
const settings = useSettingsContext()

const { data: nftData, isLoading }: { data: INFTMetadata; isLoading: boolean } =
useGetNftById(nftId)
const {
data: nftData,
isLoading
}: {
data: {
image: string
description: string
}
isLoading: boolean
} = useGetNftById(nftId)

console.log('nftData', nftData)
const notFound = !nftData

const renderContent = (
Expand Down
2 changes: 1 addition & 1 deletion src/types/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export type IBalances = {
}

export type INFTMetadata = {
image: string
image_url: string
description: string
}

Expand Down

0 comments on commit ee288dc

Please sign in to comment.