Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
interface
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LuckySwap
interface
Commits
e4473e30
Unverified
Commit
e4473e30
authored
Nov 29, 2022
by
lynn
Committed by
GitHub
Nov 29, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: use same loader in view my nfts as collection (#5428)
* loader * fix
parent
da2f168e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
23 deletions
+20
-23
CollectionNfts.tsx
src/nft/components/collection/CollectionNfts.tsx
+3
-3
ProfilePage.tsx
src/nft/components/profile/view/ProfilePage.tsx
+17
-20
No files found.
src/nft/components/collection/CollectionNfts.tsx
View file @
e4473e30
...
@@ -127,7 +127,7 @@ export const ClearAllButton = styled.button`
...
@@ -127,7 +127,7 @@ export const ClearAllButton = styled.button`
background: none;
background: none;
`
`
const
InfiniteScrollWrapper
=
styled
.
div
`
export
const
InfiniteScrollWrapper
=
styled
.
div
`
${
InfiniteScrollWrapperCss
}
${
InfiniteScrollWrapperCss
}
`
`
...
@@ -168,9 +168,9 @@ const MarketNameWrapper = styled(Row)`
...
@@ -168,9 +168,9 @@ const MarketNameWrapper = styled(Row)`
gap: 8px;
gap: 8px;
`
`
const
LoadingAssets
=
(
)
=>
(
export
const
LoadingAssets
=
({
count
}:
{
count
?:
number
}
)
=>
(
<>
<>
{
Array
.
from
(
Array
(
ASSET_PAGE_SIZE
),
(
_
,
index
)
=>
(
{
Array
.
from
(
Array
(
count
??
ASSET_PAGE_SIZE
),
(
_
,
index
)
=>
(
<
CollectionAssetLoading
key=
{
index
}
/>
<
CollectionAssetLoading
key=
{
index
}
/>
))
}
))
}
</>
</>
...
...
src/nft/components/profile/view/ProfilePage.tsx
View file @
e4473e30
import
{
useNftBalanceQuery
}
from
'
graphql/data/nft/NftBalance
'
import
{
useNftBalanceQuery
}
from
'
graphql/data/nft/NftBalance
'
import
{
AnimatedBox
,
Box
}
from
'
nft/components/Box
'
import
{
AnimatedBox
,
Box
}
from
'
nft/components/Box
'
import
{
ClearAllButton
}
from
'
nft/components/collection/CollectionNfts
'
import
{
ClearAllButton
,
LoadingAssets
}
from
'
nft/components/collection/CollectionNfts
'
import
{
assetList
}
from
'
nft/components/collection/CollectionNfts.css
'
import
{
assetList
}
from
'
nft/components/collection/CollectionNfts.css
'
import
{
FilterButton
}
from
'
nft/components/collection/FilterButton
'
import
{
FilterButton
}
from
'
nft/components/collection/FilterButton
'
import
{
LoadingSparkle
}
from
'
nft/components/common/Loading/LoadingSparkle
'
import
{
Column
,
Row
}
from
'
nft/components/Flex
'
import
{
Center
,
Column
,
Row
}
from
'
nft/components/Flex
'
import
{
CrossIcon
}
from
'
nft/components/icons
'
import
{
CrossIcon
}
from
'
nft/components/icons
'
import
{
FilterSidebar
}
from
'
nft/components/profile/view/FilterSidebar
'
import
{
FilterSidebar
}
from
'
nft/components/profile/view/FilterSidebar
'
import
{
subhead
}
from
'
nft/css/common.css
'
import
{
subhead
}
from
'
nft/css/common.css
'
...
@@ -201,6 +200,7 @@ const ProfilePageNfts = ({
...
@@ -201,6 +200,7 @@ const ProfilePageNfts = ({
walletAssets
:
ownerAssets
,
walletAssets
:
ownerAssets
,
loadNext
,
loadNext
,
hasNext
,
hasNext
,
isLoadingNext
,
}
=
useNftBalanceQuery
(
address
,
collectionFilters
,
[],
DEFAULT_WALLET_ASSET_QUERY_AMOUNT
)
}
=
useNftBalanceQuery
(
address
,
collectionFilters
,
[],
DEFAULT_WALLET_ASSET_QUERY_AMOUNT
)
const
{
gridX
}
=
useSpring
({
const
{
gridX
}
=
useSpring
({
...
@@ -245,27 +245,24 @@ const ProfilePageNfts = ({
...
@@ -245,27 +245,24 @@ const ProfilePageNfts = ({
next=
{
()
=>
loadNext
(
DEFAULT_WALLET_ASSET_QUERY_AMOUNT
)
}
next=
{
()
=>
loadNext
(
DEFAULT_WALLET_ASSET_QUERY_AMOUNT
)
}
hasMore=
{
hasNext
}
hasMore=
{
hasNext
}
loader=
{
loader=
{
<
Center
>
Boolean
(
hasNext
&&
ownerAssets
?.
length
)
&&
<
LoadingAssets
count=
{
DEFAULT_WALLET_ASSET_QUERY_AMOUNT
}
/>
<
LoadingSparkle
/>
</
Center
>
}
}
dataLength=
{
ownerAssets
?.
length
??
0
}
dataLength=
{
ownerAssets
?.
length
??
0
}
className=
{
ownerAssets
?.
length
||
isLoadingNext
?
assetList
:
undefined
}
style=
{
{
overflow
:
'
unset
'
}
}
style=
{
{
overflow
:
'
unset
'
}
}
>
>
<
div
className=
{
assetList
}
>
{
ownerAssets
?.
length
{
ownerAssets
?.
length
?
ownerAssets
.
map
((
asset
,
index
)
=>
(
?
ownerAssets
.
map
((
asset
,
index
)
=>
(
<
div
key=
{
index
}
>
<
div
key=
{
index
}
>
<
ViewMyNftsAsset
<
ViewMyNftsAsset
asset=
{
asset
}
asset=
{
asset
}
mediaShouldBePlaying=
{
asset
.
tokenId
===
currentTokenPlayingMedia
}
mediaShouldBePlaying=
{
asset
.
tokenId
===
currentTokenPlayingMedia
}
setCurrentTokenPlayingMedia=
{
setCurrentTokenPlayingMedia
}
setCurrentTokenPlayingMedia=
{
setCurrentTokenPlayingMedia
}
hideDetails=
{
sellAssets
.
length
>
0
}
hideDetails=
{
sellAssets
.
length
>
0
}
/>
/>
</
div
>
</
div
>
))
))
:
null
}
:
null
}
</
div
>
</
InfiniteScroll
>
</
InfiniteScroll
>
</
AnimatedBox
>
</
AnimatedBox
>
)
}
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment