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
27094c87
Unverified
Commit
27094c87
authored
May 12, 2021
by
Moody Salem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean up price impact formatting
parent
bede9171
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
12 deletions
+3
-12
FormattedPriceImpact.tsx
src/components/swap/FormattedPriceImpact.tsx
+2
-11
styleds.tsx
src/components/swap/styleds.tsx
+1
-1
No files found.
src/components/swap/FormattedPriceImpact.tsx
View file @
27094c87
import
{
Percent
}
from
'
@uniswap/sdk-core
'
import
React
from
'
react
'
import
{
ONE_BIPS
}
from
'
../../constants
'
import
{
warningSeverity
}
from
'
../../utils/prices
'
import
{
ErrorText
,
ErrorPill
}
from
'
./styleds
'
...
...
@@ -10,11 +9,7 @@ import { ErrorText, ErrorPill } from './styleds'
export
default
function
FormattedPriceImpact
({
priceImpact
}:
{
priceImpact
?:
Percent
})
{
return
(
<
ErrorText
fontWeight=
{
500
}
fontSize=
{
12
}
severity=
{
warningSeverity
(
priceImpact
)
}
>
{
priceImpact
?
priceImpact
.
lessThan
(
ONE_BIPS
)
?
`-${priceImpact.toFixed(2)}%`
:
`${priceImpact.toFixed(2)}%`
:
'
-
'
}
{
priceImpact
?
`-${priceImpact.toFixed(2)}%`
:
'
-
'
}
</
ErrorText
>
)
}
...
...
@@ -22,11 +17,7 @@ export default function FormattedPriceImpact({ priceImpact }: { priceImpact?: Pe
export
function
SmallFormattedPriceImpact
({
priceImpact
}:
{
priceImpact
?:
Percent
})
{
return
(
<
ErrorPill
fontWeight=
{
500
}
fontSize=
{
12
}
severity=
{
warningSeverity
(
priceImpact
)
}
>
{
priceImpact
?
priceImpact
.
lessThan
(
ONE_BIPS
)
?
`(-${priceImpact.toFixed(2)}%)`
:
`(-${priceImpact.toFixed(2)}%)`
:
'
-
'
}
{
priceImpact
?
`(-${priceImpact.toFixed(2)}%)`
:
'
-
'
}
</
ErrorPill
>
)
}
src/components/swap/styleds.tsx
View file @
27094c87
...
...
@@ -55,7 +55,7 @@ export const ErrorText = styled(Text)<{ severity?: 0 | 1 | 2 | 3 | 4 }>`
?
theme
.
yellow2
:
severity
===
1
?
theme
.
text1
:
theme
.
green1
}
;
:
theme
.
text2
}
;
`
export
const
ErrorPill
=
styled
(
Text
)
<
{
severity
?:
0
|
1
|
2
|
3
|
4
}
>
`
...
...
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