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
89290c5b
Commit
89290c5b
authored
Dec 11, 2018
by
Kenny Tran
Committed by
Chi Kei Chan
Dec 24, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Middle arrow flips input/output for swap/send (#151)
parent
d63a73ae
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
2 deletions
+28
-2
index.js
src/pages/Send/index.js
+12
-1
index.js
src/pages/Swap/index.js
+12
-1
swap.scss
src/pages/Swap/swap.scss
+4
-0
No files found.
src/pages/Send/index.js
View file @
89290c5b
...
...
@@ -101,6 +101,17 @@ class Send extends Component {
};
}
flipInputOutput
=
()
=>
{
const
{
state
}
=
this
;
this
.
setState
({
inputValue
:
state
.
outputValue
,
outputValue
:
state
.
inputValue
,
inputCurrency
:
state
.
outputCurrency
,
outputCurrency
:
state
.
inputCurrency
,
lastEditedField
:
state
.
lastEditedField
===
INPUT
?
OUTPUT
:
INPUT
},
()
=>
this
.
recalcForm
());
}
isUnapproved
()
{
const
{
account
,
exchangeAddresses
,
selectors
}
=
this
.
props
;
const
{
inputCurrency
,
inputValue
}
=
this
.
state
;
...
...
@@ -734,7 +745,7 @@ class Send extends Component {
/
>
<
OversizedPanel
>
<
div
className
=
"
swap__down-arrow-background
"
>
<
img
className
=
"
swap__down-arrow
"
src
=
{
isValid
?
ArrowDownBlue
:
ArrowDownGrey
}
/
>
<
img
onClick
=
{
this
.
flipInputOutput
}
className
=
"
swap__down-arrow swap__down-arrow--clickable
"
src
=
{
isValid
?
ArrowDownBlue
:
ArrowDownGrey
}
/
>
<
/div
>
<
/OversizedPanel
>
<
CurrencyInputPanel
...
...
src/pages/Swap/index.js
View file @
89290c5b
...
...
@@ -98,6 +98,17 @@ class Swap extends Component {
};
}
flipInputOutput
=
()
=>
{
const
{
state
}
=
this
;
this
.
setState
({
inputValue
:
state
.
outputValue
,
outputValue
:
state
.
inputValue
,
inputCurrency
:
state
.
outputCurrency
,
outputCurrency
:
state
.
inputCurrency
,
lastEditedField
:
state
.
lastEditedField
===
INPUT
?
OUTPUT
:
INPUT
},
()
=>
this
.
recalcForm
());
}
isUnapproved
()
{
const
{
account
,
exchangeAddresses
,
selectors
}
=
this
.
props
;
const
{
inputCurrency
,
inputValue
}
=
this
.
state
;
...
...
@@ -716,7 +727,7 @@ class Swap extends Component {
/
>
<
OversizedPanel
>
<
div
className
=
"
swap__down-arrow-background
"
>
<
img
className
=
"
swap__down-arrow
"
src
=
{
isValid
?
ArrowDownBlue
:
ArrowDownGrey
}
/
>
<
img
onClick
=
{
this
.
flipInputOutput
}
className
=
"
swap__down-arrow swap__down-arrow--clickable
"
src
=
{
isValid
?
ArrowDownBlue
:
ArrowDownGrey
}
/
>
<
/div
>
<
/OversizedPanel
>
<
CurrencyInputPanel
...
...
src/pages/Swap/swap.scss
View file @
89290c5b
...
...
@@ -22,6 +22,10 @@
position
:
relative
;
z-index
:
200
;
padding
:
.875rem
;
&
--clickable
{
cursor
:
pointer
;
}
}
&
__down-arrow-background
{
...
...
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