Commit 36130543 authored by Chi Kei Chan's avatar Chi Kei Chan

Add inactive state to views

parent d5e8b734
...@@ -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()),
}) })
......
...@@ -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)
); );
...@@ -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)
); );
...@@ -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)
); );
...@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment