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
9c93c1a9
Unverified
Commit
9c93c1a9
authored
Apr 15, 2019
by
Noah Zinsmeister
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix lint errors
parent
093c4c0c
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
50 additions
and
61 deletions
+50
-61
README.md
README.md
+3
-0
index.js
src/components/ContextualInfo/index.js
+2
-2
index.js
src/components/CurrencyInputPanel/index.js
+1
-1
index.js
src/components/Header/index.js
+5
-5
index.js
src/components/NavigationTabs/index.js
+1
-1
index.js
src/components/OversizedPanel/index.js
+0
-2
index.js
src/components/QrCode/index.js
+1
-9
index.js
src/components/Tab/index.js
+1
-1
index.js
src/components/TokenLogo/index.js
+2
-2
index.js
src/components/Web3Status/index.js
+6
-4
web3connect.js
src/ducks/web3connect.js
+1
-1
bitap_regex_search.js
src/helpers/fuse/bitap/bitap_regex_search.js
+1
-1
qr-scanner.js
src/libraries/qr-scanner.js
+2
-0
AddLiquidity.js
src/pages/Pool/AddLiquidity.js
+7
-9
CreateExchange.js
src/pages/Pool/CreateExchange.js
+1
-1
ModeSelector.js
src/pages/Pool/ModeSelector.js
+1
-1
RemoveLiquidity.js
src/pages/Pool/RemoveLiquidity.js
+4
-5
index.js
src/pages/Send/index.js
+6
-9
index.js
src/pages/Swap/index.js
+5
-7
No files found.
README.md
View file @
9c93c1a9
# Uniswap Frontend
[

](https://app.netlify.com/sites/uniswap/deploys)
This an an open source interface for Uniswap - a protocol for decentralized exchange of Ethereum tokens.
*
Website:
[
uniswap.io/
](
https://uniswap.io/
)
...
...
src/components/ContextualInfo/index.js
View file @
9c93c1a9
...
...
@@ -65,12 +65,12 @@ class ContextualInfo extends Component {
{
!
this
.
state
.
showDetails
?
(
<>
<
span
>
{
openDetailsText
}
<
/span
>
<
img
src
=
{
DropdownBlue
}
/
>
<
img
src
=
{
DropdownBlue
}
alt
=
'
dropdown
'
/>
<
/
>
)
:
(
<>
<
span
>
{
closeDetailsText
}
<
/span
>
<
img
src
=
{
DropupBlue
}
/
>
<
img
src
=
{
DropupBlue
}
alt
=
'
dropup
'
/>
<
/
>
)}
<
/div>
,
...
...
src/components/CurrencyInputPanel/index.js
View file @
9c93c1a9
...
...
@@ -230,7 +230,7 @@ class CurrencyInputPanel extends Component {
this
.
setState
({
searchQuery
:
e
.
target
.
value
});
}}
/
>
<
img
src
=
{
SearchIcon
}
className
=
"
token-modal__search-icon
"
/>
<
img
src
=
{
SearchIcon
}
className
=
"
token-modal__search-icon
"
alt
=
'
search
'
/>
<
/div
>
<
div
className
=
"
token-modal__token-list
"
>
{
this
.
renderTokenList
()}
...
...
src/components/Header/index.js
View file @
9c93c1a9
...
...
@@ -88,7 +88,7 @@ class BlockingWarning extends Component {
const
correctNetworkId
=
process
.
env
.
REACT_APP_NETWORK_ID
||
1
;
const
correctNetwork
=
process
.
env
.
REACT_APP_NETWORK
||
'
Main Ethereum Network
'
;
const
wrongNetwork
=
networkId
!=
correctNetworkId
;
const
wrongNetwork
=
networkId
!=
=
correctNetworkId
;
if
(
wrongNetwork
&&
initialized
)
{
content
=
[
...
...
@@ -114,14 +114,14 @@ class BlockingWarning extends Component {
isMobile
()
?
(
[
<
img
src
=
{
CoinbaseWalletLogo
}
key
=
"
coinbase-wallet
"
onClick
=
{()
=>
window
.
open
(
getCoinbaseWalletLink
(),
'
_blank
'
)}
/>
,
<
img
src
=
{
TrustLogo
}
key
=
"
trust
"
onClick
=
{()
=>
window
.
open
(
getTrustLink
(),
'
_blank
'
)}
/
>
<
img
alt
=
'
coinbase
'
src
=
{
CoinbaseWalletLogo
}
key
=
"
coinbase-wallet
"
onClick
=
{()
=>
window
.
open
(
getCoinbaseWalletLink
(),
'
_blank
'
)}
/>
,
<
img
alt
=
'
trust
'
src
=
{
TrustLogo
}
key
=
"
trust
"
onClick
=
{()
=>
window
.
open
(
getTrustLink
(),
'
_blank
'
)}
/
>
]
)
:
(
[
<
img
src
=
{
MetamaskLogo
}
key
=
"
metamask
"
onClick
=
{()
=>
window
.
open
(
getMetamaskLink
(),
'
_blank
'
)}
/>
,
<
img
src
=
{
BraveLogo
}
key
=
"
brave
"
onClick
=
{()
=>
window
.
open
(
getBraveLink
(),
'
_blank
'
)}
/
>
<
img
alt
=
'
metamask
'
src
=
{
MetamaskLogo
}
key
=
"
metamask
"
onClick
=
{()
=>
window
.
open
(
getMetamaskLink
(),
'
_blank
'
)}
/>
,
<
img
alt
=
'
brave
'
src
=
{
BraveLogo
}
key
=
"
brave
"
onClick
=
{()
=>
window
.
open
(
getBraveLink
(),
'
_blank
'
)}
/
>
]
)
}
...
...
src/components/NavigationTabs/index.js
View file @
9c93c1a9
...
...
@@ -50,7 +50,7 @@ class NavigationTabs extends Component {
{
showBetaMessage
&&
(
<
div
className
=
"
beta-message
"
onClick
=
{
dismissBetaMessage
}
>
💀
{
t
(
"
betaWarning
"
)}
<
span
role
=
'
img
'
aria
-
label
=
'
warning
'
>
💀
<
/span>
{t
(
"betaWarning"
)
}
<
/div
>
)
}
...
...
src/components/OversizedPanel/index.js
View file @
9c93c1a9
import
React
from
'
react
'
;
import
{
connect
}
from
'
react-redux
'
;
import
PropTypes
from
'
prop-types
'
;
import
'
./oversized-panel.scss
'
;
...
...
src/components/QrCode/index.js
View file @
9c93c1a9
...
...
@@ -21,10 +21,6 @@ class QrCode extends Component {
stream
:
null
,
};
constructor
(
props
)
{
super
(
props
);
}
componentDidUpdate
()
{
const
{
videoOpen
,
stream
}
=
this
.
state
;
...
...
@@ -102,12 +98,8 @@ class QrCode extends Component {
}
render
()
{
const
{
onValueReceived
,
}
=
this
.
props
;
return
[
<
img
key
=
"
icon
"
src
=
{
QrCodeSVG
}
onClick
=
{()
=>
{
<
img
key
=
"
icon
"
src
=
{
QrCodeSVG
}
alt
=
'
code
'
onClick
=
{()
=>
{
this
.
state
.
videoOpen
?
this
.
closeVideo
()
:
this
.
openVideo
();
}}
/>
,
this
.
renderQrReader
()
...
...
src/components/Tab/index.js
View file @
9c93c1a9
import
React
,
{
Component
}
from
'
react
'
;
import
React
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
classnames
from
'
classnames
'
;
...
...
src/components/TokenLogo/index.js
View file @
9c93c1a9
import
React
,
{
Component
}
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
EthereumLogo
from
'
../../assets/images/ethereum-logo.svg
'
;
import
GenericTokenLogo
from
'
../../assets/images/generic-token-logo.png
'
;
const
RINKEBY_TOKEN_MAP
=
{
'
0xDA5B056Cfb861282B4b59d29c9B395bcC238D29B
'
:
'
0x0d8775f648430679a709e98d2b0cb6250d2887ef
'
,
...
...
@@ -45,11 +44,12 @@ export default class TokenLogo extends Component {
}
if
(
!
path
)
{
return
<
div
className
=
{
className
}
style
=
{{
width
:
size
,
fontSize
:
size
}}
>
🤔
<
/div
>
return
<
div
className
=
{
className
}
style
=
{{
width
:
size
,
fontSize
:
size
}}
>
<
span
role
=
'
img
'
aria
-
label
=
'
thinking
'
>
🤔
<
/span>
</
div
>
}
return
(
<
img
alt
=
'
images
'
src
=
{
path
}
className
=
{
className
}
style
=
{{
...
...
src/components/Web3Status/index.js
View file @
9c93c1a9
...
...
@@ -2,10 +2,10 @@ import React, { Component } from 'react';
import
PropTypes
from
'
prop-types
'
;
import
{
connect
}
from
'
react-redux
'
;
import
classnames
from
'
classnames
'
;
import
Web3
from
'
web3
'
;
import
Jazzicon
from
'
jazzicon
'
;
import
{
CSSTransitionGroup
}
from
"
react-transition-group
"
;
import
{
withNamespaces
}
from
'
react-i18next
'
;
import
{
ethers
}
from
'
ethers
'
import
'
./web3-status.scss
'
;
import
Modal
from
'
../Modal
'
;
...
...
@@ -13,6 +13,8 @@ function getEtherscanLink(tx) {
return
`https://etherscan.io/tx/
${
tx
}
`
;
}
console
.
log
(
ethers
)
class
Web3Status
extends
Component
{
state
=
{
isShowingModal
:
false
,
...
...
@@ -93,7 +95,7 @@ class Web3Status extends Component {
return
;
}
if
(
!
address
||
address
.
length
<
42
||
!
Web3
.
utils
.
isHexStrict
(
address
))
{
if
(
!
address
||
address
.
length
<
42
||
!
ethers
.
utils
.
isHexString
(
address
))
{
return
;
}
...
...
@@ -119,11 +121,11 @@ function getPendingText(pendingTransactions, pendingLabel) {
}
function
getText
(
text
,
disconnectedText
)
{
if
(
!
text
||
text
.
length
<
42
||
!
Web3
.
utils
.
isHexStrict
(
text
))
{
if
(
!
text
||
text
.
length
<
42
||
!
ethers
.
utils
.
isHexString
(
text
))
{
return
disconnectedText
;
}
const
address
=
Web3
.
utils
.
toChecksum
Address
(
text
);
const
address
=
ethers
.
utils
.
get
Address
(
text
);
return
`
${
address
.
substring
(
0
,
6
)}
...
${
address
.
substring
(
38
)}
`
;
}
...
...
src/ducks/web3connect.js
View file @
9c93c1a9
...
...
@@ -220,7 +220,7 @@ export const sync = () => async (dispatch, getState) => {
watched
,
contracts
,
networkId
,
transactions
:
{
pending
,
confirmed
},
transactions
:
{
pending
},
}
=
getState
().
web3connect
;
// Sync Account
...
...
src/helpers/fuse/bitap/bitap_regex_search.js
View file @
9c93c1a9
// eslint-disable-next-line no-u
nused
-escape
// eslint-disable-next-line no-u
seless
-escape
const
SPECIAL_CHARS_REGEX
=
/
[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]
/g
export
default
function
(
text
,
pattern
,
tokenSeparator
=
/ +/g
)
{
...
...
src/libraries/qr-scanner.js
View file @
9c93c1a9
/* eslint-disable */
/*
@asset(/libraries/qr-scanner/qr-scanner-worker.min.js) */
'
use strict
'
;
export
default
class
QrScanner
{
constructor
(
video
,
onDecode
,
canvasSize
=
QrScanner
.
DEFAULT_CANVAS_SIZE
){
this
.
$video
=
video
;
this
.
$canvas
=
document
.
createElement
(
"
canvas
"
);
this
.
_onDecode
=
onDecode
;
this
.
_active
=
false
;
this
.
$canvas
.
width
=
canvasSize
;
this
.
$canvas
.
height
=
canvasSize
;
this
.
_sourceRect
=
{
x
:
0
,
y
:
0
,
width
:
canvasSize
,
height
:
canvasSize
};
this
.
$video
.
addEventListener
(
"
canplay
"
,()
=>
this
.
_updateSourceRect
());
this
.
$video
.
addEventListener
(
"
play
"
,()
=>
{
this
.
_updateSourceRect
();
this
.
_scanFrame
()},
false
);
...
...
src/pages/Pool/AddLiquidity.js
View file @
9c93c1a9
...
...
@@ -10,8 +10,6 @@ import NavigationTabs from '../../components/NavigationTabs';
import
{
selectors
,
addPendingTx
}
from
'
../../ducks/web3connect
'
;
import
PlusBlue
from
'
../../assets/images/plus-blue.svg
'
;
import
PlusGrey
from
'
../../assets/images/plus-grey.svg
'
;
import
DropdownBlue
from
"
../../assets/images/dropdown-blue.svg
"
;
import
DropupBlue
from
"
../../assets/images/dropup-blue.svg
"
;
import
{
getBlockDeadline
}
from
'
../../helpers/web3-utils
'
;
import
{
retry
}
from
'
../../helpers/promise-utils
'
;
import
ModeSelector
from
'
./ModeSelector
'
;
...
...
@@ -56,7 +54,7 @@ class AddLiquidity extends Component {
const
{
inputValue
,
outputValue
,
inputCurrency
,
outputCurrency
,
lastEditedField
}
=
this
.
state
;
return
isConnected
!==
nextProps
.
isConnected
||
t
!=
nextProps
.
t
||
t
!=
=
nextProps
.
t
||
account
!==
nextProps
.
account
||
exchangeAddresses
!==
nextProps
.
exchangeAddresses
||
web3
!==
nextProps
.
web3
||
...
...
@@ -455,7 +453,7 @@ class AddLiquidity extends Component {
action
:
'
Open
'
,
});
const
{
value
:
tokenReserve
,
decimals
,
label
}
=
selectors
().
getTokenBalance
(
outputCurrency
,
fromToken
[
outputCurrency
]);
const
{
value
:
tokenReserve
,
label
}
=
selectors
().
getTokenBalance
(
outputCurrency
,
fromToken
[
outputCurrency
]);
const
{
value
:
ethReserve
}
=
selectors
().
getBalance
(
fromToken
[
outputCurrency
]);
const
{
decimals
:
poolTokenDecimals
}
=
selectors
().
getBalance
(
account
,
fromToken
[
outputCurrency
]);
...
...
@@ -473,8 +471,8 @@ class AddLiquidity extends Component {
const
SLIPPAGE
=
0.025
;
const
minOutput
=
BN
(
outputValue
).
multipliedBy
(
1
-
SLIPPAGE
);
const
maxOutput
=
BN
(
outputValue
).
multipliedBy
(
1
+
SLIPPAGE
);
const
minPercentage
=
minOutput
.
dividedBy
(
minOutput
.
plus
(
tokenReserve
)).
multipliedBy
(
100
);
const
maxPercentage
=
maxOutput
.
dividedBy
(
maxOutput
.
plus
(
tokenReserve
)).
multipliedBy
(
100
);
//
const minPercentage = minOutput.dividedBy(minOutput.plus(tokenReserve)).multipliedBy(100);
//
const maxPercentage = maxOutput.dividedBy(maxOutput.plus(tokenReserve)).multipliedBy(100);
const
liquidityMinted
=
BN
(
inputValue
).
multipliedBy
(
totalSupply
.
dividedBy
(
ethReserve
));
const
adjTotalSupply
=
totalSupply
.
dividedBy
(
10
**
poolTokenDecimals
);
...
...
@@ -524,7 +522,7 @@ class AddLiquidity extends Component {
?
(
<
div
className
=
"
pool__new-exchange-warning
"
>
<
div
className
=
"
pool__new-exchange-warning-text
"
>
🚰
{
t
(
"
firstLiquidity
"
)}
<
span
role
=
'
img
'
aria
-
label
=
'
liquidity
'
>
🚰
<
/span>
{t
(
"firstLiquidity"
)
}
<
/div
>
<
div
className
=
"
pool__new-exchange-warning-text
"
>
{
t
(
"
initialExchangeRate
"
,
{
label
})
}
...
...
@@ -545,7 +543,7 @@ class AddLiquidity extends Component {
/>
<
OversizedPanel
>
<
div
className
=
"
swap__down-arrow-background
"
>
<
img
className
=
"
swap__down-arrow
"
src
=
{
isValid
?
PlusBlue
:
PlusGrey
}
/
>
<
img
className
=
"
swap__down-arrow
"
src
=
{
isValid
?
PlusBlue
:
PlusGrey
}
alt
=
'
plus
'
/>
<
/div
>
<
/OversizedPanel
>
<
CurrencyInputPanel
...
...
@@ -586,7 +584,7 @@ class AddLiquidity extends Component {
export
default
connect
(
state
=>
({
isConnected
:
Boolean
(
state
.
web3connect
.
account
)
&&
state
.
web3connect
.
networkId
==
(
process
.
env
.
REACT_APP_NETWORK_ID
||
1
),
isConnected
:
Boolean
(
state
.
web3connect
.
account
)
&&
state
.
web3connect
.
networkId
==
=
(
process
.
env
.
REACT_APP_NETWORK_ID
||
1
),
account
:
state
.
web3connect
.
account
,
balances
:
state
.
web3connect
.
balances
,
web3
:
state
.
web3connect
.
web3
,
...
...
src/pages/Pool/CreateExchange.js
View file @
9c93c1a9
...
...
@@ -222,7 +222,7 @@ class CreateExchange extends Component {
export
default
withRouter
(
connect
(
state
=>
({
isConnected
:
Boolean
(
state
.
web3connect
.
account
)
&&
state
.
web3connect
.
networkId
==
(
process
.
env
.
REACT_APP_NETWORK_ID
||
1
),
isConnected
:
Boolean
(
state
.
web3connect
.
account
)
&&
state
.
web3connect
.
networkId
==
=
(
process
.
env
.
REACT_APP_NETWORK_ID
||
1
),
account
:
state
.
web3connect
.
account
,
balances
:
state
.
web3connect
.
balances
,
web3
:
state
.
web3connect
.
web3
,
...
...
src/pages/Pool/ModeSelector.js
View file @
9c93c1a9
...
...
@@ -86,7 +86,7 @@ class ModeSelector extends Component {
<
span
className
=
"
pool__liquidity-label
"
>
{
this
.
props
.
title
}
<
/span
>
<
img
src
=
{
Dropdown
}
/
>
<
img
src
=
{
Dropdown
}
alt
=
'
dropdown
'
/>
<
/div
>
{
this
.
renderModal
()}
<
/OversizedPanel
>
...
...
src/pages/Pool/RemoveLiquidity.js
View file @
9c93c1a9
...
...
@@ -198,7 +198,6 @@ class RemoveLiquidity extends Component {
const
{
t
,
exchangeAddresses
:
{
fromToken
},
web3
,
selectors
,
account
,
}
=
this
.
props
;
...
...
@@ -215,9 +214,9 @@ class RemoveLiquidity extends Component {
});
const
SLIPPAGE
=
0.025
;
const
{
value
:
liquidityBalance
,
decimals
}
=
getBalance
(
account
,
exchangeAddress
);
const
{
decimals
}
=
getBalance
(
account
,
exchangeAddress
);
const
{
value
:
ethReserve
}
=
getBalance
(
exchangeAddress
);
const
{
value
:
tokenReserve
,
label
,
decimals
:
reserveDecimals
}
=
getBalance
(
exchangeAddress
,
tokenAddress
);
const
{
value
:
tokenReserve
,
label
}
=
getBalance
(
exchangeAddress
,
tokenAddress
);
const
ethPer
=
ethReserve
.
dividedBy
(
totalSupply
);
const
tokenPer
=
tokenReserve
.
dividedBy
(
totalSupply
);
...
...
@@ -377,7 +376,7 @@ class RemoveLiquidity extends Component {
/
>
<
OversizedPanel
>
<
div
className
=
"
swap__down-arrow-background
"
>
<
img
className
=
"
swap__down-arrow
"
src
=
{
isValid
?
ArrowDownBlue
:
ArrowDownGrey
}
/
>
<
img
className
=
"
swap__down-arrow
"
src
=
{
isValid
?
ArrowDownBlue
:
ArrowDownGrey
}
alt
=
'
arrow
'
/>
<
/div
>
<
/OversizedPanel
>
{
this
.
renderOutput
()
}
...
...
@@ -401,7 +400,7 @@ class RemoveLiquidity extends Component {
export
default
connect
(
state
=>
({
isConnected
:
Boolean
(
state
.
web3connect
.
account
)
&&
state
.
web3connect
.
networkId
==
(
process
.
env
.
REACT_APP_NETWORK_ID
||
1
),
isConnected
:
Boolean
(
state
.
web3connect
.
account
)
&&
state
.
web3connect
.
networkId
==
=
(
process
.
env
.
REACT_APP_NETWORK_ID
||
1
),
web3
:
state
.
web3connect
.
web3
,
balances
:
state
.
web3connect
.
balances
,
account
:
state
.
web3connect
.
account
,
...
...
src/pages/Send/index.js
View file @
9c93c1a9
...
...
@@ -11,8 +11,6 @@ import AddressInputPanel from '../../components/AddressInputPanel';
import
CurrencyInputPanel
from
'
../../components/CurrencyInputPanel
'
;
import
ContextualInfo
from
'
../../components/ContextualInfo
'
;
import
OversizedPanel
from
'
../../components/OversizedPanel
'
;
import
DropdownBlue
from
"
../../assets/images/dropdown-blue.svg
"
;
import
DropupBlue
from
"
../../assets/images/dropup-blue.svg
"
;
import
ArrowDownBlue
from
'
../../assets/images/arrow-down-blue.svg
'
;
import
ArrowDownGrey
from
'
../../assets/images/arrow-down-grey.svg
'
;
import
{
getBlockDeadline
}
from
'
../../helpers/web3-utils
'
;
...
...
@@ -586,7 +584,6 @@ class Send extends Component {
outputValue
,
outputCurrency
,
recipient
,
inputAmountB
,
lastEditedField
,
}
=
this
.
state
;
const
{
t
,
selectors
,
account
}
=
this
.
props
;
...
...
@@ -600,10 +597,10 @@ class Send extends Component {
const
TOKEN_ALLOWED_SLIPPAGE
=
0.04
;
const
type
=
getSendType
(
inputCurrency
,
outputCurrency
);
const
{
label
:
inputLabel
,
decimals
:
inputDecimals
}
=
selectors
().
getBalance
(
account
,
inputCurrency
);
const
{
label
:
outputLabel
,
decimals
:
outputDecimals
}
=
selectors
().
getBalance
(
account
,
outputCurrency
);
const
{
label
:
inputLabel
}
=
selectors
().
getBalance
(
account
,
inputCurrency
);
const
{
label
:
outputLabel
}
=
selectors
().
getBalance
(
account
,
outputCurrency
);
const
label
=
lastEditedField
===
INPUT
?
outputLabel
:
inputLabel
;
//
const label = lastEditedField === INPUT ? outputLabel : inputLabel;
let
minOutput
;
let
maxInput
;
...
...
@@ -749,7 +746,7 @@ class Send extends Component {
/
>
<
OversizedPanel
>
<
div
className
=
"
swap__down-arrow-background
"
>
<
img
onClick
=
{
this
.
flipInputOutput
}
className
=
"
swap__down-arrow swap__down-arrow--clickable
"
src
=
{
isValid
?
ArrowDownBlue
:
ArrowDownGrey
}
/
>
<
img
onClick
=
{
this
.
flipInputOutput
}
className
=
"
swap__down-arrow swap__down-arrow--clickable
"
alt
=
'
arrow
'
src
=
{
isValid
?
ArrowDownBlue
:
ArrowDownGrey
}
/
>
<
/div
>
<
/OversizedPanel
>
<
CurrencyInputPanel
...
...
@@ -766,7 +763,7 @@ class Send extends Component {
/>
<
OversizedPanel
>
<
div
className
=
"
swap__down-arrow-background
"
>
<
img
className
=
"
swap__down-arrow
"
src
=
{
isValid
?
ArrowDownBlue
:
ArrowDownGrey
}
/
>
<
img
className
=
"
swap__down-arrow
"
src
=
{
isValid
?
ArrowDownBlue
:
ArrowDownGrey
}
alt
=
'
arrow
'
/>
<
/div
>
<
/OversizedPanel
>
<
AddressInputPanel
...
...
@@ -796,7 +793,7 @@ class Send extends Component {
export
default
connect
(
state
=>
({
balances
:
state
.
web3connect
.
balances
,
isConnected
:
!!
state
.
web3connect
.
account
&&
state
.
web3connect
.
networkId
==
(
process
.
env
.
REACT_APP_NETWORK_ID
||
1
),
isConnected
:
!!
state
.
web3connect
.
account
&&
state
.
web3connect
.
networkId
==
=
(
process
.
env
.
REACT_APP_NETWORK_ID
||
1
),
account
:
state
.
web3connect
.
account
,
web3
:
state
.
web3connect
.
web3
,
exchangeAddresses
:
state
.
addresses
.
exchangeAddresses
,
...
...
src/pages/Swap/index.js
View file @
9c93c1a9
...
...
@@ -12,8 +12,6 @@ import NavigationTabs from '../../components/NavigationTabs';
import
CurrencyInputPanel
from
'
../../components/CurrencyInputPanel
'
;
import
ContextualInfo
from
'
../../components/ContextualInfo
'
;
import
OversizedPanel
from
'
../../components/OversizedPanel
'
;
import
DropdownBlue
from
"
../../assets/images/dropdown-blue.svg
"
;
import
DropupBlue
from
"
../../assets/images/dropup-blue.svg
"
;
import
ArrowDownBlue
from
'
../../assets/images/arrow-down-blue.svg
'
;
import
ArrowDownGrey
from
'
../../assets/images/arrow-down-grey.svg
'
;
import
{
getBlockDeadline
}
from
'
../../helpers/web3-utils
'
;
...
...
@@ -584,10 +582,10 @@ class Swap extends Component {
const
TOKEN_ALLOWED_SLIPPAGE
=
0.04
;
const
type
=
getSwapType
(
inputCurrency
,
outputCurrency
);
const
{
label
:
inputLabel
,
decimals
:
inputDecimals
}
=
selectors
().
getBalance
(
account
,
inputCurrency
);
const
{
label
:
outputLabel
,
decimals
:
outputDecimals
}
=
selectors
().
getBalance
(
account
,
outputCurrency
);
const
{
label
:
inputLabel
}
=
selectors
().
getBalance
(
account
,
inputCurrency
);
const
{
label
:
outputLabel
}
=
selectors
().
getBalance
(
account
,
outputCurrency
);
const
label
=
lastEditedField
===
INPUT
?
outputLabel
:
inputLabel
;
//
const label = lastEditedField === INPUT ? outputLabel : inputLabel;
let
minOutput
;
let
maxInput
;
...
...
@@ -732,7 +730,7 @@ class Swap extends Component {
/
>
<
OversizedPanel
>
<
div
className
=
"
swap__down-arrow-background
"
>
<
img
onClick
=
{
this
.
flipInputOutput
}
className
=
"
swap__down-arrow swap__down-arrow--clickable
"
src
=
{
isValid
?
ArrowDownBlue
:
ArrowDownGrey
}
/
>
<
img
onClick
=
{
this
.
flipInputOutput
}
className
=
"
swap__down-arrow swap__down-arrow--clickable
"
alt
=
'
swap
'
src
=
{
isValid
?
ArrowDownBlue
:
ArrowDownGrey
}
/
>
<
/div
>
<
/OversizedPanel
>
<
CurrencyInputPanel
...
...
@@ -769,7 +767,7 @@ class Swap extends Component {
export
default
connect
(
state
=>
({
balances
:
state
.
web3connect
.
balances
,
isConnected
:
!!
state
.
web3connect
.
account
&&
state
.
web3connect
.
networkId
==
(
process
.
env
.
REACT_APP_NETWORK_ID
||
1
),
isConnected
:
!!
state
.
web3connect
.
account
&&
state
.
web3connect
.
networkId
==
=
(
process
.
env
.
REACT_APP_NETWORK_ID
||
1
),
account
:
state
.
web3connect
.
account
,
web3
:
state
.
web3connect
.
web3
,
exchangeAddresses
:
state
.
addresses
.
exchangeAddresses
,
...
...
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