Commit c362f4fe authored by Jack Short's avatar Jack Short Committed by GitHub

chore: removing unnecessary data in assets query (#6301)

* chore: removing unnecessary data in assets query

* no smallimageurl

* disabling nft drawer loading initially on nft pages

* removed too much

* renaming

* fix missing rank
parent 271ef580
......@@ -5,13 +5,22 @@ import { useState } from 'react'
import InfiniteScroll from 'react-infinite-scroll-component'
import styled from 'styled-components/macro'
import { useToggleWalletDrawer } from '..'
import { useWalletDrawer } from '..'
import { DEFAULT_NFT_QUERY_AMOUNT } from './constants'
import { NFT } from './NFT'
export default function NFTs({ account }: { account: string }) {
const { walletAssets, loading, hasNext, loadMore } = useNftBalance(account, [], [], DEFAULT_NFT_QUERY_AMOUNT)
const toggleWalletDrawer = useToggleWalletDrawer()
const [walletDrawerOpen, toggleWalletDrawer] = useWalletDrawer()
const { walletAssets, loading, hasNext, loadMore } = useNftBalance(
account,
[],
[],
DEFAULT_NFT_QUERY_AMOUNT,
undefined,
undefined,
undefined,
!walletDrawerOpen
)
const [currentTokenPlayingMedia, setCurrentTokenPlayingMedia] = useState<string | undefined>()
......
......@@ -39,33 +39,18 @@ gql`
node {
id
name
ownerAddress
image {
url
}
smallImage {
url
}
originalImage {
url
}
tokenId
description
animationUrl
suspiciousFlag
collection {
name
isVerified
image {
url
}
creator {
address
profileImage {
url
}
isVerified
}
nftContracts {
address
standard
......@@ -98,11 +83,8 @@ gql`
}
}
rarities {
provider
rank
score
}
metadataUrl
}
cursor
}
......
......@@ -122,7 +122,8 @@ export function useNftBalance(
first?: number,
after?: string,
last?: number,
before?: string
before?: string,
skip = false
) {
const { data, loading, fetchMore } = useNftBalanceQuery({
variables: {
......@@ -140,6 +141,7 @@ export function useNftBalance(
last,
before,
},
skip,
})
const hasNext = data?.nftBalances?.pageInfo?.hasNextPage
......
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