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
0ef6d162
Unverified
Commit
0ef6d162
authored
Nov 07, 2022
by
lynn
Committed by
GitHub
Nov 07, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: collection stat line fixes (#5112)
fix
parent
02584608
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
13 deletions
+18
-13
PriceChart.tsx
src/components/Tokens/TokenDetails/PriceChart.tsx
+2
-2
CollectionStats.tsx
src/nft/components/collection/CollectionStats.tsx
+16
-11
No files found.
src/components/Tokens/TokenDetails/PriceChart.tsx
View file @
0ef6d162
...
@@ -52,9 +52,9 @@ export function getDeltaArrow(delta: number | null | undefined) {
...
@@ -52,9 +52,9 @@ export function getDeltaArrow(delta: number | null | undefined) {
if
(
delta
===
null
||
delta
===
undefined
)
{
if
(
delta
===
null
||
delta
===
undefined
)
{
return
null
return
null
}
else
if
(
Math
.
sign
(
delta
)
<
0
)
{
}
else
if
(
Math
.
sign
(
delta
)
<
0
)
{
return
<
StyledDownArrow
size=
{
16
}
key=
"arrow-down"
/>
return
<
StyledDownArrow
size=
{
24
}
key=
"arrow-down"
/>
}
}
return
<
StyledUpArrow
size=
{
16
}
key=
"arrow-up"
/>
return
<
StyledUpArrow
size=
{
24
}
key=
"arrow-up"
/>
}
}
export
function
formatDelta
(
delta
:
number
|
null
|
undefined
)
{
export
function
formatDelta
(
delta
:
number
|
null
|
undefined
)
{
...
...
src/nft/components/collection/CollectionStats.tsx
View file @
0ef6d162
...
@@ -16,7 +16,8 @@ import styled from 'styled-components/macro'
...
@@ -16,7 +16,8 @@ import styled from 'styled-components/macro'
import
{
DiscordIcon
,
EllipsisIcon
,
ExternalIcon
,
InstagramIcon
,
TwitterIcon
,
VerifiedIcon
,
XMarkIcon
}
from
'
../icons
'
import
{
DiscordIcon
,
EllipsisIcon
,
ExternalIcon
,
InstagramIcon
,
TwitterIcon
,
VerifiedIcon
,
XMarkIcon
}
from
'
../icons
'
import
*
as
styles
from
'
./CollectionStats.css
'
import
*
as
styles
from
'
./CollectionStats.css
'
const
PercentChange
=
styled
.
div
`
const
PercentChange
=
styled
.
div
<
{
isNegative
:
boolean
}
>
`
color:
${({
theme
,
isNegative
})
=>
(
isNegative
?
theme
.
accentFailure
:
theme
.
accentSuccess
)}
;
display: flex;
display: flex;
align-items: center;
align-items: center;
justify-content: center;
justify-content: center;
...
@@ -286,7 +287,10 @@ const StatsRow = ({ stats, isMobile, ...props }: { stats: GenieCollection; isMob
...
@@ -286,7 +287,10 @@ const StatsRow = ({ stats, isMobile, ...props }: { stats: GenieCollection; isMob
stats
.
stats
&&
stats
.
stats
.
one_day_floor_change
stats
.
stats
&&
stats
.
stats
.
one_day_floor_change
?
Math
.
round
(
Math
.
abs
(
stats
.
stats
.
one_day_floor_change
)
*
(
isNftGraphQl
?
1
:
100
))
?
Math
.
round
(
Math
.
abs
(
stats
.
stats
.
one_day_floor_change
)
*
(
isNftGraphQl
?
1
:
100
))
:
0
:
0
const
arrow
=
stats
.
stats
&&
stats
.
stats
.
one_day_change
?
getDeltaArrow
(
stats
.
stats
.
one_day_floor_change
)
:
null
const
arrow
=
stats
.
stats
&&
stats
.
stats
.
one_day_floor_change
!==
undefined
?
getDeltaArrow
(
stats
.
stats
.
one_day_floor_change
)
:
null
return
(
return
(
<
Row
gap=
{
{
sm
:
'
36
'
,
md
:
'
60
'
}
}
{
...
props
}
>
<
Row
gap=
{
{
sm
:
'
36
'
,
md
:
'
60
'
}
}
{
...
props
}
>
...
@@ -299,13 +303,19 @@ const StatsRow = ({ stats, isMobile, ...props }: { stats: GenieCollection; isMob
...
@@ -299,13 +303,19 @@ const StatsRow = ({ stats, isMobile, ...props }: { stats: GenieCollection; isMob
{
floorPriceStr
}
ETH
{
floorPriceStr
}
ETH
</
StatsItem
>
</
StatsItem
>
)
:
null
}
)
:
null
}
{
stats
.
stats
?.
one_day_floor_change
?
(
{
stats
.
stats
?.
one_day_floor_change
!==
undefined
?
(
<
StatsItem
label=
"24-Hour Floor"
shouldHide=
{
false
}
>
<
StatsItem
label=
"Floor 24H"
shouldHide=
{
false
}
>
<
PercentChange
>
<
PercentChange
isNegative=
{
stats
.
stats
.
one_day_floor_change
<
0
}
>
{
floorChangeStr
}
%
{
arrow
}
{
arrow
}
{
floorChangeStr
}
%
</
PercentChange
>
</
PercentChange
>
</
StatsItem
>
</
StatsItem
>
)
:
null
}
)
:
null
}
{
stats
.
stats
?.
total_volume
?
(
<
StatsItem
label=
"Total Volume"
shouldHide=
{
false
}
>
{
totalVolumeStr
}
ETH
</
StatsItem
>
)
:
null
}
{
totalSupplyStr
?
(
{
totalSupplyStr
?
(
<
StatsItem
label=
"Items"
shouldHide=
{
isMobile
??
false
}
>
<
StatsItem
label=
"Items"
shouldHide=
{
isMobile
??
false
}
>
{
totalSupplyStr
}
{
totalSupplyStr
}
...
@@ -316,11 +326,6 @@ const StatsRow = ({ stats, isMobile, ...props }: { stats: GenieCollection; isMob
...
@@ -316,11 +326,6 @@ const StatsRow = ({ stats, isMobile, ...props }: { stats: GenieCollection; isMob
{
uniqueOwnersPercentage
}
%
{
uniqueOwnersPercentage
}
%
</
StatsItem
>
</
StatsItem
>
)
:
null
}
)
:
null
}
{
stats
.
stats
?.
total_volume
?
(
<
StatsItem
label=
"Total Volume"
shouldHide=
{
false
}
>
{
totalVolumeStr
}
ETH
</
StatsItem
>
)
:
null
}
{
stats
.
stats
?.
total_listings
&&
listedPercentageStr
>
0
?
(
{
stats
.
stats
?.
total_listings
&&
listedPercentageStr
>
0
?
(
<
StatsItem
label=
"Listed"
shouldHide=
{
isMobile
??
false
}
>
<
StatsItem
label=
"Listed"
shouldHide=
{
isMobile
??
false
}
>
{
listedPercentageStr
}
%
{
listedPercentageStr
}
%
...
...
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