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
b6ad0dbb
Commit
b6ad0dbb
authored
Oct 16, 2018
by
Kenny Tran
Committed by
Chi Kei Chan
Oct 16, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Redirect to /swap and add (estimated) to last edit (#40)
parent
ae4c7391
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
App.js
src/pages/App.js
+2
-2
index.js
src/pages/Swap/index.js
+4
-2
No files found.
src/pages/App.js
View file @
b6ad0dbb
import
React
,
{
Component
}
from
'
react
'
;
import
{
drizzleConnect
}
from
'
drizzle-react
'
import
{
BrowserRouter
,
Switch
,
Route
}
from
'
react-router-dom
'
;
import
{
BrowserRouter
,
Switch
,
R
edirect
,
R
oute
}
from
'
react-router-dom
'
;
import
{
AnimatedSwitch
}
from
'
react-router-transition
'
;
import
Swap
from
'
./Swap
'
;
import
Send
from
'
./Send
'
;
...
...
@@ -25,7 +25,7 @@ class App extends Component {
<
Route
exact
path
=
"
/swap
"
component
=
{
Swap
}
/
>
<
Route
exact
path
=
"
/send
"
component
=
{
Send
}
/
>
<
Route
exact
path
=
"
/pool
"
component
=
{
Pool
}
/
>
<
R
oute
component
=
{
Swap
}
/
>
<
R
edirect
exact
from
=
"
/
"
to
=
"
/swap
"
/>
<
/AnimatedSwitch
>
<
/BrowserRouter
>
);
...
...
src/pages/Swap/index.js
View file @
b6ad0dbb
...
...
@@ -143,10 +143,11 @@ class Swap extends Component {
}
render
()
{
const
{
inputCurrency
,
outputCurrency
,
input
,
output
}
=
this
.
props
;
const
{
lastEditedField
,
inputCurrency
,
outputCurrency
,
input
,
output
}
=
this
.
props
;
const
{
exchangeRate
}
=
this
.
state
;
const
inputLabel
=
this
.
getTokenLabel
(
inputCurrency
);
const
outputLabel
=
this
.
getTokenLabel
(
outputCurrency
);
const
estimatedText
=
'
(estimated)
'
return
(
<
div
className
=
"
swap
"
>
...
...
@@ -158,6 +159,7 @@ class Swap extends Component {
>
<
CurrencyInputPanel
title
=
"
Input
"
description
=
{
lastEditedField
===
'
output
'
?
estimatedText
:
''
}
onCurrencySelected
=
{
d
=>
this
.
props
.
updateField
(
'
inputCurrency
'
,
d
)}
onValueChange
=
{
d
=>
this
.
updateInput
(
d
)}
selectedTokens
=
{[
inputCurrency
,
outputCurrency
]}
...
...
@@ -170,7 +172,7 @@ class Swap extends Component {
<
/OversizedPanel
>
<
CurrencyInputPanel
title
=
"
Output
"
description
=
"
(estimated)
"
description
=
{
lastEditedField
===
'
input
'
?
estimatedText
:
''
}
onCurrencySelected
=
{
d
=>
this
.
props
.
updateField
(
'
outputCurrency
'
,
d
)}
onValueChange
=
{
d
=>
this
.
updateOutput
(
d
)}
selectedTokens
=
{[
inputCurrency
,
outputCurrency
]}
...
...
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