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
68709ae6
Unverified
Commit
68709ae6
authored
Nov 14, 2022
by
aballerr
Committed by
GitHub
Nov 14, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: Details loading (#5162)
* Merging in details loading state
parent
ac1e83ea
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
149 additions
and
13 deletions
+149
-13
FilterButton.tsx
src/nft/components/collection/FilterButton.tsx
+1
-8
AssetDetailsLoading.tsx
src/nft/components/details/AssetDetailsLoading.tsx
+145
-0
Asset.tsx
src/nft/pages/asset/Asset.tsx
+1
-4
App.tsx
src/pages/App.tsx
+2
-1
No files found.
src/nft/components/collection/FilterButton.tsx
View file @
68709ae6
...
@@ -3,7 +3,6 @@ import { Box } from 'nft/components/Box'
...
@@ -3,7 +3,6 @@ import { Box } from 'nft/components/Box'
import
*
as
styles
from
'
nft/components/collection/FilterButton.css
'
import
*
as
styles
from
'
nft/components/collection/FilterButton.css
'
import
{
FilterIcon
}
from
'
nft/components/icons
'
import
{
FilterIcon
}
from
'
nft/components/icons
'
import
{
buttonTextMedium
}
from
'
nft/css/common.css
'
import
{
buttonTextMedium
}
from
'
nft/css/common.css
'
import
{
useIsCollectionLoading
}
from
'
nft/hooks
'
import
{
pluralize
,
putCommas
}
from
'
nft/utils
'
import
{
pluralize
,
putCommas
}
from
'
nft/utils
'
export
const
FilterButton
=
({
export
const
FilterButton
=
({
...
@@ -17,15 +16,9 @@ export const FilterButton = ({
...
@@ -17,15 +16,9 @@ export const FilterButton = ({
onClick
:
()
=>
void
onClick
:
()
=>
void
collectionCount
?:
number
collectionCount
?:
number
})
=>
{
})
=>
{
const
isCollectionNftsLoading
=
useIsCollectionLoading
((
state
)
=>
state
.
isCollectionNftsLoading
)
return
(
return
(
<
Box
<
Box
className=
{
className=
{
clsx
(
styles
.
filterButton
,
!
isFiltersExpanded
&&
styles
.
filterButtonExpanded
)
}
isCollectionNftsLoading
?
styles
.
filterButtonLoading
:
clsx
(
styles
.
filterButton
,
!
isFiltersExpanded
&&
styles
.
filterButtonExpanded
)
}
display=
"flex"
display=
"flex"
gap=
"8"
gap=
"8"
borderRadius=
"12"
borderRadius=
"12"
...
...
src/nft/components/details/AssetDetailsLoading.tsx
0 → 100644
View file @
68709ae6
import
Column
from
'
components/Column
'
import
Loader
from
'
components/Loader
'
import
{
LoadingBubble
}
from
'
components/Tokens/loading
'
import
{
ScreenBreakpointsPaddings
}
from
'
nft/pages/collection/index.css
'
import
styled
,
{
useTheme
}
from
'
styled-components/macro
'
const
BREAKPOINT
=
'
960px
'
const
Title
=
styled
(
LoadingBubble
)
`
height: 16px;
width: 136px;
`
const
SubTitle
=
styled
(
LoadingBubble
)
`
height: 40px;
width: 200px;
margin-top: 12px;
`
const
PrimaryBody
=
styled
(
LoadingBubble
)
`
width: 100%;
height: 260px;
`
const
PrimaryContent
=
styled
(
Column
)
`
max-width: 780px;
margin-top: 28px;
width: 100%;
@media (max-width:
${
BREAKPOINT
}
) {
max-width: 100%;
}
`
const
SecondaryContent
=
styled
(
LoadingBubble
)
`
width: 100%;
height: 60px;
margin-top: 28px;
`
const
LoaderContainer
=
styled
.
div
`
width: 100%;
padding-top: 200px;
padding-bottom: 200px;
display: flex;
justify-content: center;
align-items: center;
color: pink;
`
const
BuyNowContainer
=
styled
(
LoadingBubble
)
`
height: 180px;
width: 360px;
margin-top: 28px;
@media (max-width:
${
BREAKPOINT
}
) {
width: 100%;
}
`
const
PriceContainer
=
styled
(
LoadingBubble
)
`
height: 16px;
width: 136px;
@media (max-width:
${
BREAKPOINT
}
) {
margin-top: 20px;
}
`
const
LoadingContainer
=
styled
.
div
`
display: flex;
margin-top: 48px;
width: 100%;
margin-left: auto;
margin-right: auto;
max-width: 1296px;
${
ScreenBreakpointsPaddings
}
@media (max-width:
${
BREAKPOINT
}
) {
max-width: 100%;
margin-top: 0;
}
`
const
StyledColumn
=
styled
(
Column
)
`
max-width: 780px;
width: 100%;
@media (max-width:
${
BREAKPOINT
}
) {
max-width: 100%;
}
`
const
BuyNowLoadingDesktop
=
styled
.
div
`
padding-left: 60px;
@media (max-width:
${
BREAKPOINT
}
) {
display: none;
}
`
const
BuyNowLoadingMobile
=
styled
.
div
`
display: none;
margin-top: 16px;
@media (max-width:
${
BREAKPOINT
}
) {
display: block;
}
`
const
BuyNowLoading
=
()
=>
(
<>
<
PriceContainer
/>
<
BuyNowContainer
/>
</>
)
export
const
AssetDetailsLoading
=
()
=>
{
const
theme
=
useTheme
()
return
(
<
LoadingContainer
>
<
StyledColumn
>
<
LoaderContainer
>
<
Loader
stroke=
{
theme
.
accentAction
}
size=
"40px"
/>
</
LoaderContainer
>
<
Title
/>
<
SubTitle
/>
<
BuyNowLoadingMobile
>
<
BuyNowLoading
/>
</
BuyNowLoadingMobile
>
<
PrimaryContent
>
<
PrimaryBody
/>
<
SecondaryContent
/>
<
SecondaryContent
/>
<
SecondaryContent
/>
</
PrimaryContent
>
</
StyledColumn
>
<
BuyNowLoadingDesktop
>
<
BuyNowLoading
/>
</
BuyNowLoadingDesktop
>
</
LoadingContainer
>
)
}
src/nft/pages/asset/Asset.tsx
View file @
68709ae6
...
@@ -28,7 +28,6 @@ const AssetContainer = styled.div`
...
@@ -28,7 +28,6 @@ const AssetContainer = styled.div`
const
AssetPriceDetailsContainer
=
styled
.
div
`
const
AssetPriceDetailsContainer
=
styled
.
div
`
min-width: 360px;
min-width: 360px;
position: relative;
position: relative;
padding-right: 100px;
@media (max-width: 960px) {
@media (max-width: 960px) {
display: none;
display: none;
...
@@ -55,9 +54,7 @@ const Asset = () => {
...
@@ -55,9 +54,7 @@ const Asset = () => {
<
AssetPriceDetails
collection=
{
collection
}
asset=
{
asset
}
/>
<
AssetPriceDetails
collection=
{
collection
}
asset=
{
asset
}
/>
</
AssetPriceDetailsContainer
>
</
AssetPriceDetailsContainer
>
</
AssetContainer
>
</
AssetContainer
>
)
:
(
)
:
null
}
<
div
>
Holder for loading ...
</
div
>
)
}
</
Trace
>
</
Trace
>
</>
</>
)
)
...
...
src/pages/App.tsx
View file @
68709ae6
...
@@ -6,6 +6,7 @@ import { useFeatureFlagsIsLoaded } from 'featureFlags'
...
@@ -6,6 +6,7 @@ import { useFeatureFlagsIsLoaded } from 'featureFlags'
import
{
NftVariant
,
useNftFlag
}
from
'
featureFlags/flags/nft
'
import
{
NftVariant
,
useNftFlag
}
from
'
featureFlags/flags/nft
'
import
ApeModeQueryParamReader
from
'
hooks/useApeModeQueryParamReader
'
import
ApeModeQueryParamReader
from
'
hooks/useApeModeQueryParamReader
'
import
{
CollectionPageSkeleton
}
from
'
nft/components/collection/CollectionPageSkeleton
'
import
{
CollectionPageSkeleton
}
from
'
nft/components/collection/CollectionPageSkeleton
'
import
{
AssetDetailsLoading
}
from
'
nft/components/details/AssetDetailsLoading
'
import
{
ProfilePageLoadingSkeleton
}
from
'
nft/components/profile/view/ProfilePageLoadingSkeleton
'
import
{
ProfilePageLoadingSkeleton
}
from
'
nft/components/profile/view/ProfilePageLoadingSkeleton
'
import
{
lazy
,
Suspense
,
useEffect
,
useState
}
from
'
react
'
import
{
lazy
,
Suspense
,
useEffect
,
useState
}
from
'
react
'
import
{
Navigate
,
Route
,
Routes
,
useLocation
}
from
'
react-router-dom
'
import
{
Navigate
,
Route
,
Routes
,
useLocation
}
from
'
react-router-dom
'
...
@@ -239,7 +240,7 @@ export default function App() {
...
@@ -239,7 +240,7 @@ export default function App() {
<
Route
<
Route
path=
"/nfts/asset/:contractAddress/:tokenId"
path=
"/nfts/asset/:contractAddress/:tokenId"
element=
{
element=
{
<
Suspense
fallback=
{
<
div
>
Holder for loading ...
</
div
>
}
>
<
Suspense
fallback=
{
<
AssetDetailsLoading
/
>
}
>
<
Asset
/>
<
Asset
/>
</
Suspense
>
</
Suspense
>
}
}
...
...
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