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
e42a26c3
Commit
e42a26c3
authored
Mar 09, 2021
by
Callil Capuozzo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tweak position list styles
parent
eeb258eb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
21 deletions
+49
-21
index.tsx
src/components/Badge/index.tsx
+6
-5
index.tsx
src/components/PositionList/index.tsx
+38
-14
index.tsx
src/pages/Pool/index.tsx
+5
-2
No files found.
src/components/Badge/index.tsx
View file @
e42a26c3
...
@@ -26,14 +26,14 @@ function pickBackgroundColor(variant: BadgeVariant | undefined, theme: DefaultTh
...
@@ -26,14 +26,14 @@ function pickBackgroundColor(variant: BadgeVariant | undefined, theme: DefaultTh
case
BadgeVariant
.
WARNING_OUTLINE
:
case
BadgeVariant
.
WARNING_OUTLINE
:
return
'
transparent
'
return
'
transparent
'
default
:
default
:
return
theme
.
bg
3
return
theme
.
bg
2
}
}
}
}
function
pickBorder
(
variant
:
BadgeVariant
|
undefined
,
theme
:
DefaultTheme
):
string
{
function
pickBorder
(
variant
:
BadgeVariant
|
undefined
,
theme
:
DefaultTheme
):
string
{
switch
(
variant
)
{
switch
(
variant
)
{
case
BadgeVariant
.
WARNING_OUTLINE
:
case
BadgeVariant
.
WARNING_OUTLINE
:
return
`
2
px solid
${
theme
.
warning
}
`
return
`
1
px solid
${
theme
.
warning
}
`
default
:
default
:
return
'
unset
'
return
'
unset
'
}
}
...
@@ -50,7 +50,7 @@ function pickFontColor(variant: BadgeVariant | undefined, theme: DefaultTheme):
...
@@ -50,7 +50,7 @@ function pickFontColor(variant: BadgeVariant | undefined, theme: DefaultTheme):
case
BadgeVariant
.
WARNING_OUTLINE
:
case
BadgeVariant
.
WARNING_OUTLINE
:
return
theme
.
warning
return
theme
.
warning
default
:
default
:
return
readableColor
(
theme
.
bg
3
)
return
readableColor
(
theme
.
bg
2
)
}
}
}
}
...
@@ -58,11 +58,12 @@ const Badge = styled.div<PropsWithChildren<BadgeProps>>`
...
@@ -58,11 +58,12 @@ const Badge = styled.div<PropsWithChildren<BadgeProps>>`
align-items: center;
align-items: center;
background-color:
${({
theme
,
variant
})
=>
pickBackgroundColor
(
variant
,
theme
)}
;
background-color:
${({
theme
,
variant
})
=>
pickBackgroundColor
(
variant
,
theme
)}
;
border:
${({
theme
,
variant
})
=>
pickBorder
(
variant
,
theme
)}
;
border:
${({
theme
,
variant
})
=>
pickBorder
(
variant
,
theme
)}
;
border-radius: 0.5em;
border-radius: 0.5
r
em;
color:
${({
theme
,
variant
})
=>
pickFontColor
(
variant
,
theme
)}
;
color:
${({
theme
,
variant
})
=>
pickFontColor
(
variant
,
theme
)}
;
display: inline-flex;
display: inline-flex;
padding:
2
px 6px;
padding:
4
px 6px;
justify-content: center;
justify-content: center;
font-weight: 500;
`
`
export
default
Badge
export
default
Badge
src/components/PositionList/index.tsx
View file @
e42a26c3
...
@@ -14,22 +14,23 @@ const ActiveDot = styled.span`
...
@@ -14,22 +14,23 @@ const ActiveDot = styled.span`
border-radius: 50%;
border-radius: 50%;
height: 8px;
height: 8px;
width: 8px;
width: 8px;
margin-right: 4px;
`
`
const
Row
=
styled
(
Link
)
`
const
Row
=
styled
(
Link
)
`
align-items: center;
align-items: center;
background-color:
${({
theme
})
=>
theme
.
bg2
}
;
border-radius: 20px;
border-radius: 12px;
display: flex;
display: flex;
flex-direction: column;
flex-direction: column;
color:
${({
theme
})
=>
theme
.
text1
}
;
color:
${({
theme
})
=>
theme
.
text1
}
;
margin:
14
px 0;
margin:
8
px 0;
padding:
12
px;
padding:
8
px;
text-decoration: none;
text-decoration: none;
font-weight: 500;
&:first-of-type {
&:first-of-type {
margin: 0 0
14
px 0;
margin: 0 0
8
px 0;
}
}
&:last-of-type {
&:last-of-type {
margin:
14
px 0 0 0;
margin:
8
px 0 0 0;
}
}
& > div:not(:first-child) {
& > div:not(:first-child) {
...
@@ -39,25 +40,35 @@ const Row = styled(Link)`
...
@@ -39,25 +40,35 @@ const Row = styled(Link)`
@media screen and (min-width:
${
MEDIA_WIDTHS
.
upToSmall
}
px) {
@media screen and (min-width:
${
MEDIA_WIDTHS
.
upToSmall
}
px) {
flex-direction: row;
flex-direction: row;
}
}
:hover {
background-color:
${({
theme
})
=>
theme
.
bg1
}
;
}
`
`
const
BadgeText
=
styled
.
div
`
const
BadgeText
=
styled
.
div
`
font-weight: 600;
font-weight: 500;
font-size: 14px;
`
`
const
BadgeWrapper
=
styled
.
div
`
const
BadgeWrapper
=
styled
.
div
`
font-size: 1
2
px;
font-size: 1
4
px;
`
`
const
DataLineItem
=
styled
.
div
`
const
DataLineItem
=
styled
.
div
`
text-align: right;
text-align: right;
font-size: 14px;
`
`
const
DoubleArrow
=
styled
.
span
`
const
DoubleArrow
=
styled
.
span
`
color:
${({
theme
})
=>
theme
.
text
2
}
;
color:
${({
theme
})
=>
theme
.
text
3
}
;
`
`
const
DesktopHeader
=
styled
.
div
`
const
DesktopHeader
=
styled
.
div
`
display: none;
display: none;
font-size: 14px;
font-weight: 500;
opacity: 0.6;
padding: 8px 8px 0 8px;
@media screen and (min-width:
${
MEDIA_WIDTHS
.
upToSmall
}
px) {
@media screen and (min-width:
${
MEDIA_WIDTHS
.
upToSmall
}
px) {
align-items: center;
align-items: center;
display: flex;
display: flex;
margin: 0 0
14
px 0;
margin: 0 0
8
px 0;
& > div:first-child {
& > div:first-child {
flex: 1 1 auto;
flex: 1 1 auto;
}
}
...
@@ -153,7 +164,15 @@ const MobileHeader = styled.div`
...
@@ -153,7 +164,15 @@ const MobileHeader = styled.div`
const
PrimaryPositionIdData
=
styled
.
div
`
const
PrimaryPositionIdData
=
styled
.
div
`
display: flex;
display: flex;
flex-direction: row;
flex-direction: row;
padding: 6px 0;
align-items: center;
padding: 6px 0 12px 0;
> * {
margin-right: 8px;
}
`
const
DataText
=
styled
.
div
`
font-weight: 500;
`
`
interface
Position
{
interface
Position
{
...
@@ -215,13 +234,18 @@ export default function PositionList({ loading, positions, showUnwrapped }: Posi
...
@@ -215,13 +234,18 @@ export default function PositionList({ loading, positions, showUnwrapped }: Posi
<
LabelData
>
<
LabelData
>
<
PrimaryPositionIdData
>
<
PrimaryPositionIdData
>
<
DoubleCurrencyLogo
currency0=
{
currency0
}
currency1=
{
currency1
}
size=
{
16
}
margin
/>
<
DoubleCurrencyLogo
currency0=
{
currency0
}
currency1=
{
currency1
}
size=
{
16
}
margin
/>
{
symbol0
}
/
{
symbol1
}
<
DataText
>
<
Badge
>
{
feeLevel
.
toSignificant
(
2
)
}
%
</
Badge
>
{
symbol0
}
/
{
symbol1
}
</
DataText
>
<
Badge
>
<
BadgeText
>
{
feeLevel
.
toSignificant
(
2
)
}
%
</
BadgeText
>
</
Badge
>
</
PrimaryPositionIdData
>
</
PrimaryPositionIdData
>
<
BadgeWrapper
>
<
BadgeWrapper
>
{
limitCrossed
?
(
{
limitCrossed
?
(
<
Badge
variant=
{
BadgeVariant
.
WARNING
}
>
<
Badge
variant=
{
BadgeVariant
.
WARNING
}
>
<
AlertTriangle
width=
{
1
2
}
height=
{
14
}
/>
<
AlertTriangle
width=
{
1
4
}
height=
{
14
}
style=
{
{
marginRight
:
'
4px
'
}
}
/>
<
BadgeText
>
{
t
(
'
Out of range
'
)
}
</
BadgeText
>
<
BadgeText
>
{
t
(
'
Out of range
'
)
}
</
BadgeText
>
</
Badge
>
</
Badge
>
...
...
src/pages/Pool/index.tsx
View file @
e42a26c3
...
@@ -41,6 +41,9 @@ const ButtonRow = styled(RowFixed)`
...
@@ -41,6 +41,9 @@ const ButtonRow = styled(RowFixed)`
`
}
;
`
}
;
`
`
const
InactivePositionsBadge
=
styled
(
Badge
)
`
const
InactivePositionsBadge
=
styled
(
Badge
)
`
border-radius: 12px;
height: 100%;
padding: 6px 8px;
display: none;
display: none;
@media screen and (min-width:
${
MEDIA_WIDTHS
.
upToMedium
}
px) {
@media screen and (min-width:
${
MEDIA_WIDTHS
.
upToMedium
}
px) {
display: flex;
display: flex;
...
@@ -83,7 +86,7 @@ const ResponsiveButtonPrimary = styled(ButtonPrimary)`
...
@@ -83,7 +86,7 @@ const ResponsiveButtonPrimary = styled(ButtonPrimary)`
`
`
const
MainContentWrapper
=
styled
.
main
`
const
MainContentWrapper
=
styled
.
main
`
background-color:
${({
theme
})
=>
theme
.
bg0
}
;
background-color:
${({
theme
})
=>
theme
.
bg0
}
;
padding:
24
px;
padding:
16
px;
border-radius: 1.3em;
border-radius: 1.3em;
display: flex;
display: flex;
flex-direction: column;
flex-direction: column;
...
@@ -191,7 +194,7 @@ export default function Pool() {
...
@@ -191,7 +194,7 @@ export default function Pool() {
<
ButtonRow
>
<
ButtonRow
>
{
numInactivePositions
>
0
&&
(
{
numInactivePositions
>
0
&&
(
<
InactivePositionsBadge
variant=
{
BadgeVariant
.
WARNING_OUTLINE
}
>
<
InactivePositionsBadge
variant=
{
BadgeVariant
.
WARNING_OUTLINE
}
>
<
Info
/>
<
Info
size=
{
20
}
/>
{
numInactivePositions
}{
'
'
}
{
numInactivePositions
}{
'
'
}
{
numInactivePositions
===
1
?
t
(
'
Inactive position
'
)
:
t
(
'
Inactive positions
'
)
}
{
numInactivePositions
===
1
?
t
(
'
Inactive position
'
)
:
t
(
'
Inactive positions
'
)
}
...
...
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