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
0d410893
Unverified
Commit
0d410893
authored
May 12, 2020
by
Ian Lapham
Committed by
GitHub
May 12, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ui changes (#747)
* copy changes * remove unused input on toggle * comparison fix
parent
6da8e2c8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
22 deletions
+32
-22
index.tsx
src/components/AddressInputPanel/index.tsx
+9
-10
index.tsx
src/components/CreatePool/index.tsx
+1
-1
index.tsx
src/components/CurrencyInputPanel/index.tsx
+0
-1
index.tsx
src/components/ExchangePage/index.tsx
+22
-10
No files found.
src/components/AddressInputPanel/index.tsx
View file @
0d410893
...
@@ -190,16 +190,15 @@ export default function AddressInputPanel({
...
@@ -190,16 +190,15 @@ export default function AddressInputPanel({
<
TYPE
.
black
color=
{
theme
.
text2
}
fontWeight=
{
500
}
fontSize=
{
14
}
>
<
TYPE
.
black
color=
{
theme
.
text2
}
fontWeight=
{
500
}
fontSize=
{
14
}
>
Recipient
Recipient
</
TYPE
.
black
>
</
TYPE
.
black
>
{
data
.
name
||
{
data
.
name
?
(
(
data
.
address
&&
(
<
Link
href=
{
getEtherscanLink
(
chainId
,
data
.
name
,
'
address
'
)
}
style=
{
{
fontSize
:
'
14px
'
}
}
>
<
Link
(View on Etherscan)
href=
{
getEtherscanLink
(
chainId
,
data
.
name
||
data
.
address
,
'
address
'
)
}
</
Link
>
style=
{
{
fontSize
:
'
14px
'
}
}
)
:
(
>
<
Link
href=
{
getEtherscanLink
(
chainId
,
data
.
address
,
'
address
'
)
}
style=
{
{
fontSize
:
'
14px
'
}
}
>
(View on Etherscan)
(View on Etherscan)
</
Link
>
</
Link
>
))
}
)
}
</
RowBetween
>
</
RowBetween
>
<
Input
<
Input
type=
"text"
type=
"text"
...
...
src/components/CreatePool/index.tsx
View file @
0d410893
...
@@ -130,7 +130,7 @@ function CreatePool({ history }) {
...
@@ -130,7 +130,7 @@ function CreatePool({ history }) {
setShowSearch
(
false
)
setShowSearch
(
false
)
}
}
}
}
hiddenToken=
{
activeField
===
Fields
.
TOKEN0
?
token1Address
:
token0Address
}
hiddenToken=
{
activeField
===
Fields
.
TOKEN0
?
token1Address
:
token0Address
}
showCommonBases=
{
true
}
showCommonBases=
{
activeField
===
Fields
.
TOKEN0
}
/>
/>
</
AutoColumn
>
</
AutoColumn
>
)
)
...
...
src/components/CurrencyInputPanel/index.tsx
View file @
0d410893
...
@@ -175,7 +175,6 @@ export default function CurrencyInputPanel({
...
@@ -175,7 +175,6 @@ export default function CurrencyInputPanel({
<
TYPE
.
body
color=
{
theme
.
text2
}
fontWeight=
{
500
}
fontSize=
{
14
}
>
<
TYPE
.
body
color=
{
theme
.
text2
}
fontWeight=
{
500
}
fontSize=
{
14
}
>
{
label
}
{
label
}
</
TYPE
.
body
>
</
TYPE
.
body
>
{
account
&&
(
{
account
&&
(
<
Hover
>
<
Hover
>
<
TYPE
.
body
<
TYPE
.
body
...
...
src/components/ExchangePage/index.tsx
View file @
0d410893
...
@@ -22,6 +22,7 @@ import { useAllTokens, useToken } from '../../contexts/Tokens'
...
@@ -22,6 +22,7 @@ import { useAllTokens, useToken } from '../../contexts/Tokens'
import
{
usePendingApproval
,
useTransactionAdder
}
from
'
../../contexts/Transactions
'
import
{
usePendingApproval
,
useTransactionAdder
}
from
'
../../contexts/Transactions
'
import
{
useTokenContract
,
useWeb3React
}
from
'
../../hooks
'
import
{
useTokenContract
,
useWeb3React
}
from
'
../../hooks
'
import
{
useTradeExactIn
,
useTradeExactOut
}
from
'
../../hooks/Trades
'
import
{
useTradeExactIn
,
useTradeExactOut
}
from
'
../../hooks/Trades
'
import
{
useWalletModalToggle
}
from
'
../../state/application/hooks
'
import
{
Hover
,
TYPE
}
from
'
../../theme
'
import
{
Hover
,
TYPE
}
from
'
../../theme
'
import
{
Link
}
from
'
../../theme/components
'
import
{
Link
}
from
'
../../theme/components
'
import
{
import
{
...
@@ -88,6 +89,9 @@ function ExchangePage({ sendingInput = false, history, params }: ExchangePagePro
...
@@ -88,6 +89,9 @@ function ExchangePage({ sendingInput = false, history, params }: ExchangePagePro
// adding notifications on txns
// adding notifications on txns
const
addTransaction
=
useTransactionAdder
()
const
addTransaction
=
useTransactionAdder
()
// toggle wallet when disconnected
const
toggleWalletModal
=
useWalletModalToggle
()
// sending state
// sending state
const
[
sending
]
=
useState
<
boolean
>
(
sendingInput
)
const
[
sending
]
=
useState
<
boolean
>
(
sendingInput
)
const
[
sendingWithSwap
,
setSendingWithSwap
]
=
useState
<
boolean
>
(
false
)
const
[
sendingWithSwap
,
setSendingWithSwap
]
=
useState
<
boolean
>
(
false
)
...
@@ -835,7 +839,7 @@ function ExchangePage({ sendingInput = false, history, params }: ExchangePagePro
...
@@ -835,7 +839,7 @@ function ExchangePage({ sendingInput = false, history, params }: ExchangePagePro
<
RowBetween
>
<
RowBetween
>
<
RowFixed
>
<
RowFixed
>
<
TYPE
.
black
color=
{
theme
.
text2
}
fontSize=
{
14
}
fontWeight=
{
400
}
>
<
TYPE
.
black
color=
{
theme
.
text2
}
fontSize=
{
14
}
fontWeight=
{
400
}
>
Price
i
mpact
Price
I
mpact
</
TYPE
.
black
>
</
TYPE
.
black
>
<
QuestionHelper
text=
"The difference between the market price and your price due to trade size."
/>
<
QuestionHelper
text=
"The difference between the market price and your price due to trade size."
/>
</
RowFixed
>
</
RowFixed
>
...
@@ -1021,7 +1025,7 @@ function ExchangePage({ sendingInput = false, history, params }: ExchangePagePro
...
@@ -1021,7 +1025,7 @@ function ExchangePage({ sendingInput = false, history, params }: ExchangePagePro
<>
<>
<CurrencyInputPanel
<CurrencyInputPanel
field={Field.INPUT}
field={Field.INPUT}
label={'From'}
label={
independentField === Field.OUTPUT && parsedAmounts[Field.INPUT] ? 'From (estimated)' :
'From'}
value={formattedAmounts[Field.INPUT]}
value={formattedAmounts[Field.INPUT]}
atMax={atMaxAmountInput}
atMax={atMaxAmountInput}
token={tokens[Field.INPUT]}
token={tokens[Field.INPUT]}
...
@@ -1071,7 +1075,7 @@ function ExchangePage({ sendingInput = false, history, params }: ExchangePagePro
...
@@ -1071,7 +1075,7 @@ function ExchangePage({ sendingInput = false, history, params }: ExchangePagePro
onMax={() => {
onMax={() => {
maxAmountOutput && onMaxOutput(maxAmountOutput.toExact())
maxAmountOutput && onMaxOutput(maxAmountOutput.toExact())
}}
}}
label={'To'}
label={
independentField === Field.INPUT && parsedAmounts[Field.OUTPUT] ? 'To (estimated)' :
'To'}
atMax={atMaxAmountOutput}
atMax={atMaxAmountOutput}
token={tokens[Field.OUTPUT]}
token={tokens[Field.OUTPUT]}
onTokenSelection={address => onTokenSelection(Field.OUTPUT, address)}
onTokenSelection={address => onTokenSelection(Field.OUTPUT, address)}
...
@@ -1160,16 +1164,24 @@ function ExchangePage({ sendingInput = false, history, params }: ExchangePagePro
...
@@ -1160,16 +1164,24 @@ function ExchangePage({ sendingInput = false, history, params }: ExchangePagePro
)}
)}
</AutoColumn>
</AutoColumn>
<BottomGrouping>
<BottomGrouping>
{noRoute && userHasSpecifiedInputOutput ? (
{!account ? (
<ButtonLight
onClick={() => {
toggleWalletModal()
}}
>
Connect Wallet
</ButtonLight>
) : noRoute && userHasSpecifiedInputOutput ? (
<GreyCard style={{ textAlign: 'center' }}>
<GreyCard style={{ textAlign: 'center' }}>
<TYPE.main>No path found.</TYPE.main>
<TYPE.main mb="4px">Insufficient liquidity for this trade.</TYPE.main>
<Link
<Link
onClick={() => {
onClick={() => {
history.push('/add/' + tokens[Field.INPUT]?.address + '-' + tokens[Field.OUTPUT]?.address)
history.push('/add/' + tokens[Field.INPUT]?.address + '-' + tokens[Field.OUTPUT]?.address)
}}
}}
>
>
Create one now
{' '}
Add liquidity now.
</Link>
</Link>
</GreyCard>
</GreyCard>
) : !userHasApprovedRouter && !inputError ? (
) : !userHasApprovedRouter && !inputError ? (
...
@@ -1298,7 +1310,7 @@ function ExchangePage({ sendingInput = false, history, params }: ExchangePagePro
...
@@ -1298,7 +1310,7 @@ function ExchangePage({ sendingInput = false, history, params }: ExchangePagePro
<SectionBreak />
<SectionBreak />
<RowFixed padding={'0 20px'}>
<RowFixed padding={'0 20px'}>
<TYPE.black fontWeight={400} fontSize={14} color={theme.text2}>
<TYPE.black fontWeight={400} fontSize={14} color={theme.text2}>
Set
front running resist
ance
Set
slippage toler
ance
</TYPE.black>
</TYPE.black>
<QuestionHelper text="Your transaction will revert if the price changes more than this amount after you submit your trade." />
<QuestionHelper text="Your transaction will revert if the price changes more than this amount after you submit your trade." />
</RowFixed>
</RowFixed>
...
@@ -1326,8 +1338,8 @@ function ExchangePage({ sendingInput = false, history, params }: ExchangePagePro
...
@@ -1326,8 +1338,8 @@ function ExchangePage({ sendingInput = false, history, params }: ExchangePagePro
</RowFixed>
</RowFixed>
</RowBetween>
</RowBetween>
<Text lineHeight="145.23%;" fontSize={16} fontWeight={400} color={theme.text1}>
<Text lineHeight="145.23%;" fontSize={16} fontWeight={400} color={theme.text1}>
This trade will move the price by
{slippageFromTrade?.toFixed(2)}%. This pool probably doesn’t
This trade will move the price by
~{priceSlippage.toFixed(2)}%. This pool probably doesn’t have
have
enough liquidity to support this trade.
enough liquidity to support this trade.
</Text>
</Text>
</AutoColumn>
</AutoColumn>
</YellowCard>
</YellowCard>
...
...
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