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
66604cf4
Commit
66604cf4
authored
Jul 29, 2019
by
Callil Capuozzo
Committed by
Noah Zinsmeister
Jul 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add focus styles (#375)
* Add focus styles * remove periods * Change copy and button hover state
parent
30887ef1
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
94 additions
and
46 deletions
+94
-46
en.json
public/locales/en.json
+2
-2
index.js
src/components/ContextualInfo/index.js
+2
-2
index.js
src/components/ContextualInfoNew/index.js
+2
-2
index.js
src/components/CurrencyInputPanel/index.js
+2
-1
index.js
src/components/TransactionDetails/index.js
+83
-36
components.js
src/theme/components.js
+3
-3
No files found.
public/locales/en.json
View file @
66604cf4
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
"noLiquidity"
:
"No liquidity."
,
"noLiquidity"
:
"No liquidity."
,
"insufficientLiquidity"
:
"Insufficient liquidity."
,
"insufficientLiquidity"
:
"Insufficient liquidity."
,
"unlockTokenCont"
:
"Please unlock token to continue."
,
"unlockTokenCont"
:
"Please unlock token to continue."
,
"transactionDetails"
:
"
Transaction
Details"
,
"transactionDetails"
:
"
Advanced
Details"
,
"hideDetails"
:
"Hide Details"
,
"hideDetails"
:
"Hide Details"
,
"slippageWarning"
:
"Slippage Warning"
,
"slippageWarning"
:
"Slippage Warning"
,
"highSlippageWarning"
:
"High Slippage Warning"
,
"highSlippageWarning"
:
"High Slippage Warning"
,
...
@@ -81,5 +81,5 @@
...
@@ -81,5 +81,5 @@
"decimals"
:
"Decimals"
,
"decimals"
:
"Decimals"
,
"enterTokenCont"
:
"Enter a token address to continue"
,
"enterTokenCont"
:
"Enter a token address to continue"
,
"priceChange"
:
"Expected price slippage"
,
"priceChange"
:
"Expected price slippage"
,
"forAtLeast"
:
"for at least "
"forAtLeast"
:
"for at least "
}
}
src/components/ContextualInfo/index.js
View file @
66604cf4
...
@@ -51,8 +51,8 @@ class ContextualInfo extends Component {
...
@@ -51,8 +51,8 @@ class ContextualInfo extends Component {
}
}
static
defaultProps
=
{
static
defaultProps
=
{
openDetailsText
:
'
Transaction
Details
'
,
openDetailsText
:
'
Advanced
Details
'
,
closeDetailsText
:
'
Hide
Details
'
,
closeDetailsText
:
'
Hide
Advanced
'
,
renderTransactionDetails
()
{},
renderTransactionDetails
()
{},
contextualInfo
:
''
,
contextualInfo
:
''
,
isError
:
false
isError
:
false
...
...
src/components/ContextualInfoNew/index.js
View file @
66604cf4
...
@@ -85,8 +85,8 @@ const ColoredDropdown = styled(WrappedDropdown)`
...
@@ -85,8 +85,8 @@ const ColoredDropdown = styled(WrappedDropdown)`
`
`
export
default
function
ContextualInfo
({
export
default
function
ContextualInfo
({
openDetailsText
=
'
Transaction
Details
'
,
openDetailsText
=
'
Advanced
Details
'
,
closeDetailsText
=
'
Hide
Details
'
,
closeDetailsText
=
'
Hide
Advanced
'
,
contextualInfo
=
''
,
contextualInfo
=
''
,
allowExpand
=
false
,
allowExpand
=
false
,
isError
=
false
,
isError
=
false
,
...
...
src/components/CurrencyInputPanel/index.js
View file @
66604cf4
...
@@ -34,6 +34,7 @@ const SubCurrencySelect = styled.button`
...
@@ -34,6 +34,7 @@ const SubCurrencySelect = styled.button`
outline: none;
outline: none;
cursor: pointer;
cursor: pointer;
user-select: none;
user-select: none;
`
`
const
InputRow
=
styled
.
div
`
const
InputRow
=
styled
.
div
`
...
@@ -70,7 +71,7 @@ const CurrencySelect = styled.button`
...
@@ -70,7 +71,7 @@ const CurrencySelect = styled.button`
}
}
:focus {
:focus {
bo
x-shadow: 0 0 1px 1px
${({
theme
})
=>
theme
.
malibuBlue
}
;
bo
rder: 1px solid
${({
theme
})
=>
darken
(
0.1
,
theme
.
royalBlue
)
}
;
}
}
:active {
:active {
...
...
src/components/TransactionDetails/index.js
View file @
66604cf4
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'
react
'
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'
react
'
import
{
useTranslation
}
from
'
react-i18next
'
import
{
useTranslation
}
from
'
react-i18next
'
import
styled
,
{
css
,
keyframes
}
from
'
styled-components
'
import
styled
,
{
css
,
keyframes
}
from
'
styled-components
'
import
{
transparentize
,
dark
en
}
from
'
polished
'
import
{
darken
,
light
en
}
from
'
polished
'
import
{
amountFormatter
}
from
'
../../utils
'
import
{
amountFormatter
}
from
'
../../utils
'
import
{
useDebounce
}
from
'
../../hooks
'
import
{
useDebounce
}
from
'
../../hooks
'
...
@@ -105,17 +105,18 @@ const FancyButton = styled.button`
...
@@ -105,17 +105,18 @@ const FancyButton = styled.button`
min-width: 55px;
min-width: 55px;
height: 2rem;
height: 2rem;
border-radius: 36px;
border-radius: 36px;
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
.
white
}
;
:hover {
:hover {
cursor: inherit;
cursor: inherit;
border: 1px solid
${({
theme
})
=>
theme
.
royalBlue
}
;
border: 1px solid
${({
theme
})
=>
theme
.
chaliceGray
}
;
box-shadow:
${({
theme
})
=>
transparentize
(
0.6
,
theme
.
royalBlue
)}
0px 0px 0px 2px;
}
}
:focus {
:focus {
box-shadow:
${({
theme
})
=>
transparentize
(
0.6
,
theme
.
royalBlue
)}
0px 0px 0px 2px;
border: 1px solid
${({
theme
})
=>
theme
.
royalBlue
}
;
/* box-shadow: 0 0 1px 1px #5CA2FF; */
}
}
`
`
...
@@ -123,12 +124,39 @@ const Option = styled(FancyButton)`
...
@@ -123,12 +124,39 @@ const Option = styled(FancyButton)`
margin-right: 8px;
margin-right: 8px;
margin-top: 6px;
margin-top: 6px;
:hover {
cursor: pointer;
}
${({
active
,
theme
})
=>
${({
active
,
theme
})
=>
active
&&
active
&&
css
`
css
`
background-color:
${({
theme
})
=>
theme
.
royalBlue
}
;
background-color:
${({
theme
})
=>
theme
.
royalBlue
}
;
color:
${({
theme
})
=>
theme
.
white
}
;
color:
${({
theme
})
=>
theme
.
white
}
;
border: none;
border: none;
:hover {
border: none;
box-shadow: none;
background-color:
${({
theme
})
=>
darken
(
0.05
,
theme
.
royalBlue
)}
;
}
:focus {
border: none;
box-shadow: none;
background-color:
${({
theme
})
=>
lighten
(
0.05
,
theme
.
royalBlue
)}
;
}
:active {
background-color:
${({
theme
})
=>
darken
(
0.05
,
theme
.
royalBlue
)}
;
}
:hover:focus {
background-color:
${({
theme
})
=>
theme
.
royalBlue
}
;
}
:hover:focus:active {
background-color:
${({
theme
})
=>
darken
(
0.05
,
theme
.
royalBlue
)}
;
}
`
}
`
}
`
`
...
@@ -198,6 +226,9 @@ const OptionCustom = styled(FancyButton)`
...
@@ -198,6 +226,9 @@ const OptionCustom = styled(FancyButton)`
active
&&
active
&&
css
`
css
`
border: 1px solid
${({
theme
})
=>
theme
.
royalBlue
}
;
border: 1px solid
${({
theme
})
=>
theme
.
royalBlue
}
;
:hover {
border: 1px solid
${({
theme
})
=>
darken
(
0.1
,
theme
.
royalBlue
)}
;
}
`
}
`
}
${({
color
})
=>
${({
color
})
=>
...
@@ -219,7 +250,7 @@ const Bold = styled.span`
...
@@ -219,7 +250,7 @@ const Bold = styled.span`
`
`
const
LastSummaryText
=
styled
.
div
`
const
LastSummaryText
=
styled
.
div
`
margin-top: 0.6
rem;
padding-top: 0.5
rem;
`
`
const
SlippageSelector
=
styled
.
div
`
const
SlippageSelector
=
styled
.
div
`
...
@@ -252,6 +283,14 @@ const TransactionInfo = styled.div`
...
@@ -252,6 +283,14 @@ const TransactionInfo = styled.div`
padding: 1.25rem 1.25rem 1rem 1.25rem;
padding: 1.25rem 1.25rem 1rem 1.25rem;
`
`
const
ValueWrapper
=
styled
.
span
`
padding: 0.125rem 0.3rem 0.1rem 0.3rem;
background-color:
${({
theme
})
=>
darken
(
0.04
,
theme
.
concreteGray
)}
;
border-radius: 12px;
font-variant: tabular-nums;
vertical
`
export
default
function
TransactionDetails
(
props
)
{
export
default
function
TransactionDetails
(
props
)
{
const
{
t
}
=
useTranslation
()
const
{
t
}
=
useTranslation
()
...
@@ -513,25 +552,29 @@ export default function TransactionDetails(props) {
...
@@ -513,25 +552,29 @@ export default function TransactionDetails(props) {
<
TransactionInfo
>
<
TransactionInfo
>
<
div
>
<
div
>
{
t
(
'
youAreSelling
'
)}{
'
'
}
{
t
(
'
youAreSelling
'
)}{
'
'
}
{
b
(
<
ValueWrapper
>
`
${
amountFormatter
(
{
b
(
props
.
independentValueParsed
,
`
${
amountFormatter
(
props
.
independentDecimals
,
props
.
independentValueParsed
,
Math
.
min
(
4
,
props
.
independentDecimals
)
props
.
independentDecimals
,
)}
${
props
.
inputSymbol
}
`
Math
.
min
(
4
,
props
.
independentDecimals
)
)}{
'
'
}
)}
${
props
.
inputSymbol
}
`
{
t
(
'
forAtLeast
'
)}
)}
{
b
(
<
/ValueWrapper>{' '
}
`
${
amountFormatter
(
{
t
(
'
forAtLeast
'
)}{
'
'
}
props
.
dependentValueMinumum
,
<
ValueWrapper
>
props
.
dependentDecimals
,
{
b
(
Math
.
min
(
4
,
props
.
dependentDecimals
)
`
${
amountFormatter
(
)}
${
props
.
outputSymbol
}
`
props
.
dependentValueMinumum
,
)}
props
.
dependentDecimals
,
Math
.
min
(
4
,
props
.
dependentDecimals
)
)}
${
props
.
outputSymbol
}
`
)}
<
/ValueWrapper
>
.
.
<
/div
>
<
/div
>
<
LastSummaryText
>
<
LastSummaryText
>
{
t
(
'
priceChange
'
)}
{
b
(
`
${
props
.
percentSlippageFormatted
}
%`
)}.
{
t
(
'
priceChange
'
)}
<
ValueWrapper
>
{
b
(
`
${
props
.
percentSlippageFormatted
}
%`
)}
<
/ValueWrapper
>
<
/LastSummaryText
>
<
/LastSummaryText
>
<
/TransactionInfo
>
<
/TransactionInfo
>
)
)
...
@@ -540,28 +583,32 @@ export default function TransactionDetails(props) {
...
@@ -540,28 +583,32 @@ export default function TransactionDetails(props) {
<
TransactionInfo
>
<
TransactionInfo
>
<
div
>
<
div
>
{
t
(
'
youAreBuying
'
)}{
'
'
}
{
t
(
'
youAreBuying
'
)}{
'
'
}
{
b
(
<
ValueWrapper
>
`
${
amountFormatter
(
{
b
(
props
.
independentValueParsed
,
`
${
amountFormatter
(
props
.
independentDecimals
,
props
.
independentValueParsed
,
Math
.
min
(
4
,
props
.
independentDecimals
)
props
.
independentDecimals
,
)}
${
props
.
outputSymbol
}
`
Math
.
min
(
4
,
props
.
independentDecimals
)
)}
)}
${
props
.
outputSymbol
}
`
)}
<
/ValueWrapper
>
.
.
<
/div
>
<
/div
>
<
LastSummaryText
>
<
LastSummaryText
>
{
t
(
'
itWillCost
'
)}{
'
'
}
{
t
(
'
itWillCost
'
)}{
'
'
}
{
b
(
<
ValueWrapper
>
`
${
amountFormatter
(
{
b
(
props
.
dependentValueMaximum
,
`
${
amountFormatter
(
props
.
dependentDecimals
,
props
.
dependentValueMaximum
,
Math
.
min
(
4
,
props
.
dependentDecimals
)
props
.
dependentDecimals
,
)}
${
props
.
inputSymbol
}
`
Math
.
min
(
4
,
props
.
dependentDecimals
)
)}{
'
'
}
)}
${
props
.
inputSymbol
}
`
)}
<
/ValueWrapper>{' '
}
{
t
(
'
orTransFail
'
)}
{
t
(
'
orTransFail
'
)}
<
/LastSummaryText
>
<
/LastSummaryText
>
<
LastSummaryText
>
<
LastSummaryText
>
{
t
(
'
priceChange
'
)}
{
b
(
`
${
props
.
percentSlippageFormatted
}
%`
)}.
{
t
(
'
priceChange
'
)}
<
ValueWrapper
>
{
b
(
`
${
props
.
percentSlippageFormatted
}
%`
)}
<
/ValueWrapper
>
<
/LastSummaryText
>
<
/LastSummaryText
>
<
/TransactionInfo
>
<
/TransactionInfo
>
)
)
...
...
src/theme/components.js
View file @
66604cf4
import
styled
,
{
keyframes
}
from
'
styled-components
'
import
styled
,
{
keyframes
}
from
'
styled-components
'
import
{
lighten
,
darken
}
from
'
polished
'
import
{
darken
}
from
'
polished
'
export
const
Button
=
styled
.
button
.
attrs
(({
warning
,
theme
})
=>
({
export
const
Button
=
styled
.
button
.
attrs
(({
warning
,
theme
})
=>
({
backgroundColor
:
warning
?
theme
.
salmonRed
:
theme
.
royalBlue
backgroundColor
:
warning
?
theme
.
salmonRed
:
theme
.
royalBlue
...
@@ -18,11 +18,11 @@ export const Button = styled.button.attrs(({ warning, theme }) => ({
...
@@ -18,11 +18,11 @@ export const Button = styled.button.attrs(({ warning, theme }) => ({
:hover,
:hover,
:focus {
:focus {
background-color:
${({
backgroundColor
})
=>
light
en
(
0.05
,
backgroundColor
)}
;
background-color:
${({
backgroundColor
})
=>
dark
en
(
0.05
,
backgroundColor
)}
;
}
}
:active {
:active {
background-color:
${({
backgroundColor
})
=>
darken
(
0.
05
,
backgroundColor
)}
;
background-color:
${({
backgroundColor
})
=>
darken
(
0.
1
,
backgroundColor
)}
;
}
}
:disabled {
:disabled {
...
...
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