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
800b5e0b
Unverified
Commit
800b5e0b
authored
Feb 02, 2022
by
Ian Lapham
Committed by
GitHub
Feb 02, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: fix pricing displays (#3214)
* fix pricing displays * update rate logic, code clean
parent
fc637071
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
Summary.tsx
src/lib/components/Swap/Summary/Summary.tsx
+1
-1
Toolbar.tsx
src/lib/components/Swap/Toolbar.tsx
+2
-1
No files found.
src/lib/components/Swap/Summary/Summary.tsx
View file @
800b5e0b
...
@@ -23,7 +23,7 @@ interface TokenValueProps {
...
@@ -23,7 +23,7 @@ interface TokenValueProps {
function
TokenValue
({
input
,
usdc
,
change
}:
TokenValueProps
)
{
function
TokenValue
({
input
,
usdc
,
change
}:
TokenValueProps
)
{
const
percent
=
useMemo
(()
=>
{
const
percent
=
useMemo
(()
=>
{
if
(
change
)
{
if
(
change
)
{
const
percent
=
(
change
*
100
)
.
toPrecision
(
3
)
const
percent
=
change
.
toPrecision
(
3
)
return
change
>
0
?
`(+
${
percent
}
%)`
:
`(
${
percent
}
%)`
return
change
>
0
?
`(+
${
percent
}
%)`
:
`(
${
percent
}
%)`
}
}
return
undefined
return
undefined
...
...
src/lib/components/Swap/Toolbar.tsx
View file @
800b5e0b
...
@@ -46,8 +46,9 @@ function LoadedState({ inputAmount, outputAmount, trade }: LoadedStateProps) {
...
@@ -46,8 +46,9 @@ function LoadedState({ inputAmount, outputAmount, trade }: LoadedStateProps) {
const
ratio
=
useMemo
(()
=>
{
const
ratio
=
useMemo
(()
=>
{
const
[
a
,
b
]
=
flip
?
[
outputAmount
,
inputAmount
]
:
[
inputAmount
,
outputAmount
]
const
[
a
,
b
]
=
flip
?
[
outputAmount
,
inputAmount
]
:
[
inputAmount
,
outputAmount
]
const
priceString
=
(
!
flip
?
executionPrice
:
executionPrice
?.
invert
())?.
toSignificant
(
6
)
const
ratio
=
`1
${
a
.
currency
.
symbol
}
=
${
executionPrice
?.
toSignificant
(
6
)
}
$
{
b
.
currency
.
symbol
}
`
const
ratio
=
`1
${
a
.
currency
.
symbol
}
=
${
priceString
}
}
${
b
.
currency
.
symbol
}
`
const
usdc
=
!
flip
const
usdc
=
!
flip
?
fiatValueInput
?
fiatValueInput
?
` ($
${
fiatValueInput
.
toSignificant
(
2
)}
)`
?
` ($
${
fiatValueInput
.
toSignificant
(
2
)}
)`
...
...
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