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