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
36130543
Commit
36130543
authored
Oct 07, 2018
by
Chi Kei Chan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add inactive state to views
parent
d5e8b734
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
14 deletions
+44
-14
App.js
src/pages/App.js
+2
-5
index.js
src/pages/Pool/index.js
+12
-2
index.js
src/pages/Send/index.js
+12
-2
index.js
src/pages/Swap/index.js
+14
-5
swap.scss
src/pages/Swap/swap.scss
+4
-0
No files found.
src/pages/App.js
View file @
36130543
...
@@ -22,15 +22,12 @@ class App extends Component {
...
@@ -22,15 +22,12 @@ class App extends Component {
<
Route
exact
path
=
"
/pool
"
component
=
{
Pool
}
/
>
<
Route
exact
path
=
"
/pool
"
component
=
{
Pool
}
/
>
<
/Switch
>
<
/Switch
>
<
/BrowserRouter
>
<
/BrowserRouter
>
)
)
;
}
}
}
}
export
default
connect
(
export
default
connect
(
({
web3
:
{
web3
,
currentAddress
}
})
=>
({
null
,
address
:
currentAddress
,
isConnected
:
!!
(
web3
&&
currentAddress
),
}),
dispatch
=>
({
dispatch
=>
({
initializeWeb3
:
()
=>
dispatch
(
initialize
()),
initializeWeb3
:
()
=>
dispatch
(
initialize
()),
})
})
...
...
src/pages/Pool/index.js
View file @
36130543
...
@@ -2,8 +2,8 @@ import React, { Component } from 'react';
...
@@ -2,8 +2,8 @@ import React, { Component } from 'react';
import
{
connect
}
from
'
react-redux
'
;
import
{
connect
}
from
'
react-redux
'
;
import
{
withRouter
}
from
'
react-router-dom
'
;
import
{
withRouter
}
from
'
react-router-dom
'
;
import
PropTypes
from
'
prop-types
'
;
import
PropTypes
from
'
prop-types
'
;
import
classnames
from
"
classnames
"
;
import
Header
from
'
../../components/Header
'
;
import
Header
from
'
../../components/Header
'
;
import
NavigationTabs
from
'
../../components/NavigationTabs
'
;
import
CurrencyInputPanel
from
'
../../components/CurrencyInputPanel
'
;
import
CurrencyInputPanel
from
'
../../components/CurrencyInputPanel
'
;
import
OversizedPanel
from
'
../../components/OversizedPanel
'
;
import
OversizedPanel
from
'
../../components/OversizedPanel
'
;
import
ArrowDown
from
'
../../assets/images/arrow-down-blue.svg
'
;
import
ArrowDown
from
'
../../assets/images/arrow-down-blue.svg
'
;
...
@@ -20,13 +20,20 @@ class Pool extends Component {
...
@@ -20,13 +20,20 @@ class Pool extends Component {
// Injected by React Router Dom
// Injected by React Router Dom
push
:
PropTypes
.
func
.
isRequired
,
push
:
PropTypes
.
func
.
isRequired
,
pathname
:
PropTypes
.
string
.
isRequired
,
pathname
:
PropTypes
.
string
.
isRequired
,
web3
:
PropTypes
.
object
.
isRequired
,
currentAddress
:
PropTypes
.
string
,
isConnected
:
PropTypes
.
bool
.
isRequired
,
};
};
render
()
{
render
()
{
return
(
return
(
<
div
className
=
"
pool
"
>
<
div
className
=
"
pool
"
>
<
Header
/>
<
Header
/>
<
div
className
=
"
swap__content
"
>
<
div
className
=
{
classnames
(
'
swap__content
'
,
{
'
swap--inactive
'
:
!
this
.
props
.
isConnected
,
})}
>
<
OversizedPanel
hideTop
>
<
OversizedPanel
hideTop
>
<
div
className
=
"
pool__liquidity-container
"
>
<
div
className
=
"
pool__liquidity-container
"
>
<
span
className
=
"
pool__liquidity-label
"
>
Add
Liquidity
<
/span
>
<
span
className
=
"
pool__liquidity-label
"
>
Add
Liquidity
<
/span
>
...
@@ -75,6 +82,9 @@ export default withRouter(
...
@@ -75,6 +82,9 @@ export default withRouter(
(
state
,
ownProps
)
=>
({
(
state
,
ownProps
)
=>
({
push
:
ownProps
.
history
.
push
,
push
:
ownProps
.
history
.
push
,
pathname
:
ownProps
.
location
.
pathname
,
pathname
:
ownProps
.
location
.
pathname
,
web3
:
state
.
web3
.
web3
,
currentAddress
:
state
.
web3
.
currentAddress
,
isConnected
:
!!
(
state
.
web3
.
web3
&&
state
.
web3
.
currentAddress
),
}),
}),
)(
Pool
)
)(
Pool
)
);
);
src/pages/Send/index.js
View file @
36130543
...
@@ -2,8 +2,8 @@ import React, { Component } from 'react';
...
@@ -2,8 +2,8 @@ import React, { Component } from 'react';
import
{
connect
}
from
'
react-redux
'
;
import
{
connect
}
from
'
react-redux
'
;
import
{
withRouter
}
from
'
react-router-dom
'
;
import
{
withRouter
}
from
'
react-router-dom
'
;
import
PropTypes
from
'
prop-types
'
;
import
PropTypes
from
'
prop-types
'
;
import
classnames
from
'
classnames
'
;
import
Header
from
'
../../components/Header
'
;
import
Header
from
'
../../components/Header
'
;
import
NavigationTabs
from
'
../../components/NavigationTabs
'
;
import
CurrencyInputPanel
from
'
../../components/CurrencyInputPanel
'
;
import
CurrencyInputPanel
from
'
../../components/CurrencyInputPanel
'
;
import
AddressInputPanel
from
'
../../components/AddressInputPanel
'
;
import
AddressInputPanel
from
'
../../components/AddressInputPanel
'
;
import
OversizedPanel
from
'
../../components/OversizedPanel
'
;
import
OversizedPanel
from
'
../../components/OversizedPanel
'
;
...
@@ -16,13 +16,20 @@ class Send extends Component {
...
@@ -16,13 +16,20 @@ class Send extends Component {
// Injected by React Router Dom
// Injected by React Router Dom
push
:
PropTypes
.
func
.
isRequired
,
push
:
PropTypes
.
func
.
isRequired
,
pathname
:
PropTypes
.
string
.
isRequired
,
pathname
:
PropTypes
.
string
.
isRequired
,
web3
:
PropTypes
.
object
.
isRequired
,
currentAddress
:
PropTypes
.
string
,
isConnected
:
PropTypes
.
bool
.
isRequired
,
};
};
render
()
{
render
()
{
return
(
return
(
<
div
className
=
"
send
"
>
<
div
className
=
"
send
"
>
<
Header
/>
<
Header
/>
<
div
className
=
"
swap__content
"
>
<
div
className
=
{
classnames
(
'
swap__content
'
,
{
'
swap--inactive
'
:
!
this
.
props
.
isConnected
,
})}
>
<
CurrencyInputPanel
<
CurrencyInputPanel
title
=
"
Input
"
title
=
"
Input
"
extraText
=
"
Balance: 0.03141
"
extraText
=
"
Balance: 0.03141
"
...
@@ -65,6 +72,9 @@ export default withRouter(
...
@@ -65,6 +72,9 @@ export default withRouter(
(
state
,
ownProps
)
=>
({
(
state
,
ownProps
)
=>
({
push
:
ownProps
.
history
.
push
,
push
:
ownProps
.
history
.
push
,
pathname
:
ownProps
.
location
.
pathname
,
pathname
:
ownProps
.
location
.
pathname
,
web3
:
state
.
web3
.
web3
,
currentAddress
:
state
.
web3
.
currentAddress
,
isConnected
:
!!
(
state
.
web3
.
web3
&&
state
.
web3
.
currentAddress
),
}),
}),
)(
Send
)
)(
Send
)
);
);
src/pages/Swap/index.js
View file @
36130543
...
@@ -2,8 +2,8 @@ import React, { Component } from 'react';
...
@@ -2,8 +2,8 @@ import React, { Component } from 'react';
import
{
connect
}
from
'
react-redux
'
;
import
{
connect
}
from
'
react-redux
'
;
import
{
withRouter
}
from
'
react-router-dom
'
;
import
{
withRouter
}
from
'
react-router-dom
'
;
import
PropTypes
from
'
prop-types
'
;
import
PropTypes
from
'
prop-types
'
;
import
classnames
from
'
classnames
'
;
import
Header
from
'
../../components/Header
'
;
import
Header
from
'
../../components/Header
'
;
import
NavigationTabs
from
'
../../components/NavigationTabs
'
;
import
CurrencyInputPanel
from
'
../../components/CurrencyInputPanel
'
;
import
CurrencyInputPanel
from
'
../../components/CurrencyInputPanel
'
;
import
OversizedPanel
from
'
../../components/OversizedPanel
'
;
import
OversizedPanel
from
'
../../components/OversizedPanel
'
;
import
ArrowDown
from
'
../../assets/images/arrow-down-blue.svg
'
;
import
ArrowDown
from
'
../../assets/images/arrow-down-blue.svg
'
;
...
@@ -13,16 +13,22 @@ import "./swap.scss";
...
@@ -13,16 +13,22 @@ import "./swap.scss";
class
Swap
extends
Component
{
class
Swap
extends
Component
{
static
propTypes
=
{
static
propTypes
=
{
// Injected by React Router Dom
// Injected by React Router Dom
push
:
PropTypes
.
func
.
isRequired
,
push
:
PropTypes
.
func
.
isRequired
,
pathname
:
PropTypes
.
string
.
isRequired
,
pathname
:
PropTypes
.
string
.
isRequired
,
web3
:
PropTypes
.
object
.
isRequired
,
currentAddress
:
PropTypes
.
string
,
isConnected
:
PropTypes
.
bool
.
isRequired
,
};
};
render
()
{
render
()
{
return
(
return
(
<
div
className
=
"
swap
"
>
<
div
className
=
"
swap
"
>
<
Header
/>
<
Header
/>
{
/*<NavigationTabs className="swap__navigation" />*/
}
<
div
<
div
className
=
"
swap__content
"
>
className
=
{
classnames
(
'
swap__content
'
,
{
'
swap--inactive
'
:
!
this
.
props
.
isConnected
,
})}
>
<
CurrencyInputPanel
<
CurrencyInputPanel
title
=
"
Input
"
title
=
"
Input
"
extraText
=
"
Balance: 0.03141
"
extraText
=
"
Balance: 0.03141
"
...
@@ -59,6 +65,9 @@ export default withRouter(
...
@@ -59,6 +65,9 @@ export default withRouter(
(
state
,
ownProps
)
=>
({
(
state
,
ownProps
)
=>
({
push
:
ownProps
.
history
.
push
,
push
:
ownProps
.
history
.
push
,
pathname
:
ownProps
.
location
.
pathname
,
pathname
:
ownProps
.
location
.
pathname
,
web3
:
state
.
web3
.
web3
,
currentAddress
:
state
.
web3
.
currentAddress
,
isConnected
:
!!
(
state
.
web3
.
web3
&&
state
.
web3
.
currentAddress
),
}),
}),
)(
Swap
)
)(
Swap
)
);
);
src/pages/Swap/swap.scss
View file @
36130543
...
@@ -4,6 +4,10 @@
...
@@ -4,6 +4,10 @@
@extend
%col-nowrap
;
@extend
%col-nowrap
;
height
:
100%
;
height
:
100%
;
&
--inactive
{
opacity
:
.5
;
}
&
__content
{
&
__content
{
padding
:
1rem
.75rem
;
padding
:
1rem
.75rem
;
margin-top
:
1rem
;
margin-top
:
1rem
;
...
...
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