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
ac9a6f03
Unverified
Commit
ac9a6f03
authored
Sep 14, 2023
by
eddie
Committed by
GitHub
Sep 14, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: v2 pool ui (#7316)
* fix: v2 pool ui * fix: use one wrapper
parent
172160de
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
41 deletions
+48
-41
index.tsx
src/pages/AddLiquidityV2/index.tsx
+48
-41
No files found.
src/pages/AddLiquidityV2/index.tsx
View file @
ac9a6f03
...
...
@@ -14,7 +14,7 @@ import { useCallback, useState } from 'react'
import
{
Plus
}
from
'
react-feather
'
import
{
useLocation
,
useNavigate
,
useParams
}
from
'
react-router-dom
'
import
{
Text
}
from
'
rebass
'
import
{
useTheme
}
from
'
styled-components
'
import
styled
,
{
useTheme
}
from
'
styled-components
'
import
{
ButtonError
,
ButtonLight
,
ButtonPrimary
}
from
'
../../components/Button
'
import
{
BlueCard
,
LightCard
}
from
'
../../components/Card
'
...
...
@@ -23,7 +23,7 @@ import CurrencyInputPanel from '../../components/CurrencyInputPanel'
import
DoubleCurrencyLogo
from
'
../../components/DoubleLogo
'
import
{
AddRemoveTabs
}
from
'
../../components/NavigationTabs
'
import
{
MinimalPositionCard
}
from
'
../../components/PositionCard
'
import
Row
,
{
RowBetween
,
RowFlat
}
from
'
../../components/Row
'
import
Row
,
{
AutoRow
,
RowBetween
,
RowFlat
}
from
'
../../components/Row
'
import
TransactionConfirmationModal
,
{
ConfirmationModalContent
}
from
'
../../components/TransactionConfirmationModal
'
import
{
ZERO_PERCENT
}
from
'
../../constants/misc
'
import
{
WRAPPED_NATIVE_CURRENCY
}
from
'
../../constants/tokens
'
...
...
@@ -50,6 +50,11 @@ import { PoolPriceBar } from './PoolPriceBar'
const
DEFAULT_ADD_V2_SLIPPAGE_TOLERANCE
=
new
Percent
(
50
,
10
_000
)
const
AddLiquidityHeaderContainer
=
styled
(
AutoColumn
)
`
gap: 20px;
margin-bottom: 16px;
`
export
default
function
AddLiquidity
()
{
const
{
currencyIdA
,
currencyIdB
}
=
useParams
<
{
currencyIdA
?:
string
;
currencyIdB
?:
string
}
>
()
const
navigate
=
useNavigate
()
...
...
@@ -220,45 +225,47 @@ export default function AddLiquidity() {
}
const
modalHeader
=
()
=>
{
return
noLiquidity
?
(
<
AutoColumn
gap=
"20px"
>
<
LightCard
mt=
"20px"
$borderRadius=
"20px"
>
<
RowFlat
>
<
Text
fontSize=
"48px"
fontWeight=
{
535
}
lineHeight=
"42px"
marginRight=
{
10
}
>
{
currencies
[
Field
.
CURRENCY_A
]?.
symbol
+
'
/
'
+
currencies
[
Field
.
CURRENCY_B
]?.
symbol
}
</
Text
>
<
DoubleCurrencyLogo
currency0=
{
currencies
[
Field
.
CURRENCY_A
]
}
currency1=
{
currencies
[
Field
.
CURRENCY_B
]
}
size=
{
30
}
/>
</
RowFlat
>
</
LightCard
>
</
AutoColumn
>
)
:
(
<
AutoColumn
gap=
"20px"
>
<
RowFlat
style=
{
{
marginTop
:
'
20px
'
}
}
>
<
Text
fontSize=
"48px"
fontWeight=
{
535
}
lineHeight=
"42px"
marginRight=
{
10
}
>
{
liquidityMinted
?.
toSignificant
(
6
)
}
</
Text
>
<
DoubleCurrencyLogo
currency0=
{
currencies
[
Field
.
CURRENCY_A
]
}
currency1=
{
currencies
[
Field
.
CURRENCY_B
]
}
size=
{
30
}
/>
</
RowFlat
>
<
Row
>
<
Text
fontSize=
"24px"
>
{
currencies
[
Field
.
CURRENCY_A
]?.
symbol
+
'
/
'
+
currencies
[
Field
.
CURRENCY_B
]?.
symbol
+
'
Pool Tokens
'
}
</
Text
>
</
Row
>
<
ThemedText
.
DeprecatedItalic
fontSize=
{
12
}
textAlign=
"left"
padding=
"8px 0 0 0 "
>
<
Trans
>
Output is estimated. If the price changes by more than
{
allowedSlippage
.
toSignificant
(
4
)
}
% your transaction
will revert.
</
Trans
>
</
ThemedText
.
DeprecatedItalic
>
</
AutoColumn
>
return
(
<
AddLiquidityHeaderContainer
>
{
noLiquidity
?
(
<
LightCard
mt=
"20px"
$borderRadius=
"20px"
>
<
AutoRow
justify=
"space-between"
>
<
Text
fontSize=
"24px"
fontWeight=
{
535
}
lineHeight=
"42px"
marginRight=
{
10
}
>
{
currencies
[
Field
.
CURRENCY_A
]?.
symbol
+
'
/
'
+
currencies
[
Field
.
CURRENCY_B
]?.
symbol
}
</
Text
>
<
DoubleCurrencyLogo
currency0=
{
currencies
[
Field
.
CURRENCY_A
]
}
currency1=
{
currencies
[
Field
.
CURRENCY_B
]
}
size=
{
30
}
/>
</
AutoRow
>
</
LightCard
>
)
:
(
<>
<
RowFlat
style=
{
{
marginTop
:
'
20px
'
}
}
>
<
Text
fontSize=
"48px"
fontWeight=
{
535
}
lineHeight=
"42px"
marginRight=
{
10
}
>
{
liquidityMinted
?.
toSignificant
(
6
)
}
</
Text
>
<
DoubleCurrencyLogo
currency0=
{
currencies
[
Field
.
CURRENCY_A
]
}
currency1=
{
currencies
[
Field
.
CURRENCY_B
]
}
size=
{
30
}
/>
</
RowFlat
>
<
Row
>
<
Text
fontSize=
"24px"
>
{
currencies
[
Field
.
CURRENCY_A
]?.
symbol
+
'
/
'
+
currencies
[
Field
.
CURRENCY_B
]?.
symbol
+
'
Pool Tokens
'
}
</
Text
>
</
Row
>
<
ThemedText
.
DeprecatedItalic
fontSize=
{
12
}
textAlign=
"left"
padding=
"8px 0 0 0 "
>
<
Trans
>
Output is estimated. If the price changes by more than
{
allowedSlippage
.
toSignificant
(
4
)
}
% your
transaction will revert.
</
Trans
>
</
ThemedText
.
DeprecatedItalic
>
</>
)
}
</
AddLiquidityHeaderContainer
>
)
}
...
...
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