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
80da6e0f
Commit
80da6e0f
authored
Jul 31, 2019
by
Callil Capuozzo
Committed by
Noah Zinsmeister
Jul 31, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dark theme (#380)
parent
c8f8d838
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
232 additions
and
134 deletions
+232
-134
SVGArrowDown.js
src/assets/svg/SVGArrowDown.js
+12
-0
index.js
src/components/AddressInputPanel/index.js
+24
-19
index.js
src/components/ContextualInfo/index.js
+19
-5
index.js
src/components/ContextualInfoNew/index.js
+2
-2
index.js
src/components/CurrencyInputPanel/index.js
+13
-10
index.jsx
src/components/ExchangePage/index.jsx
+7
-6
index.js
src/components/Header/index.js
+14
-1
index.js
src/components/Modal/index.js
+5
-3
index.js
src/components/NavigationTabs/index.js
+9
-5
index.js
src/components/TransactionDetails/index.js
+9
-9
index.js
src/components/Web3Status/index.js
+5
-5
LocalStorage.js
src/contexts/LocalStorage.js
+17
-3
index.js
src/index.js
+10
-10
AddLiquidity.js
src/pages/Pool/AddLiquidity.js
+15
-12
CreateExchange.js
src/pages/Pool/CreateExchange.js
+1
-1
ModeSelector.js
src/pages/Pool/ModeSelector.js
+21
-8
RemoveLiquidity.js
src/pages/Pool/RemoveLiquidity.js
+7
-5
components.js
src/theme/components.js
+6
-4
index.js
src/theme/index.js
+36
-26
No files found.
src/assets/svg/SVGArrowDown.js
0 → 100644
View file @
80da6e0f
import
React
from
'
react
'
const
SVGArrowDown
=
props
=>
(
<
svg
width
=
"
1em
"
height
=
"
1em
"
viewBox
=
"
0 0 9 10
"
fill
=
"
currentColor
"
{...
props
}
>
<
path
d
=
"
M5.298 0H4.24v7.911h-.075L1.256 4.932l-.717.735L4.769 10 9 5.667l-.718-.735-2.908 2.979h-.076V0z
"
fill
=
"
currentColor
"
/>
<
/svg
>
)
export
default
SVGArrowDown
src/components/AddressInputPanel/index.js
View file @
80da6e0f
...
@@ -2,17 +2,17 @@ import React, { useState, useEffect } from 'react'
...
@@ -2,17 +2,17 @@ import React, { useState, useEffect } from 'react'
import
styled
from
'
styled-components
'
import
styled
from
'
styled-components
'
import
{
useTranslation
}
from
'
react-i18next
'
import
{
useTranslation
}
from
'
react-i18next
'
import
{
useWeb3Context
}
from
'
web3-react
'
import
{
useWeb3Context
}
from
'
web3-react
'
import
{
lighten
}
from
'
polished
'
import
{
transparentize
}
from
'
polished
'
import
{
isAddress
}
from
'
../../utils
'
import
{
isAddress
}
from
'
../../utils
'
import
{
useDebounce
}
from
'
../../hooks
'
import
{
useDebounce
}
from
'
../../hooks
'
const
InputPanel
=
styled
.
div
`
const
InputPanel
=
styled
.
div
`
${({
theme
})
=>
theme
.
flexColumnNoWrap
}
${({
theme
})
=>
theme
.
flexColumnNoWrap
}
box-shadow: 0 4px 8px 0
${({
theme
})
=>
lighten
(
0.9
,
theme
.
royalBlue
)}
;
box-shadow: 0 4px 8px 0
${({
theme
})
=>
transparentize
(
0.95
,
theme
.
royalBlue
)}
;
position: relative;
position: relative;
border-radius: 1.25rem;
border-radius: 1.25rem;
background-color:
${({
theme
})
=>
theme
.
white
}
;
background-color:
${({
theme
})
=>
theme
.
inputBackground
}
;
z-index: 1;
z-index: 1;
`
`
...
@@ -21,9 +21,10 @@ const ContainerRow = styled.div`
...
@@ -21,9 +21,10 @@ const ContainerRow = styled.div`
justify-content: center;
justify-content: center;
align-items: center;
align-items: center;
border-radius: 1.25rem;
border-radius: 1.25rem;
box-shadow: 0 0 0 1px
${({
error
,
theme
})
=>
(
error
?
theme
.
salmonRed
:
theme
.
mercuryGray
)}
;
border: 1px solid
${({
error
,
theme
})
=>
(
error
?
theme
.
salmonRed
:
theme
.
mercuryGray
)}
;
background-color:
${({
theme
})
=>
theme
.
white
}
;
transition: box-shadow 200ms ease-in-out;
background-color:
${({
theme
})
=>
theme
.
inputBackground
}
;
transition: box-shadow 125ms ease-in-out;
`
`
const
InputContainer
=
styled
.
div
`
const
InputContainer
=
styled
.
div
`
...
@@ -59,13 +60,15 @@ const Input = styled.input`
...
@@ -59,13 +60,15 @@ const Input = styled.input`
border: none;
border: none;
flex: 1 1 auto;
flex: 1 1 auto;
width: 0;
width: 0;
background-color:
${({
theme
})
=>
theme
.
inputBackground
}
;
color:
${({
error
,
theme
})
=>
(
error
?
theme
.
salmonRed
:
theme
.
royalBlue
)}
;
color:
${({
error
,
theme
})
=>
(
error
?
theme
.
salmonRed
:
theme
.
royalBlue
)}
;
transition: color
200
ms ease-in-out;
transition: color
125
ms ease-in-out;
overflow: hidden;
overflow: hidden;
text-overflow: ellipsis;
text-overflow: ellipsis;
::placeholder {
::placeholder {
color:
${({
theme
})
=>
theme
.
chalice
Gray
}
;
color:
${({
theme
})
=>
theme
.
placeholder
Gray
}
;
}
}
`
`
...
@@ -93,8 +96,9 @@ export default function AddressInputPanel({ title, initialInput = '', onChange =
...
@@ -93,8 +96,9 @@ export default function AddressInputPanel({ title, initialInput = '', onChange =
let
stale
=
false
let
stale
=
false
if
(
isAddress
(
debouncedInput
))
{
if
(
isAddress
(
debouncedInput
))
{
try
{
library
library
.
lookupAddress
(
debouncedInput
).
then
(
name
=>
{
.
lookupAddress
(
debouncedInput
)
.
then
(
name
=>
{
if
(
!
stale
)
{
if
(
!
stale
)
{
// if an ENS name exists, set it as the destination
// if an ENS name exists, set it as the destination
if
(
name
)
{
if
(
name
)
{
...
@@ -105,14 +109,15 @@ export default function AddressInputPanel({ title, initialInput = '', onChange =
...
@@ -105,14 +109,15 @@ export default function AddressInputPanel({ title, initialInput = '', onChange =
}
}
}
}
})
})
}
catch
{
.
catch
(()
=>
{
setData
({
address
:
debouncedInput
,
name
:
''
})
setData
({
address
:
debouncedInput
,
name
:
''
})
setError
(
null
)
setError
(
null
)
}
})
}
else
{
}
else
{
if
(
debouncedInput
!==
''
)
{
if
(
debouncedInput
!==
''
)
{
try
{
library
library
.
resolveName
(
debouncedInput
).
then
(
address
=>
{
.
resolveName
(
debouncedInput
)
.
then
(
address
=>
{
if
(
!
stale
)
{
if
(
!
stale
)
{
// if the debounced input name resolves to an address
// if the debounced input name resolves to an address
if
(
address
)
{
if
(
address
)
{
...
@@ -123,9 +128,9 @@ export default function AddressInputPanel({ title, initialInput = '', onChange =
...
@@ -123,9 +128,9 @@ export default function AddressInputPanel({ title, initialInput = '', onChange =
}
}
}
}
})
})
}
catch
{
.
catch
(()
=>
{
setError
(
true
)
setError
(
true
)
}
})
}
}
}
}
...
...
src/components/ContextualInfo/index.js
View file @
80da6e0f
...
@@ -2,8 +2,8 @@ import React, { Component } from 'react'
...
@@ -2,8 +2,8 @@ import React, { Component } from 'react'
import
PropTypes
from
'
prop-types
'
import
PropTypes
from
'
prop-types
'
import
styled
from
'
styled-components
'
import
styled
from
'
styled-components
'
import
DropdownBlue
from
'
../../assets/images/dropdown
-blue.svg
'
import
{
ReactComponent
as
Dropup
}
from
'
../../assets/images/dropup
-blue.svg
'
import
DropupBlue
from
'
../../assets/images/dropup
-blue.svg
'
import
{
ReactComponent
as
Dropdown
}
from
'
../../assets/images/dropdown
-blue.svg
'
const
SummaryWrapper
=
styled
.
div
`
const
SummaryWrapper
=
styled
.
div
`
color:
${({
error
,
theme
})
=>
(
error
?
theme
.
salmonRed
:
theme
.
doveGray
)}
;
color:
${({
error
,
theme
})
=>
(
error
?
theme
.
salmonRed
:
theme
.
doveGray
)}
;
...
@@ -14,7 +14,7 @@ const SummaryWrapper = styled.div`
...
@@ -14,7 +14,7 @@ const SummaryWrapper = styled.div`
`
`
const
Details
=
styled
.
div
`
const
Details
=
styled
.
div
`
background-color:
${({
theme
})
=>
theme
.
concret
eGray
}
;
background-color:
${({
theme
})
=>
theme
.
dov
eGray
}
;
padding: 1.5rem;
padding: 1.5rem;
border-radius: 1rem;
border-radius: 1rem;
font-size: 0.75rem;
font-size: 0.75rem;
...
@@ -42,6 +42,20 @@ const SummaryWrapperContainer = styled.div`
...
@@ -42,6 +42,20 @@ const SummaryWrapperContainer = styled.div`
}
}
`
`
const
WrappedDropup
=
({
isError
,
highSlippageWarning
,
...
rest
})
=>
<
Dropup
{...
rest
}
/
>
const
ColoredDropup
=
styled
(
WrappedDropup
)
`
path {
stroke:
${({
theme
})
=>
theme
.
royalBlue
}
;
}
`
const
WrappedDropdown
=
({
isError
,
highSlippageWarning
,
...
rest
})
=>
<
Dropdown
{...
rest
}
/
>
const
ColoredDropdown
=
styled
(
WrappedDropdown
)
`
path {
stroke:
${({
theme
})
=>
theme
.
royalBlue
}
;
}
`
class
ContextualInfo
extends
Component
{
class
ContextualInfo
extends
Component
{
static
propTypes
=
{
static
propTypes
=
{
openDetailsText
:
PropTypes
.
string
,
openDetailsText
:
PropTypes
.
string
,
...
@@ -89,12 +103,12 @@ class ContextualInfo extends Component {
...
@@ -89,12 +103,12 @@ class ContextualInfo extends Component {
{
!
this
.
state
.
showDetails
?
(
{
!
this
.
state
.
showDetails
?
(
<>
<>
<
span
>
{
openDetailsText
}
<
/span
>
<
span
>
{
openDetailsText
}
<
/span
>
<
img
src
=
{
DropdownBlue
}
alt
=
"
dropdown
"
/>
<
ColoredDropup
/>
<
/
>
<
/
>
)
:
(
)
:
(
<>
<>
<
span
>
{
closeDetailsText
}
<
/span
>
<
span
>
{
closeDetailsText
}
<
/span
>
<
img
src
=
{
DropupBlue
}
alt
=
"
dropup
"
/>
<
ColoredDropdown
/>
<
/
>
<
/
>
)}
)}
<
/SummaryWrapperContainer
>
<
/SummaryWrapperContainer
>
...
...
src/components/ContextualInfoNew/index.js
View file @
80da6e0f
...
@@ -61,7 +61,7 @@ const ErrorSpan = styled.span`
...
@@ -61,7 +61,7 @@ const ErrorSpan = styled.span`
const
WrappedDropup
=
({
isError
,
highSlippageWarning
,
...
rest
})
=>
<
Dropup
{...
rest
}
/
>
const
WrappedDropup
=
({
isError
,
highSlippageWarning
,
...
rest
})
=>
<
Dropup
{...
rest
}
/
>
const
ColoredDropup
=
styled
(
WrappedDropup
)
`
const
ColoredDropup
=
styled
(
WrappedDropup
)
`
path {
path {
stroke:
${({
isError
,
theme
})
=>
isError
&&
theme
.
salmonRed
}
;
stroke:
${({
isError
,
theme
})
=>
(
isError
?
theme
.
salmonRed
:
theme
.
royalBlue
)
}
;
${({
highSlippageWarning
,
theme
})
=>
${({
highSlippageWarning
,
theme
})
=>
highSlippageWarning
&&
highSlippageWarning
&&
...
@@ -74,7 +74,7 @@ const ColoredDropup = styled(WrappedDropup)`
...
@@ -74,7 +74,7 @@ const ColoredDropup = styled(WrappedDropup)`
const
WrappedDropdown
=
({
isError
,
highSlippageWarning
,
...
rest
})
=>
<
Dropdown
{...
rest
}
/
>
const
WrappedDropdown
=
({
isError
,
highSlippageWarning
,
...
rest
})
=>
<
Dropdown
{...
rest
}
/
>
const
ColoredDropdown
=
styled
(
WrappedDropdown
)
`
const
ColoredDropdown
=
styled
(
WrappedDropdown
)
`
path {
path {
stroke:
${({
isError
,
theme
})
=>
isError
&&
theme
.
salmonRed
}
;
stroke:
${({
isError
,
theme
})
=>
(
isError
?
theme
.
salmonRed
:
theme
.
royalBlue
)
}
;
${({
highSlippageWarning
,
theme
})
=>
${({
highSlippageWarning
,
theme
})
=>
highSlippageWarning
&&
highSlippageWarning
&&
...
...
src/components/CurrencyInputPanel/index.js
View file @
80da6e0f
...
@@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next'
...
@@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next'
import
{
ethers
}
from
'
ethers
'
import
{
ethers
}
from
'
ethers
'
import
styled
from
'
styled-components
'
import
styled
from
'
styled-components
'
import
escapeStringRegex
from
'
escape-string-regexp
'
import
escapeStringRegex
from
'
escape-string-regexp
'
import
{
lighten
,
darken
}
from
'
polished
'
import
{
darken
}
from
'
polished
'
import
Tooltip
from
'
@reach/tooltip
'
import
Tooltip
from
'
@reach/tooltip
'
import
'
@reach/tooltip/styles.css
'
import
'
@reach/tooltip/styles.css
'
import
{
isMobile
}
from
'
react-device-detect
'
import
{
isMobile
}
from
'
react-device-detect
'
...
@@ -18,6 +18,7 @@ import TokenLogo from '../TokenLogo'
...
@@ -18,6 +18,7 @@ import TokenLogo from '../TokenLogo'
import
SearchIcon
from
'
../../assets/images/magnifying-glass.svg
'
import
SearchIcon
from
'
../../assets/images/magnifying-glass.svg
'
import
{
useTransactionAdder
,
usePendingApproval
}
from
'
../../contexts/Transactions
'
import
{
useTransactionAdder
,
usePendingApproval
}
from
'
../../contexts/Transactions
'
import
{
useTokenDetails
,
useAllTokenDetails
}
from
'
../../contexts/Tokens
'
import
{
useTokenDetails
,
useAllTokenDetails
}
from
'
../../contexts/Tokens
'
import
{
transparentize
}
from
'
polished
'
const
GAS_MARGIN
=
ethers
.
utils
.
bigNumberify
(
1000
)
const
GAS_MARGIN
=
ethers
.
utils
.
bigNumberify
(
1000
)
...
@@ -40,12 +41,14 @@ const SubCurrencySelect = styled.button`
...
@@ -40,12 +41,14 @@ const SubCurrencySelect = styled.button`
const
InputRow
=
styled
.
div
`
const
InputRow
=
styled
.
div
`
${({
theme
})
=>
theme
.
flexRowNoWrap
}
${({
theme
})
=>
theme
.
flexRowNoWrap
}
align-items: center;
align-items: center;
padding: 0.25rem 0.85rem 0.75rem;
padding: 0.25rem 0.85rem 0.75rem;
`
`
const
Input
=
styled
(
BorderlessInput
)
`
const
Input
=
styled
(
BorderlessInput
)
`
font-size: 1.5rem;
font-size: 1.5rem;
color:
${({
error
,
theme
})
=>
error
&&
theme
.
salmonRed
}
;
color:
${({
error
,
theme
})
=>
error
&&
theme
.
salmonRed
}
;
background-color:
${({
theme
})
=>
theme
.
inputBackground
}
;
`
`
const
StyledBorderlessInput
=
styled
(
BorderlessInput
)
`
const
StyledBorderlessInput
=
styled
(
BorderlessInput
)
`
...
@@ -56,7 +59,7 @@ const StyledBorderlessInput = styled(BorderlessInput)`
...
@@ -56,7 +59,7 @@ const StyledBorderlessInput = styled(BorderlessInput)`
const
CurrencySelect
=
styled
.
button
`
const
CurrencySelect
=
styled
.
button
`
align-items: center;
align-items: center;
font-size: 1rem;
font-size: 1rem;
color:
${({
selected
,
theme
})
=>
(
selected
?
theme
.
black
:
theme
.
royalBlue
)}
;
color:
${({
selected
,
theme
})
=>
(
selected
?
theme
.
textColor
:
theme
.
royalBlue
)}
;
height: 2rem;
height: 2rem;
border: 1px solid
${({
selected
,
theme
})
=>
(
selected
?
theme
.
mercuryGray
:
theme
.
royalBlue
)}
;
border: 1px solid
${({
selected
,
theme
})
=>
(
selected
?
theme
.
mercuryGray
:
theme
.
royalBlue
)}
;
border-radius: 2.5rem;
border-radius: 2.5rem;
...
@@ -90,27 +93,28 @@ const StyledDropDown = styled(DropDown)`
...
@@ -90,27 +93,28 @@ const StyledDropDown = styled(DropDown)`
height: 35%;
height: 35%;
path {
path {
stroke:
${({
selected
,
theme
})
=>
(
selected
?
theme
.
black
:
theme
.
royalBlue
)}
;
stroke:
${({
selected
,
theme
})
=>
(
selected
?
theme
.
textColor
:
theme
.
royalBlue
)}
;
}
}
`
`
const
InputPanel
=
styled
.
div
`
const
InputPanel
=
styled
.
div
`
${({
theme
})
=>
theme
.
flexColumnNoWrap
}
${({
theme
})
=>
theme
.
flexColumnNoWrap
}
box-shadow: 0 4px 8px 0
${({
theme
})
=>
lighten
(
0.9
,
theme
.
royalBlue
)}
;
box-shadow: 0 4px 8px 0
${({
theme
})
=>
transparentize
(
0.95
,
theme
.
royalBlue
)}
;
position: relative;
position: relative;
border-radius: 1.25rem;
border-radius: 1.25rem;
background-color:
${({
theme
})
=>
theme
.
white
}
;
background-color:
${({
theme
})
=>
theme
.
inputBackground
}
;
z-index: 1;
z-index: 1;
`
`
const
Container
=
styled
.
div
`
const
Container
=
styled
.
div
`
border-radius: 1.25rem;
border-radius: 1.25rem;
box-shadow: 0 0 0 1px
${({
error
,
theme
})
=>
(
error
?
theme
.
salmonRed
:
theme
.
mercuryGray
)}
;
border: 1px solid
${({
error
,
theme
})
=>
(
error
?
theme
.
salmonRed
:
theme
.
mercuryGray
)}
;
background-color:
${({
theme
})
=>
theme
.
white
}
;
transition: box-shadow 200ms ease-in-out;
background-color:
${({
theme
})
=>
theme
.
inputBackground
}
;
transition: box-shadow 150ms ease-out;
:focus-within {
:focus-within {
bo
x-shadow: 0 0 1px 1px
${({
theme
})
=>
theme
.
malibuBlue
}
;
bo
rder: 1px solid
${({
theme
})
=>
theme
.
malibuBlue
}
;
}
}
`
`
...
@@ -145,7 +149,6 @@ const ErrorSpan = styled.span`
...
@@ -145,7 +149,6 @@ const ErrorSpan = styled.span`
const
TokenModal
=
styled
.
div
`
const
TokenModal
=
styled
.
div
`
${({
theme
})
=>
theme
.
flexColumnNoWrap
}
${({
theme
})
=>
theme
.
flexColumnNoWrap
}
background-color:
${({
theme
})
=>
theme
.
white
}
;
width: 100%;
width: 100%;
`
`
...
...
src/components/ExchangePage/index.jsx
View file @
80da6e0f
...
@@ -10,8 +10,7 @@ import CurrencyInputPanel from '../CurrencyInputPanel'
...
@@ -10,8 +10,7 @@ import CurrencyInputPanel from '../CurrencyInputPanel'
import
AddressInputPanel
from
'
../AddressInputPanel
'
import
AddressInputPanel
from
'
../AddressInputPanel
'
import
OversizedPanel
from
'
../OversizedPanel
'
import
OversizedPanel
from
'
../OversizedPanel
'
import
TransactionDetails
from
'
../TransactionDetails
'
import
TransactionDetails
from
'
../TransactionDetails
'
import
ArrowDownBlue
from
'
../../assets/images/arrow-down-blue.svg
'
import
ArrowDown
from
'
../../assets/svg/SVGArrowDown
'
import
ArrowDownGrey
from
'
../../assets/images/arrow-down-grey.svg
'
import
{
amountFormatter
,
calculateGasMargin
}
from
'
../../utils
'
import
{
amountFormatter
,
calculateGasMargin
}
from
'
../../utils
'
import
{
useExchangeContract
}
from
'
../../hooks
'
import
{
useExchangeContract
}
from
'
../../hooks
'
import
{
useTokenDetails
}
from
'
../../contexts/Tokens
'
import
{
useTokenDetails
}
from
'
../../contexts/Tokens
'
...
@@ -42,7 +41,9 @@ const DownArrowBackground = styled.div`
...
@@ -42,7 +41,9 @@ const DownArrowBackground = styled.div`
align-items: center;
align-items: center;
`
`
const
DownArrow
=
styled
.
img
`
const
WrappedArrowDown
=
({
clickable
,
active
,
...
rest
})
=>
<
ArrowDown
{
...
rest
}
/>
const
DownArrow
=
styled
(
WrappedArrowDown
)
`
color:
${({
theme
,
active
})
=>
(
active
?
theme
.
royalBlue
:
theme
.
chaliceGray
)}
;
width: 0.625rem;
width: 0.625rem;
height: 0.625rem;
height: 0.625rem;
position: relative;
position: relative;
...
@@ -61,7 +62,7 @@ const ExchangeRateWrapper = styled.div`
...
@@ -61,7 +62,7 @@ const ExchangeRateWrapper = styled.div`
const
ExchangeRate
=
styled
.
span
`
const
ExchangeRate
=
styled
.
span
`
flex: 1 1 auto;
flex: 1 1 auto;
width: 0;
width: 0;
color:
${({
theme
})
=>
theme
.
chalic
eGray
}
;
color:
${({
theme
})
=>
theme
.
dov
eGray
}
;
`
`
const
Flex
=
styled
.
div
`
const
Flex
=
styled
.
div
`
...
@@ -619,7 +620,7 @@ export default function ExchangePage({ initialCurrency, sending }) {
...
@@ -619,7 +620,7 @@ export default function ExchangePage({ initialCurrency, sending }) {
}
}
}
}
clickable
clickable
alt=
"swap"
alt=
"swap"
src=
{
isValid
?
ArrowDownBlue
:
ArrowDownGrey
}
active=
{
isValid
}
/>
/>
</
DownArrowBackground
>
</
DownArrowBackground
>
</
OversizedPanel
>
</
OversizedPanel
>
...
@@ -643,7 +644,7 @@ export default function ExchangePage({ initialCurrency, sending }) {
...
@@ -643,7 +644,7 @@ export default function ExchangePage({ initialCurrency, sending }) {
<>
<>
<
OversizedPanel
>
<
OversizedPanel
>
<
DownArrowBackground
>
<
DownArrowBackground
>
<
DownArrow
src=
{
isValid
?
ArrowDownBlue
:
ArrowDownGrey
}
alt=
"arrow"
/>
<
DownArrow
active=
{
isValid
}
alt=
"arrow"
/>
</
DownArrowBackground
>
</
DownArrowBackground
>
</
OversizedPanel
>
</
OversizedPanel
>
<
AddressInputPanel
onChange=
{
setRecipient
}
onError=
{
setRecipientError
}
/>
<
AddressInputPanel
onChange=
{
setRecipient
}
onError=
{
setRecipientError
}
/>
...
...
src/components/Header/index.js
View file @
80da6e0f
...
@@ -4,6 +4,7 @@ import styled from 'styled-components'
...
@@ -4,6 +4,7 @@ import styled from 'styled-components'
import
{
Link
}
from
'
../../theme
'
import
{
Link
}
from
'
../../theme
'
import
Web3Status
from
'
../Web3Status
'
import
Web3Status
from
'
../Web3Status
'
import
{
darken
}
from
'
polished
'
import
{
darken
}
from
'
polished
'
import
{
useDarkModeManager
}
from
'
../../contexts/LocalStorage
'
const
HeaderElement
=
styled
.
div
`
const
HeaderElement
=
styled
.
div
`
margin: 1.25rem;
margin: 1.25rem;
...
@@ -15,9 +16,19 @@ const Title = styled.div`
...
@@ -15,9 +16,19 @@ const Title = styled.div`
display: flex;
display: flex;
align-items: center;
align-items: center;
:hover {
cursor: pointer;
}
#image {
#image {
font-size: 1.5rem;
font-size: 1.5rem;
margin-right: 1rem;
margin-right: 1rem;
transform: rotate(0deg);
transition: transform 150ms ease-out;
:hover {
transform: rotate(-10deg);
}
}
}
#link {
#link {
...
@@ -36,11 +47,13 @@ const Title = styled.div`
...
@@ -36,11 +47,13 @@ const Title = styled.div`
`
`
export
default
function
Header
()
{
export
default
function
Header
()
{
const
[,
toggleDarkMode
]
=
useDarkModeManager
()
return
(
return
(
<>
<>
<
HeaderElement
>
<
HeaderElement
>
<
Title
>
<
Title
>
<
span
id
=
"
image
"
role
=
"
img
"
aria
-
label
=
"
Unicorn Emoji
"
>
<
span
onClick
=
{
toggleDarkMode
}
id
=
"
image
"
role
=
"
img
"
aria
-
label
=
"
Unicorn Emoji
"
>
🦄
🦄
<
/span
>
<
/span
>
...
...
src/components/Modal/index.js
View file @
80da6e0f
...
@@ -21,8 +21,10 @@ const FilteredDialogContent = ({ minHeight, ...rest }) => <DialogContent {...res
...
@@ -21,8 +21,10 @@ const FilteredDialogContent = ({ minHeight, ...rest }) => <DialogContent {...res
const
StyledDialogContent
=
styled
(
FilteredDialogContent
)
`
const
StyledDialogContent
=
styled
(
FilteredDialogContent
)
`
&[data-reach-dialog-content] {
&[data-reach-dialog-content] {
margin: 0 0 2rem 0;
margin: 0 0 2rem 0;
${({
theme
})
=>
theme
.
mediaWidth
.
upToMedium
`margin: 0;`
}
border: 1px solid
${({
theme
})
=>
theme
.
concreteGray
}
;
padding: 0;
background-color:
${({
theme
})
=>
theme
.
inputBackground
}
;
${({
theme
})
=>
theme
.
mediaWidth
.
upToMedium
`margin: 0;`
}
;
padding: 0px;
width: 50vw;
width: 50vw;
max-width: 650px;
max-width: 650px;
${({
theme
})
=>
theme
.
mediaWidth
.
upToMedium
`width: 65vw;`
}
${({
theme
})
=>
theme
.
mediaWidth
.
upToMedium
`width: 65vw;`
}
...
@@ -51,7 +53,7 @@ const HiddenCloseButton = styled.button`
...
@@ -51,7 +53,7 @@ const HiddenCloseButton = styled.button`
export
default
function
Modal
({
isOpen
,
onDismiss
,
minHeight
=
false
,
initialFocusRef
,
children
})
{
export
default
function
Modal
({
isOpen
,
onDismiss
,
minHeight
=
false
,
initialFocusRef
,
children
})
{
const
transitions
=
useTransition
(
isOpen
,
null
,
{
const
transitions
=
useTransition
(
isOpen
,
null
,
{
config
:
{
duration
:
1
25
},
config
:
{
duration
:
1
50
},
from
:
{
opacity
:
0
},
from
:
{
opacity
:
0
},
enter
:
{
opacity
:
1
},
enter
:
{
opacity
:
1
},
leave
:
{
opacity
:
0
}
leave
:
{
opacity
:
0
}
...
...
src/components/NavigationTabs/index.js
View file @
80da6e0f
...
@@ -60,7 +60,7 @@ const Tabs = styled.div`
...
@@ -60,7 +60,7 @@ const Tabs = styled.div`
height: 2.5rem;
height: 2.5rem;
background-color:
${({
theme
})
=>
theme
.
concreteGray
}
;
background-color:
${({
theme
})
=>
theme
.
concreteGray
}
;
border-radius: 3rem;
border-radius: 3rem;
box-shadow: 0 0 0 1px
${({
theme
})
=>
darken
(
0.05
,
theme
.
concreteGray
)}
;
/* border: 1px solid
${({
theme
})
=>
theme
.
mercuryGray
}
; */
margin-bottom: 1rem;
margin-bottom: 1rem;
`
`
...
@@ -73,6 +73,7 @@ const StyledNavLink = styled(NavLink).attrs({
...
@@ -73,6 +73,7 @@ const StyledNavLink = styled(NavLink).attrs({
align-items: center;
align-items: center;
justify-content: center;
justify-content: center;
height: 2.5rem;
height: 2.5rem;
border: 1px solid
${({
theme
})
=>
transparentize
(
1
,
theme
.
mercuryGray
)}
;
flex: 1 0 auto;
flex: 1 0 auto;
border-radius: 3rem;
border-radius: 3rem;
outline: none;
outline: none;
...
@@ -80,21 +81,24 @@ const StyledNavLink = styled(NavLink).attrs({
...
@@ -80,21 +81,24 @@ const StyledNavLink = styled(NavLink).attrs({
text-decoration: none;
text-decoration: none;
color:
${({
theme
})
=>
theme
.
doveGray
}
;
color:
${({
theme
})
=>
theme
.
doveGray
}
;
font-size: 1rem;
font-size: 1rem;
box-sizing: border-box;
&.
${
activeClassName
}
{
&.
${
activeClassName
}
{
background-color:
${({
theme
})
=>
theme
.
white
}
;
background-color:
${({
theme
})
=>
theme
.
inputBackground
}
;
border-radius: 3rem;
border-radius: 3rem;
box-shadow: 0 0 1px 1px
${({
theme
})
=>
theme
.
mercuryGray
}
;
border: 1px solid
${({
theme
})
=>
theme
.
mercuryGray
}
;
box-shadow: 0 4px 8px 0
${({
theme
})
=>
transparentize
(
0.95
,
theme
.
royalBlue
)}
;
box-sizing: border-box;
font-weight: 500;
font-weight: 500;
color:
${({
theme
})
=>
theme
.
royalBlue
}
;
color:
${({
theme
})
=>
theme
.
royalBlue
}
;
:hover {
:hover {
box-shadow: 0 0 1px 1px
${({
theme
})
=>
darken
(
0.1
,
theme
.
mercuryGray
)}
;
border: 1px solid
${({
theme
})
=>
darken
(
0.1
,
theme
.
mercuryGray
)}
;
background-color:
${({
theme
})
=>
darken
(
0.01
,
theme
.
inputBackground
)}
;
}
}
}
}
:hover,
:hover,
:focus {
:focus {
font-weight: 500;
color:
${({
theme
})
=>
darken
(
0.1
,
theme
.
royalBlue
)}
;
color:
${({
theme
})
=>
darken
(
0.1
,
theme
.
royalBlue
)}
;
}
}
`
`
...
...
src/components/TransactionDetails/index.js
View file @
80da6e0f
...
@@ -86,12 +86,12 @@ const Popup = styled(Flex)`
...
@@ -86,12 +86,12 @@ const Popup = styled(Flex)`
align-items: center;
align-items: center;
padding: 0.6rem 1rem;
padding: 0.6rem 1rem;
line-height: 150%;
line-height: 150%;
background:
${({
theme
})
=>
theme
.
charcoalBlack
}
;
background:
${({
theme
})
=>
theme
.
inputBackground
}
;
border-radius: 8px;
border-radius: 8px;
animation:
${
fadeIn
}
0.15s linear;
animation:
${
fadeIn
}
0.15s linear;
color:
white
;
color:
${({
theme
})
=>
theme
.
textColor
}
;
font-style: italic;
font-style: italic;
${({
theme
})
=>
theme
.
mediaWidth
.
upToSmall
`
${({
theme
})
=>
theme
.
mediaWidth
.
upToSmall
`
...
@@ -100,6 +100,7 @@ const Popup = styled(Flex)`
...
@@ -100,6 +100,7 @@ const Popup = styled(Flex)`
`
`
const
FancyButton
=
styled
.
button
`
const
FancyButton
=
styled
.
button
`
color:
${({
theme
})
=>
theme
.
textColor
}
;
align-items: center;
align-items: center;
min-width: 55px;
min-width: 55px;
height: 2rem;
height: 2rem;
...
@@ -107,7 +108,7 @@ const FancyButton = styled.button`
...
@@ -107,7 +108,7 @@ const FancyButton = styled.button`
font-size: 12px;
font-size: 12px;
border: 1px solid
${({
theme
})
=>
theme
.
mercuryGray
}
;
border: 1px solid
${({
theme
})
=>
theme
.
mercuryGray
}
;
outline: none;
outline: none;
background:
${({
theme
})
=>
theme
.
white
}
;
background:
${({
theme
})
=>
theme
.
inputBackground
}
;
:hover {
:hover {
cursor: inherit;
cursor: inherit;
...
@@ -115,7 +116,6 @@ const FancyButton = styled.button`
...
@@ -115,7 +116,6 @@ const FancyButton = styled.button`
}
}
:focus {
:focus {
border: 1px solid
${({
theme
})
=>
theme
.
royalBlue
}
;
border: 1px solid
${({
theme
})
=>
theme
.
royalBlue
}
;
/* box-shadow: 0 0 1px 1px #5CA2FF; */
}
}
`
`
...
@@ -164,8 +164,9 @@ const OptionLarge = styled(Option)`
...
@@ -164,8 +164,9 @@ const OptionLarge = styled(Option)`
`
`
const
Input
=
styled
.
input
`
const
Input
=
styled
.
input
`
background:
${({
theme
})
=>
theme
.
white
}
;
background:
${({
theme
})
=>
theme
.
inputBackground
}
;
flex-grow: 1;
flex-grow: 1;
font-size: 12px;
outline: none;
outline: none;
box-sizing: border-box;
box-sizing: border-box;
...
@@ -191,6 +192,7 @@ const Input = styled.input`
...
@@ -191,6 +192,7 @@ const Input = styled.input`
placeholder
!==
'
Custom
'
&&
placeholder
!==
'
Custom
'
&&
css
`
css
`
text-align: right;
text-align: right;
color:
${({
theme
})
=>
theme
.
textColor
}
;
`
}
`
}
${({
color
})
=>
${({
color
})
=>
...
@@ -479,7 +481,7 @@ export default function TransactionDetails(props) {
...
@@ -479,7 +481,7 @@ export default function TransactionDetails(props) {
:
''
:
''
}
}
>
>
{
activeIndex
===
4
&&
warningType
.
toString
()
===
'
none
'
&&
'
Custom slippage value
entered
'
}
{
activeIndex
===
4
&&
warningType
.
toString
()
===
'
none
'
&&
'
Custom slippage value
'
}
{
warningType
===
WARNING_TYPE
.
emptyInput
&&
'
Enter a slippage percentage
'
}
{
warningType
===
WARNING_TYPE
.
emptyInput
&&
'
Enter a slippage percentage
'
}
{
warningType
===
WARNING_TYPE
.
invalidEntryBound
&&
'
Please select a value no greater than 50%
'
}
{
warningType
===
WARNING_TYPE
.
invalidEntryBound
&&
'
Please select a value no greater than 50%
'
}
{
warningType
===
WARNING_TYPE
.
riskyEntryHigh
&&
'
Your transaction may be frontrun
'
}
{
warningType
===
WARNING_TYPE
.
riskyEntryHigh
&&
'
Your transaction may be frontrun
'
}
...
@@ -617,7 +619,6 @@ export default function TransactionDetails(props) {
...
@@ -617,7 +619,6 @@ export default function TransactionDetails(props) {
)}
${
props
.
outputSymbol
}
`
)}
${
props
.
outputSymbol
}
`
)}
)}
<
/ValueWrapper
>
<
/ValueWrapper
>
.
<
/div
>
<
/div
>
<
LastSummaryText
>
<
LastSummaryText
>
{
t
(
'
priceChange
'
)}
<
ValueWrapper
>
{
b
(
`
${
props
.
percentSlippageFormatted
}
%`
)}
<
/ValueWrapper>
.
{
t
(
'
priceChange
'
)}
<
ValueWrapper
>
{
b
(
`
${
props
.
percentSlippageFormatted
}
%`
)}
<
/ValueWrapper>
.
...
@@ -638,7 +639,7 @@ export default function TransactionDetails(props) {
...
@@ -638,7 +639,7 @@ export default function TransactionDetails(props) {
)}
${
props
.
outputSymbol
}
`
)}
${
props
.
outputSymbol
}
`
)}
)}
<
/ValueWrapper>{' '
}
<
/ValueWrapper>{' '
}
{
t
(
'
to
'
)}
{
b
(
props
.
recipientAddress
)}
.
{
t
(
'
to
'
)}
{
b
(
props
.
recipientAddress
)}
<
/div
>
<
/div
>
<
LastSummaryText
>
<
LastSummaryText
>
{
t
(
'
itWillCost
'
)}{
'
'
}
{
t
(
'
itWillCost
'
)}{
'
'
}
...
@@ -669,7 +670,6 @@ export default function TransactionDetails(props) {
...
@@ -669,7 +670,6 @@ export default function TransactionDetails(props) {
)}
${
props
.
outputSymbol
}
`
)}
${
props
.
outputSymbol
}
`
)}
)}
<
/ValueWrapper
>
<
/ValueWrapper
>
.
<
/div
>
<
/div
>
<
LastSummaryText
>
<
LastSummaryText
>
{
t
(
'
itWillCost
'
)}{
'
'
}
{
t
(
'
itWillCost
'
)}{
'
'
}
...
...
src/components/Web3Status/index.js
View file @
80da6e0f
...
@@ -32,8 +32,8 @@ const Web3StatusGeneric = styled.button`
...
@@ -32,8 +32,8 @@ const Web3StatusGeneric = styled.button`
`
`
const
Web3StatusError
=
styled
(
Web3StatusGeneric
)
`
const
Web3StatusError
=
styled
(
Web3StatusGeneric
)
`
background-color:
${({
theme
})
=>
theme
.
salmonRed
}
;
background-color:
${({
theme
})
=>
theme
.
salmonRed
}
;
color:
${({
theme
})
=>
theme
.
white
}
;
border: 1px solid
${({
theme
})
=>
theme
.
salmonRed
}
;
border: 1px solid
${({
theme
})
=>
theme
.
salmonRed
}
;
color:
${({
theme
})
=>
theme
.
white
}
;
font-weight: 500;
font-weight: 500;
:hover,
:hover,
:focus {
:focus {
...
@@ -43,9 +43,10 @@ const Web3StatusError = styled(Web3StatusGeneric)`
...
@@ -43,9 +43,10 @@ const Web3StatusError = styled(Web3StatusGeneric)`
const
Web3StatusConnect
=
styled
(
Web3StatusGeneric
)
`
const
Web3StatusConnect
=
styled
(
Web3StatusGeneric
)
`
background-color:
${({
theme
})
=>
theme
.
royalBlue
}
;
background-color:
${({
theme
})
=>
theme
.
royalBlue
}
;
color:
${({
theme
})
=>
theme
.
white
}
;
border: 1px solid
${({
theme
})
=>
theme
.
royalBlue
}
;
border: 1px solid
${({
theme
})
=>
theme
.
royalBlue
}
;
color:
${({
theme
})
=>
theme
.
white
}
;
font-weight: 500;
font-weight: 500;
:hover,
:hover,
:focus {
:focus {
background-color:
${({
theme
})
=>
darken
(
0.1
,
theme
.
royalBlue
)}
;
background-color:
${({
theme
})
=>
darken
(
0.1
,
theme
.
royalBlue
)}
;
...
@@ -53,9 +54,9 @@ const Web3StatusConnect = styled(Web3StatusGeneric)`
...
@@ -53,9 +54,9 @@ const Web3StatusConnect = styled(Web3StatusGeneric)`
`
`
const
Web3StatusConnected
=
styled
(
Web3StatusGeneric
)
`
const
Web3StatusConnected
=
styled
(
Web3StatusGeneric
)
`
background-color:
${({
pending
,
theme
})
=>
(
pending
?
theme
.
zumthorBlue
:
theme
.
white
)}
;
background-color:
${({
pending
,
theme
})
=>
(
pending
?
theme
.
zumthorBlue
:
theme
.
inputBackground
)}
;
color:
${({
pending
,
theme
})
=>
(
pending
?
theme
.
royalBlue
:
theme
.
doveGray
)}
;
border: 1px solid
${({
pending
,
theme
})
=>
(
pending
?
theme
.
royalBlue
:
theme
.
mercuryGray
)}
;
border: 1px solid
${({
pending
,
theme
})
=>
(
pending
?
theme
.
royalBlue
:
theme
.
mercuryGray
)}
;
color:
${({
pending
,
theme
})
=>
(
pending
?
theme
.
royalBlue
:
theme
.
doveGray
)}
;
font-weight: 400;
font-weight: 400;
:hover {
:hover {
background-color:
${({
pending
,
theme
})
=>
background-color:
${({
pending
,
theme
})
=>
...
@@ -72,7 +73,6 @@ const Text = styled.p`
...
@@ -72,7 +73,6 @@ const Text = styled.p`
overflow: hidden;
overflow: hidden;
text-overflow: ellipsis;
text-overflow: ellipsis;
white-space: nowrap;
white-space: nowrap;
margin: 0 0.5rem 0 0.25rem;
margin: 0 0.5rem 0 0.25rem;
font-size: 0.83rem;
font-size: 0.83rem;
`
`
...
...
src/contexts/LocalStorage.js
View file @
80da6e0f
...
@@ -7,7 +7,8 @@ const CURRENT_VERSION = 0
...
@@ -7,7 +7,8 @@ const CURRENT_VERSION = 0
const
LAST_SAVED
=
'
LAST_SAVED
'
const
LAST_SAVED
=
'
LAST_SAVED
'
const
BETA_MESSAGE_DISMISSED
=
'
BETA_MESSAGE_DISMISSED
'
const
BETA_MESSAGE_DISMISSED
=
'
BETA_MESSAGE_DISMISSED
'
const
UPDATABLE_KEYS
=
[
BETA_MESSAGE_DISMISSED
]
const
DARK_MODE
=
'
DARK_MODE
'
const
UPDATABLE_KEYS
=
[
BETA_MESSAGE_DISMISSED
,
DARK_MODE
]
const
UPDATE_KEY
=
'
UPDATE_KEY
'
const
UPDATE_KEY
=
'
UPDATE_KEY
'
...
@@ -39,7 +40,8 @@ function reducer(state, { type, payload }) {
...
@@ -39,7 +40,8 @@ function reducer(state, { type, payload }) {
function
init
()
{
function
init
()
{
const
defaultLocalStorage
=
{
const
defaultLocalStorage
=
{
[
VERSION
]:
CURRENT_VERSION
,
[
VERSION
]:
CURRENT_VERSION
,
[
BETA_MESSAGE_DISMISSED
]:
false
[
BETA_MESSAGE_DISMISSED
]:
false
,
[
DARK_MODE
]:
false
}
}
try
{
try
{
...
@@ -48,7 +50,7 @@ function init() {
...
@@ -48,7 +50,7 @@ function init() {
// this is where we could run migration logic
// this is where we could run migration logic
return
defaultLocalStorage
return
defaultLocalStorage
}
else
{
}
else
{
return
parsed
return
{
...
defaultLocalStorage
,
...
parsed
}
}
}
}
catch
{
}
catch
{
return
defaultLocalStorage
return
defaultLocalStorage
...
@@ -88,3 +90,15 @@ export function useBetaMessageManager() {
...
@@ -88,3 +90,15 @@ export function useBetaMessageManager() {
return
[
!
state
[
BETA_MESSAGE_DISMISSED
],
dismissBetaMessage
]
return
[
!
state
[
BETA_MESSAGE_DISMISSED
],
dismissBetaMessage
]
}
}
export
function
useDarkModeManager
()
{
const
[
state
,
{
updateKey
}]
=
useLocalStorageContext
()
const
isDarkMode
=
state
[
DARK_MODE
]
const
toggleDarkMode
=
useCallback
(()
=>
{
updateKey
(
DARK_MODE
,
!
isDarkMode
)
},
[
updateKey
,
isDarkMode
])
return
[
state
[
DARK_MODE
],
toggleDarkMode
]
}
src/index.js
View file @
80da6e0f
...
@@ -55,16 +55,16 @@ function Updaters() {
...
@@ -55,16 +55,16 @@ function Updaters() {
}
}
ReactDOM
.
render
(
ReactDOM
.
render
(
<
ThemeProvider
>
<
Web3Provider
connectors
=
{
connectors
}
libraryName
=
"
ethers.js
"
>
<>
<
ContextProviders
>
<
GlobalStyle
/>
<
Updaters
/>
<
Web3Provider
connectors
=
{
connectors
}
libraryName
=
"
ethers.js
"
>
<
ThemeProvider
>
<
ContextProviders
>
<>
<
Updaters
/>
<
GlobalStyle
/>
<
App
/>
<
App
/>
<
/
ContextProviders
>
<
/
>
<
/
Web3
Provider
>
<
/
Theme
Provider
>
<
/
>
<
/
ContextProviders
>
<
/
Theme
Provider>
,
<
/
Web3
Provider>
,
document
.
getElementById
(
'
root
'
)
document
.
getElementById
(
'
root
'
)
)
)
src/pages/Pool/AddLiquidity.js
View file @
80da6e0f
...
@@ -9,8 +9,8 @@ import { Button } from '../../theme'
...
@@ -9,8 +9,8 @@ import { Button } from '../../theme'
import
CurrencyInputPanel
from
'
../../components/CurrencyInputPanel
'
import
CurrencyInputPanel
from
'
../../components/CurrencyInputPanel
'
import
OversizedPanel
from
'
../../components/OversizedPanel
'
import
OversizedPanel
from
'
../../components/OversizedPanel
'
import
ContextualInfo
from
'
../../components/ContextualInfo
'
import
ContextualInfo
from
'
../../components/ContextualInfo
'
import
PlusBlue
from
'
../../assets/images/plus-blue.svg
'
import
{
ReactComponent
as
Plus
}
from
'
../../assets/images/plus-blue.svg
'
import
PlusGrey
from
'
../../assets/images/plus-grey.svg
'
import
{
useExchangeContract
}
from
'
../../hooks
'
import
{
useExchangeContract
}
from
'
../../hooks
'
import
{
amountFormatter
,
calculateGasMargin
}
from
'
../../utils
'
import
{
amountFormatter
,
calculateGasMargin
}
from
'
../../utils
'
import
{
useTransactionAdder
}
from
'
../../contexts/Transactions
'
import
{
useTransactionAdder
}
from
'
../../contexts/Transactions
'
...
@@ -63,14 +63,6 @@ const DownArrowBackground = styled.div`
...
@@ -63,14 +63,6 @@ const DownArrowBackground = styled.div`
justify-content: center;
justify-content: center;
align-items: center;
align-items: center;
`
`
const
DownArrow
=
styled
.
img
`
width: 0.625rem;
height: 0.625rem;
position: relative;
padding: 0.875rem;
`
const
SummaryPanel
=
styled
.
div
`
const
SummaryPanel
=
styled
.
div
`
${({
theme
})
=>
theme
.
flexColumnNoWrap
}
${({
theme
})
=>
theme
.
flexColumnNoWrap
}
padding: 1rem 0;
padding: 1rem 0;
...
@@ -87,7 +79,7 @@ const ExchangeRateWrapper = styled.div`
...
@@ -87,7 +79,7 @@ const ExchangeRateWrapper = styled.div`
const
ExchangeRate
=
styled
.
span
`
const
ExchangeRate
=
styled
.
span
`
flex: 1 1 auto;
flex: 1 1 auto;
width: 0;
width: 0;
color:
${({
theme
})
=>
theme
.
chalic
eGray
}
;
color:
${({
theme
})
=>
theme
.
dov
eGray
}
;
`
`
const
Flex
=
styled
.
div
`
const
Flex
=
styled
.
div
`
...
@@ -100,6 +92,17 @@ const Flex = styled.div`
...
@@ -100,6 +92,17 @@ const Flex = styled.div`
}
}
`
`
const
WrappedPlus
=
({
isError
,
highSlippageWarning
,
...
rest
})
=>
<
Plus
{...
rest
}
/
>
const
ColoredWrappedPlus
=
styled
(
WrappedPlus
)
`
width: 0.625rem;
height: 0.625rem;
position: relative;
padding: 0.875rem;
path {
stroke:
${({
active
,
theme
})
=>
(
active
?
theme
.
royalBlue
:
theme
.
chaliceGray
)}
;
}
`
function
calculateSlippageBounds
(
value
)
{
function
calculateSlippageBounds
(
value
)
{
if
(
value
)
{
if
(
value
)
{
const
offset
=
value
.
mul
(
ALLOWED_SLIPPAGE
).
div
(
ethers
.
utils
.
bigNumberify
(
10000
))
const
offset
=
value
.
mul
(
ALLOWED_SLIPPAGE
).
div
(
ethers
.
utils
.
bigNumberify
(
10000
))
...
@@ -558,7 +561,7 @@ export default function AddLiquidity() {
...
@@ -558,7 +561,7 @@ export default function AddLiquidity() {
/>
/>
<
OversizedPanel
>
<
OversizedPanel
>
<
DownArrowBackground
>
<
DownArrowBackground
>
<
DownArrow
src
=
{
isActive
?
PlusBlue
:
PlusGrey
}
alt
=
"
plus
"
/>
<
ColoredWrappedPlus
active
=
{
isActive
}
alt
=
"
plus
"
/>
<
/DownArrowBackground
>
<
/DownArrowBackground
>
<
/OversizedPanel
>
<
/OversizedPanel
>
<
CurrencyInputPanel
<
CurrencyInputPanel
...
...
src/pages/Pool/CreateExchange.js
View file @
80da6e0f
...
@@ -29,7 +29,7 @@ const ExchangeRateWrapper = styled.div`
...
@@ -29,7 +29,7 @@ const ExchangeRateWrapper = styled.div`
const
ExchangeRate
=
styled
.
span
`
const
ExchangeRate
=
styled
.
span
`
flex: 1 1 auto;
flex: 1 1 auto;
width: 0;
width: 0;
color:
${({
theme
})
=>
theme
.
chalic
eGray
}
;
color:
${({
theme
})
=>
theme
.
dov
eGray
}
;
`
`
const
CreateExchangeWrapper
=
styled
.
div
`
const
CreateExchangeWrapper
=
styled
.
div
`
...
...
src/pages/Pool/ModeSelector.js
View file @
80da6e0f
...
@@ -4,10 +4,13 @@ import { useTranslation } from 'react-i18next'
...
@@ -4,10 +4,13 @@ import { useTranslation } from 'react-i18next'
import
styled
from
'
styled-components
'
import
styled
from
'
styled-components
'
import
OversizedPanel
from
'
../../components/OversizedPanel
'
import
OversizedPanel
from
'
../../components/OversizedPanel
'
import
Dropdown
from
'
../../assets/images/dropdown-blue.svg
'
import
{
ReactComponent
as
Dropdown
}
from
'
../../assets/images/dropdown-blue.svg
'
import
Modal
from
'
../../components/Modal
'
import
Modal
from
'
../../components/Modal
'
import
{
useBodyKeyDown
}
from
'
../../hooks
'
import
{
useBodyKeyDown
}
from
'
../../hooks
'
import
{
lighten
}
from
'
polished
'
const
poolTabOrder
=
[
const
poolTabOrder
=
[
{
{
path
:
'
/add-liquidity
'
,
path
:
'
/add-liquidity
'
,
...
@@ -29,13 +32,16 @@ const poolTabOrder = [
...
@@ -29,13 +32,16 @@ const poolTabOrder = [
const
LiquidityContainer
=
styled
.
div
`
const
LiquidityContainer
=
styled
.
div
`
${({
theme
})
=>
theme
.
flexRowNoWrap
}
;
${({
theme
})
=>
theme
.
flexRowNoWrap
}
;
align-items: center;
align-items: center;
font-size: 0.75rem;
padding: 1rem 1rem;
padding: 0.625rem 1rem;
font-size: 1rem;
font-size: 0.75rem;
color:
${({
theme
})
=>
theme
.
royalBlue
}
;
color:
${({
theme
})
=>
theme
.
royalBlue
}
;
font-weight: 500;
font-weight: 500;
cursor: pointer;
cursor: pointer;
:hover {
color:
${({
theme
})
=>
lighten
(
0.1
,
theme
.
royalBlue
)}
;
}
img {
img {
height: 0.75rem;
height: 0.75rem;
width: 0.75rem;
width: 0.75rem;
...
@@ -62,21 +68,28 @@ const StyledNavLink = styled(NavLink).attrs({
...
@@ -62,21 +68,28 @@ const StyledNavLink = styled(NavLink).attrs({
font-size: 1rem;
font-size: 1rem;
&.
${
activeClassName
}
{
&.
${
activeClassName
}
{
background-color:
${({
theme
})
=>
theme
.
white
}
;
background-color:
${({
theme
})
=>
theme
.
inputBackground
}
;
border-radius: 3rem;
border-radius: 3rem;
bo
x-shadow: 0 0 1px 1px
${({
theme
})
=>
theme
.
mercuryGray
}
;
bo
rder: 1px solid
${({
theme
})
=>
theme
.
mercuryGray
}
;
font-weight: 500;
font-weight: 500;
color:
${({
theme
})
=>
theme
.
royalBlue
}
;
color:
${({
theme
})
=>
theme
.
royalBlue
}
;
}
}
`
`
const
PoolModal
=
styled
.
div
`
const
PoolModal
=
styled
.
div
`
background-color:
${({
theme
})
=>
theme
.
white
}
;
background-color:
${({
theme
})
=>
theme
.
inputBackground
}
;
width: 100%;
width: 100%;
height: 100%;
height: 100%;
padding: 2rem 0 2rem 0;
padding: 2rem 0 2rem 0;
`
`
const
WrappedDropdown
=
({
isError
,
highSlippageWarning
,
...
rest
})
=>
<
Dropdown
{...
rest
}
/
>
const
ColoredDropdown
=
styled
(
WrappedDropdown
)
`
path {
stroke:
${({
theme
})
=>
theme
.
royalBlue
}
;
}
`
function
ModeSelector
({
location
:
{
pathname
},
history
})
{
function
ModeSelector
({
location
:
{
pathname
},
history
})
{
const
{
t
}
=
useTranslation
()
const
{
t
}
=
useTranslation
()
...
@@ -109,7 +122,7 @@ function ModeSelector({ location: { pathname }, history }) {
...
@@ -109,7 +122,7 @@ function ModeSelector({ location: { pathname }, history }) {
}}
}}
>
>
<
LiquidityLabel
>
{
t
(
activeTabKey
)}
<
/LiquidityLabel
>
<
LiquidityLabel
>
{
t
(
activeTabKey
)}
<
/LiquidityLabel
>
<
img
src
=
{
Dropdown
}
alt
=
"
drop
down
"
/>
<
ColoredDropdown
alt
=
"
arrow
down
"
/>
<
/LiquidityContainer
>
<
/LiquidityContainer
>
<
Modal
<
Modal
isOpen
=
{
modalIsOpen
}
isOpen
=
{
modalIsOpen
}
...
...
src/pages/Pool/RemoveLiquidity.js
View file @
80da6e0f
...
@@ -9,8 +9,8 @@ import { Button } from '../../theme'
...
@@ -9,8 +9,8 @@ import { Button } from '../../theme'
import
CurrencyInputPanel
from
'
../../components/CurrencyInputPanel
'
import
CurrencyInputPanel
from
'
../../components/CurrencyInputPanel
'
import
ContextualInfo
from
'
../../components/ContextualInfo
'
import
ContextualInfo
from
'
../../components/ContextualInfo
'
import
OversizedPanel
from
'
../../components/OversizedPanel
'
import
OversizedPanel
from
'
../../components/OversizedPanel
'
import
ArrowDown
Blue
from
'
../../assets/images/arrow-down-blue.svg
'
import
ArrowDown
from
'
../../assets/svg/SVGArrowDown
'
import
ArrowDownGrey
from
'
../../assets/images/arrow-down-grey.svg
'
import
{
useExchangeContract
}
from
'
../../hooks
'
import
{
useExchangeContract
}
from
'
../../hooks
'
import
{
useTransactionAdder
}
from
'
../../contexts/Transactions
'
import
{
useTransactionAdder
}
from
'
../../contexts/Transactions
'
import
{
useTokenDetails
}
from
'
../../contexts/Tokens
'
import
{
useTokenDetails
}
from
'
../../contexts/Tokens
'
...
@@ -36,7 +36,9 @@ const DownArrowBackground = styled.div`
...
@@ -36,7 +36,9 @@ const DownArrowBackground = styled.div`
align-items: center;
align-items: center;
`
`
const
DownArrow
=
styled
.
img
`
const
DownArrow
=
styled
(
ArrowDown
)
`
${({
theme
})
=>
theme
.
flexRowNoWrap
}
color:
${({
theme
,
active
})
=>
(
active
?
theme
.
royalBlue
:
theme
.
doveGray
)}
;
width: 0.625rem;
width: 0.625rem;
height: 0.625rem;
height: 0.625rem;
position: relative;
position: relative;
...
@@ -80,7 +82,7 @@ const ExchangeRateWrapper = styled.div`
...
@@ -80,7 +82,7 @@ const ExchangeRateWrapper = styled.div`
const
ExchangeRate
=
styled
.
span
`
const
ExchangeRate
=
styled
.
span
`
flex: 1 1 auto;
flex: 1 1 auto;
width: 0;
width: 0;
color:
${({
theme
})
=>
theme
.
chalic
eGray
}
;
color:
${({
theme
})
=>
theme
.
dov
eGray
}
;
`
`
const
Flex
=
styled
.
div
`
const
Flex
=
styled
.
div
`
...
@@ -347,7 +349,7 @@ export default function RemoveLiquidity() {
...
@@ -347,7 +349,7 @@ export default function RemoveLiquidity() {
/
>
/
>
<
OversizedPanel
>
<
OversizedPanel
>
<
DownArrowBackground
>
<
DownArrowBackground
>
<
DownArrow
src
=
{
isActive
?
ArrowDownBlue
:
ArrowDownGrey
}
alt
=
"
arrow
"
/>
<
DownArrow
active
=
{
isActive
}
alt
=
"
arrow
"
/>
<
/DownArrowBackground
>
<
/DownArrowBackground
>
<
/OversizedPanel
>
<
/OversizedPanel
>
<
CurrencyInputPanel
<
CurrencyInputPanel
...
...
src/theme/components.js
View file @
80da6e0f
...
@@ -12,8 +12,8 @@ export const Button = styled.button.attrs(({ warning, theme }) => ({
...
@@ -12,8 +12,8 @@ export const Button = styled.button.attrs(({ warning, theme }) => ({
border: none;
border: none;
outline: none;
outline: none;
background-color:
${({
backgroundColor
})
=>
backgroundColor
}
;
background-color:
${({
backgroundColor
})
=>
backgroundColor
}
;
transition: background-color 150ms ease-out;
color:
${({
theme
})
=>
theme
.
white
}
;
color:
${({
theme
})
=>
theme
.
white
}
;
transition: background-color 125ms ease-in-out;
width: 100%;
width: 100%;
:hover,
:hover,
...
@@ -26,7 +26,8 @@ export const Button = styled.button.attrs(({ warning, theme }) => ({
...
@@ -26,7 +26,8 @@ export const Button = styled.button.attrs(({ warning, theme }) => ({
}
}
:disabled {
:disabled {
background-color:
${({
theme
})
=>
theme
.
mercuryGray
}
;
background-color:
${({
theme
})
=>
theme
.
concreteGray
}
;
color:
${({
theme
})
=>
theme
.
silverGray
}
;
cursor: auto;
cursor: auto;
}
}
`
`
...
@@ -50,12 +51,13 @@ export const Link = styled.a.attrs({
...
@@ -50,12 +51,13 @@ export const Link = styled.a.attrs({
`
`
export
const
BorderlessInput
=
styled
.
input
`
export
const
BorderlessInput
=
styled
.
input
`
color:
${({
theme
})
=>
theme
.
mineshaftGray
}
;
color:
${({
theme
})
=>
theme
.
textColor
}
;
font-size: 1rem;
font-size: 1rem;
outline: none;
outline: none;
border: none;
border: none;
flex: 1 1 auto;
flex: 1 1 auto;
width: 0;
width: 0;
background-color:
${({
theme
})
=>
theme
.
inputBackground
}
;
[type='number'] {
[type='number'] {
-moz-appearance: textfield;
-moz-appearance: textfield;
...
@@ -67,7 +69,7 @@ export const BorderlessInput = styled.input`
...
@@ -67,7 +69,7 @@ export const BorderlessInput = styled.input`
}
}
::placeholder {
::placeholder {
color:
${({
theme
})
=>
theme
.
mercury
Gray
}
;
color:
${({
theme
})
=>
theme
.
placeholder
Gray
}
;
}
}
`
`
...
...
src/theme/index.js
View file @
80da6e0f
import
React
from
'
react
'
import
React
from
'
react
'
import
{
ThemeProvider
as
StyledComponentsThemeProvider
,
createGlobalStyle
,
css
}
from
'
styled-components
'
import
{
ThemeProvider
as
StyledComponentsThemeProvider
,
createGlobalStyle
,
css
}
from
'
styled-components
'
import
{
useDarkModeManager
}
from
'
../contexts/LocalStorage
'
export
*
from
'
./components
'
export
*
from
'
./components
'
...
@@ -28,23 +29,34 @@ const flexRowNoWrap = css`
...
@@ -28,23 +29,34 @@ const flexRowNoWrap = css`
flex-flow: row nowrap;
flex-flow: row nowrap;
`
`
const
theme
=
{
const
white
=
'
#FFFFFF
'
white
:
'
#FFFFFF
'
,
const
black
=
'
#000000
'
black
:
'
#000000
'
,
const
theme
=
darkMode
=>
({
white
,
black
,
textColor
:
darkMode
?
white
:
'
#010101
'
,
// for setting css on <html>
backgroundColor
:
darkMode
?
'
#333639
'
:
white
,
inputBackground
:
darkMode
?
'
#202124
'
:
white
,
placeholderGray
:
darkMode
?
'
#5F5F5F
'
:
'
#E1E1E1
'
,
// grays
// grays
concreteGray
:
'
#FAFAFA
'
,
concreteGray
:
darkMode
?
'
#292C2F
'
:
'
#FAFAFA
'
,
mercuryGray
:
'
#E1E1E1
'
,
mercuryGray
:
darkMode
?
'
#333333
'
:
'
#E1E1E1
'
,
silverGray
:
'
#C4C4C4
'
,
silverGray
:
darkMode
?
'
#737373
'
:
'
#C4C4C4
'
,
chaliceGray
:
'
#AEAEAE
'
,
chaliceGray
:
darkMode
?
'
#7B7B7B
'
:
'
#AEAEAE
'
,
doveGray
:
'
#737373
'
,
doveGray
:
darkMode
?
'
#C4C4C4
'
:
'
#737373
'
,
mineshaftGray
:
'
#2B2B2B
'
,
mineshaftGray
:
darkMode
?
'
#E1E1E1
'
:
'
#2B2B2B
'
,
buttonOutlineGrey
:
'
#f2f2f
2
'
,
buttonOutlineGrey
:
darkMode
?
'
#FAFAFA
'
:
'
#F2F2F
2
'
,
//blacks
//blacks
charcoalBlack
:
'
#404040
'
,
charcoalBlack
:
darkMode
?
'
#F2F2F2
'
:
'
#404040
'
,
// blues
// blues
zumthorBlue
:
'
#EBF4FF
'
,
zumthorBlue
:
darkMode
?
'
#212529
'
:
'
#EBF4FF
'
,
malibuBlue
:
'
#5CA2FF
'
,
malibuBlue
:
darkMode
?
'
#E67AEF
'
:
'
#5CA2FF
'
,
royalBlue
:
'
#2F80ED
'
,
royalBlue
:
darkMode
?
'
#DC6BE5
'
:
'
#2F80ED
'
,
// purples
// purples
wisteriaPurple
:
'
#DC6BE5
'
,
wisteriaPurple
:
'
#DC6BE5
'
,
// reds
// reds
...
@@ -62,10 +74,12 @@ const theme = {
...
@@ -62,10 +74,12 @@ const theme = {
// css snippets
// css snippets
flexColumnNoWrap
,
flexColumnNoWrap
,
flexRowNoWrap
flexRowNoWrap
}
}
)
export
default
function
ThemeProvider
({
children
})
{
export
default
function
ThemeProvider
({
children
})
{
return
<
StyledComponentsThemeProvider
theme
=
{
theme
}
>
{
children
}
<
/StyledComponentsThemeProvider
>
const
[
darkMode
]
=
useDarkModeManager
()
return
<
StyledComponentsThemeProvider
theme
=
{
theme
(
darkMode
)}
>
{
children
}
<
/StyledComponentsThemeProvider
>
}
}
export
const
GlobalStyle
=
createGlobalStyle
`
export
const
GlobalStyle
=
createGlobalStyle
`
...
@@ -79,20 +93,16 @@ export const GlobalStyle = createGlobalStyle`
...
@@ -79,20 +93,16 @@ export const GlobalStyle = createGlobalStyle`
body {
body {
margin: 0;
margin: 0;
padding: 0;
padding: 0;
}
html {
font-size: 16px;
font-size: 16px;
font-variant: none;
font-variant: none;
color:
${({
theme
})
=>
theme
.
textColor
}
;
background-color:
${({
theme
})
=>
theme
.
backgroundColor
}
;
transition: color 150ms ease-out, background-color 150ms ease-out;
-webkit-font-smoothing: antialiased;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-moz-osx-font-smoothing: grayscale;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
}
#root {
${({
theme
})
=>
theme
.
flexColumnNoWrap
}
justify-content: center;
align-items: center;
width: 100vw;
height: 100vh;
overflow-x: hidden;
overflow-y: auto;
}
`
`
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