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
59e7a286
Unverified
Commit
59e7a286
authored
Sep 22, 2023
by
eddie
Committed by
GitHub
Sep 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: ui fixes on the add liquidity flow (#7352)
parent
0a31428d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
26 deletions
+22
-26
index.tsx
src/components/CurrencyInputPanel/index.tsx
+6
-2
index.tsx
src/components/NavigationTabs/index.tsx
+3
-1
PrefetchBalancesWrapper.tsx
...nents/PrefetchBalancesWrapper/PrefetchBalancesWrapper.tsx
+7
-2
index.tsx
src/pages/AddLiquidity/index.tsx
+6
-16
styled.tsx
src/pages/AddLiquidity/styled.tsx
+0
-5
No files found.
src/components/CurrencyInputPanel/index.tsx
View file @
59e7a286
...
@@ -161,6 +161,10 @@ const StyledNumericalInput = styled(NumericalInput)<{ $loading: boolean }>`
...
@@ -161,6 +161,10 @@ const StyledNumericalInput = styled(NumericalInput)<{ $loading: boolean }>`
text-align: left;
text-align: left;
`
`
const
StyledPrefetchBalancesWrapper
=
styled
(
PrefetchBalancesWrapper
)
<
{
$fullWidth
:
boolean
}
>
`
width:
${({
$fullWidth
})
=>
(
$fullWidth
?
'
100%
'
:
'
auto
'
)}
;
`
interface
CurrencyInputPanelProps
{
interface
CurrencyInputPanelProps
{
value
:
string
value
:
string
onUserInput
:
(
value
:
string
)
=>
void
onUserInput
:
(
value
:
string
)
=>
void
...
@@ -231,7 +235,7 @@ export default function CurrencyInputPanel({
...
@@ -231,7 +235,7 @@ export default function CurrencyInputPanel({
/>
/>
)
}
)
}
<
PrefetchBalancesWrapper
shouldFetchOnAccountUpdate=
{
modalOpen
}
>
<
StyledPrefetchBalancesWrapper
shouldFetchOnAccountUpdate=
{
modalOpen
}
$fullWidth=
{
hideInput
}
>
<
CurrencySelect
<
CurrencySelect
disabled=
{
!
chainAllowed
}
disabled=
{
!
chainAllowed
}
visible=
{
currency
!==
undefined
}
visible=
{
currency
!==
undefined
}
...
@@ -274,7 +278,7 @@ export default function CurrencyInputPanel({
...
@@ -274,7 +278,7 @@ export default function CurrencyInputPanel({
{
onCurrencySelect
&&
<
StyledDropDown
selected=
{
!!
currency
}
/>
}
{
onCurrencySelect
&&
<
StyledDropDown
selected=
{
!!
currency
}
/>
}
</
Aligner
>
</
Aligner
>
</
CurrencySelect
>
</
CurrencySelect
>
</
PrefetchBalancesWrapper
>
</
Styled
PrefetchBalancesWrapper
>
</
InputRow
>
</
InputRow
>
{
Boolean
(
!
hideInput
&&
!
hideBalance
&&
currency
)
&&
(
{
Boolean
(
!
hideInput
&&
!
hideBalance
&&
currency
)
&&
(
<
FiatRow
>
<
FiatRow
>
...
...
src/components/NavigationTabs/index.tsx
View file @
59e7a286
...
@@ -21,6 +21,8 @@ const Tabs = styled.div`
...
@@ -21,6 +21,8 @@ const Tabs = styled.div`
const
StyledLink
=
styled
(
Link
)
<
{
flex
?:
string
}
>
`
const
StyledLink
=
styled
(
Link
)
<
{
flex
?:
string
}
>
`
flex:
${({
flex
})
=>
flex
??
'
none
'
};
flex:
${({
flex
})
=>
flex
??
'
none
'
};
display
:
flex
;
align
-
items
:
center
;
$
{({
theme
})
=>
theme
.
deprecated_mediaWidth
.
deprecated_upToMedium
`
$
{({
theme
})
=>
theme
.
deprecated_mediaWidth
.
deprecated_upToMedium
`
flex: none;
flex: none;
...
@@ -82,7 +84,7 @@ export function AddRemoveTabs({
...
@@ -82,7 +84,7 @@ export function AddRemoveTabs({
return
(
return
(
<
Tabs
>
<
Tabs
>
<
RowBetween
style=
{
{
padding
:
'
1rem 1rem 0 1rem
'
}
}
>
<
RowBetween
style=
{
{
padding
:
'
1rem 1rem 0 1rem
'
}
}
align=
"center"
>
<
StyledLink
<
StyledLink
to=
{
poolLink
}
to=
{
poolLink
}
onClick=
{
()
=>
{
onClick=
{
()
=>
{
...
...
src/components/PrefetchBalancesWrapper/PrefetchBalancesWrapper.tsx
View file @
59e7a286
...
@@ -30,7 +30,8 @@ const hasUnfetchedBalancesAtom = atom<boolean>(true)
...
@@ -30,7 +30,8 @@ const hasUnfetchedBalancesAtom = atom<boolean>(true)
export
default
function
PrefetchBalancesWrapper
({
export
default
function
PrefetchBalancesWrapper
({
children
,
children
,
shouldFetchOnAccountUpdate
,
shouldFetchOnAccountUpdate
,
}:
PropsWithChildren
<
{
shouldFetchOnAccountUpdate
:
boolean
}
>
)
{
className
,
}:
PropsWithChildren
<
{
shouldFetchOnAccountUpdate
:
boolean
;
className
?:
string
}
>
)
{
const
{
account
}
=
useWeb3React
()
const
{
account
}
=
useWeb3React
()
const
[
prefetchPortfolioBalances
]
=
usePortfolioBalancesLazyQuery
()
const
[
prefetchPortfolioBalances
]
=
usePortfolioBalancesLazyQuery
()
...
@@ -64,5 +65,9 @@ export default function PrefetchBalancesWrapper({
...
@@ -64,5 +65,9 @@ export default function PrefetchBalancesWrapper({
if
(
hasUnfetchedBalances
)
fetchBalances
()
if
(
hasUnfetchedBalances
)
fetchBalances
()
},
[
fetchBalances
,
hasUnfetchedBalances
])
},
[
fetchBalances
,
hasUnfetchedBalances
])
return
<
div
onMouseEnter=
{
onHover
}
>
{
children
}
</
div
>
return
(
<
div
onMouseEnter=
{
onHover
}
className=
{
className
}
>
{
children
}
</
div
>
)
}
}
src/pages/AddLiquidity/index.tsx
View file @
59e7a286
...
@@ -65,15 +65,7 @@ import { currencyId } from '../../utils/currencyId'
...
@@ -65,15 +65,7 @@ import { currencyId } from '../../utils/currencyId'
import
{
maxAmountSpend
}
from
'
../../utils/maxAmountSpend
'
import
{
maxAmountSpend
}
from
'
../../utils/maxAmountSpend
'
import
{
Dots
}
from
'
../Pool/styled
'
import
{
Dots
}
from
'
../Pool/styled
'
import
{
Review
}
from
'
./Review
'
import
{
Review
}
from
'
./Review
'
import
{
import
{
DynamicSection
,
MediumOnly
,
ResponsiveTwoColumns
,
ScrollablePage
,
StyledInput
,
Wrapper
}
from
'
./styled
'
CurrencyDropdown
,
DynamicSection
,
MediumOnly
,
ResponsiveTwoColumns
,
ScrollablePage
,
StyledInput
,
Wrapper
,
}
from
'
./styled
'
const
DEFAULT_ADD_IN_RANGE_SLIPPAGE_TOLERANCE
=
new
Percent
(
50
,
10
_000
)
const
DEFAULT_ADD_IN_RANGE_SLIPPAGE_TOLERANCE
=
new
Percent
(
50
,
10
_000
)
...
@@ -631,11 +623,11 @@ function AddLiquidity() {
...
@@ -631,11 +623,11 @@ function AddLiquidity() {
<Trans>Select Pair</Trans>
<Trans>Select Pair</Trans>
</ThemedText.DeprecatedLabel>
</ThemedText.DeprecatedLabel>
</RowBetween>
</RowBetween>
<RowBetween>
<RowBetween
gap="md"
>
<Currency
Dropdown
<Currency
InputPanel
value={formattedAmounts[Field.CURRENCY_A]}
value={formattedAmounts[Field.CURRENCY_A]}
onUserInput={onFieldAInput}
onUserInput={onFieldAInput}
hideInput
={true}
hideInput
onMax={() => {
onMax={() => {
onFieldAInput(maxAmounts[Field.CURRENCY_A]?.toExact() ?? '')
onFieldAInput(maxAmounts[Field.CURRENCY_A]?.toExact() ?? '')
}}
}}
...
@@ -646,11 +638,9 @@ function AddLiquidity() {
...
@@ -646,11 +638,9 @@ function AddLiquidity() {
showCommonBases
showCommonBases
/>
/>
<div style={{ width: '12px' }} />
<CurrencyInputPanel
<CurrencyDropdown
value={formattedAmounts[Field.CURRENCY_B]}
value={formattedAmounts[Field.CURRENCY_B]}
hideInput
={true}
hideInput
onUserInput={onFieldBInput}
onUserInput={onFieldBInput}
onCurrencySelect={handleCurrencyBSelect}
onCurrencySelect={handleCurrencyBSelect}
onMax={() => {
onMax={() => {
...
...
src/pages/AddLiquidity/styled.tsx
View file @
59e7a286
import
{
AutoColumn
}
from
'
components/Column
'
import
{
AutoColumn
}
from
'
components/Column
'
import
CurrencyInputPanel
from
'
components/CurrencyInputPanel
'
import
{
Input
}
from
'
components/NumericalInput
'
import
{
Input
}
from
'
components/NumericalInput
'
import
styled
from
'
styled-components
'
import
styled
from
'
styled-components
'
...
@@ -32,10 +31,6 @@ export const DynamicSection = styled(AutoColumn)<{ disabled?: boolean }>`
...
@@ -32,10 +31,6 @@ export const DynamicSection = styled(AutoColumn)<{ disabled?: boolean }>`
pointer-events:
${({
disabled
})
=>
(
disabled
?
'
none
'
:
'
initial
'
)}
;
pointer-events:
${({
disabled
})
=>
(
disabled
?
'
none
'
:
'
initial
'
)}
;
`
`
export
const
CurrencyDropdown
=
styled
(
CurrencyInputPanel
)
`
width: 48.5%;
`
export
const
StyledInput
=
styled
(
Input
)
`
export
const
StyledInput
=
styled
(
Input
)
`
background-color:
${({
theme
})
=>
theme
.
surface1
}
;
background-color:
${({
theme
})
=>
theme
.
surface1
}
;
text-align: left;
text-align: left;
...
...
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