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
b667662b
Unverified
Commit
b667662b
authored
Sep 22, 2023
by
Zach Pomerantz
Committed by
GitHub
Sep 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: lazy load nft profile (#7361)
parent
ed87df62
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
33 deletions
+3
-33
ProfilePageLoadingSkeleton.tsx
...ft/components/profile/view/ProfilePageLoadingSkeleton.tsx
+0
-19
index.tsx
src/nft/pages/profile/index.tsx
+2
-13
App.tsx
src/pages/App.tsx
+1
-1
No files found.
src/nft/components/profile/view/ProfilePageLoadingSkeleton.tsx
View file @
b667662b
import
{
Box
}
from
'
nft/components/Box
'
import
{
Box
}
from
'
nft/components/Box
'
import
{
assetList
}
from
'
nft/components/collection/CollectionNfts.css
'
import
{
assetList
}
from
'
nft/components/collection/CollectionNfts.css
'
import
{
loadingAsset
}
from
'
nft/css/loading.css
'
import
{
loadingAsset
}
from
'
nft/css/loading.css
'
import
{
ScreenBreakpointsPaddings
}
from
'
nft/pages/collection/index.css
'
import
styled
from
'
styled-components
'
import
styled
from
'
styled-components
'
import
{
DEFAULT_WALLET_ASSET_QUERY_AMOUNT
}
from
'
./ProfilePage
'
import
{
DEFAULT_WALLET_ASSET_QUERY_AMOUNT
}
from
'
./ProfilePage
'
const
SkeletonPageWrapper
=
styled
.
div
`
${
ScreenBreakpointsPaddings
}
;
padding-top: 40px;
width: 100%;
@media only screen and (max-width:
${({
theme
})
=>
`
${
theme
.
breakpoint
.
sm
}
px`
}
) {
padding-top: 16px;
}
`
const
SkeletonBodyWrapper
=
styled
.
div
`
const
SkeletonBodyWrapper
=
styled
.
div
`
display: flex;
display: flex;
flex-direction: column;
flex-direction: column;
...
@@ -86,11 +75,3 @@ export const ProfileBodyLoadingSkeleton = () => {
...
@@ -86,11 +75,3 @@ export const ProfileBodyLoadingSkeleton = () => {
</
SkeletonBodyWrapper
>
</
SkeletonBodyWrapper
>
)
)
}
}
export
const
ProfilePageLoadingSkeleton
=
()
=>
{
return
(
<
SkeletonPageWrapper
>
<
ProfileBodyLoadingSkeleton
/>
</
SkeletonPageWrapper
>
)
}
src/nft/pages/profile/
profile
.tsx
→
src/nft/pages/profile/
index
.tsx
View file @
b667662b
...
@@ -7,10 +7,9 @@ import { ButtonPrimary } from 'components/Button'
...
@@ -7,10 +7,9 @@ import { ButtonPrimary } from 'components/Button'
import
{
XXXL_BAG_WIDTH
}
from
'
nft/components/bag/Bag
'
import
{
XXXL_BAG_WIDTH
}
from
'
nft/components/bag/Bag
'
import
{
ListPage
}
from
'
nft/components/profile/list/ListPage
'
import
{
ListPage
}
from
'
nft/components/profile/list/ListPage
'
import
{
ProfilePage
}
from
'
nft/components/profile/view/ProfilePage
'
import
{
ProfilePage
}
from
'
nft/components/profile/view/ProfilePage
'
import
{
ProfilePageLoadingSkeleton
}
from
'
nft/components/profile/view/ProfilePageLoadingSkeleton
'
import
{
useBag
,
useProfilePageState
,
useSellAsset
,
useWalletCollections
}
from
'
nft/hooks
'
import
{
useBag
,
useProfilePageState
,
useSellAsset
,
useWalletCollections
}
from
'
nft/hooks
'
import
{
ProfilePageStateType
}
from
'
nft/types
'
import
{
ProfilePageStateType
}
from
'
nft/types
'
import
{
Suspense
,
useEffect
,
useRef
}
from
'
react
'
import
{
useEffect
,
useRef
}
from
'
react
'
import
styled
from
'
styled-components
'
import
styled
from
'
styled-components
'
import
{
BREAKPOINTS
}
from
'
theme
'
import
{
BREAKPOINTS
}
from
'
theme
'
import
{
ThemedText
}
from
'
theme/components
'
import
{
ThemedText
}
from
'
theme/components
'
...
@@ -60,7 +59,7 @@ const ConnectWalletButton = styled(ButtonPrimary)`
...
@@ -60,7 +59,7 @@ const ConnectWalletButton = styled(ButtonPrimary)`
border: none;
border: none;
`
`
const
ProfileContent
=
()
=>
{
export
default
function
Profile
()
{
const
sellPageState
=
useProfilePageState
((
state
)
=>
state
.
state
)
const
sellPageState
=
useProfilePageState
((
state
)
=>
state
.
state
)
const
setSellPageState
=
useProfilePageState
((
state
)
=>
state
.
setProfilePageState
)
const
setSellPageState
=
useProfilePageState
((
state
)
=>
state
.
setProfilePageState
)
const
resetSellAssets
=
useSellAsset
((
state
)
=>
state
.
reset
)
const
resetSellAssets
=
useSellAsset
((
state
)
=>
state
.
reset
)
...
@@ -104,13 +103,3 @@ const ProfileContent = () => {
...
@@ -104,13 +103,3 @@ const ProfileContent = () => {
</
Trace
>
</
Trace
>
)
)
}
}
const
Profile
=
()
=>
{
return
(
<
Suspense
fallback=
{
<
ProfilePageLoadingSkeleton
/>
}
>
<
ProfileContent
/>
</
Suspense
>
)
}
export
default
Profile
src/pages/App.tsx
View file @
b667662b
...
@@ -32,7 +32,7 @@ import Swap from './Swap'
...
@@ -32,7 +32,7 @@ import Swap from './Swap'
const
AppChrome
=
lazy
(()
=>
import
(
'
./AppChrome
'
))
const
AppChrome
=
lazy
(()
=>
import
(
'
./AppChrome
'
))
const
NftExplore
=
lazy
(()
=>
import
(
'
nft/pages/explore
'
))
const
NftExplore
=
lazy
(()
=>
import
(
'
nft/pages/explore
'
))
const
Collection
=
lazy
(()
=>
import
(
'
nft/pages/collection
'
))
const
Collection
=
lazy
(()
=>
import
(
'
nft/pages/collection
'
))
const
Profile
=
lazy
(()
=>
import
(
'
nft/pages/profile
/profile
'
))
const
Profile
=
lazy
(()
=>
import
(
'
nft/pages/profile
'
))
const
Asset
=
lazy
(()
=>
import
(
'
nft/pages/asset/Asset
'
))
const
Asset
=
lazy
(()
=>
import
(
'
nft/pages/asset/Asset
'
))
const
AddLiquidity
=
lazy
(()
=>
import
(
'
pages/AddLiquidity
'
))
const
AddLiquidity
=
lazy
(()
=>
import
(
'
pages/AddLiquidity
'
))
const
RedirectDuplicateTokenIds
=
lazy
(()
=>
import
(
'
pages/AddLiquidity/redirects
'
))
const
RedirectDuplicateTokenIds
=
lazy
(()
=>
import
(
'
pages/AddLiquidity/redirects
'
))
...
...
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