From 051b6776511ae29f2c356a404cee81fa4aa0677d Mon Sep 17 00:00:00 2001 From: Mikhail Mikheev Date: Fri, 4 Oct 2019 18:10:17 +0400 Subject: [PATCH] Safe view tabs as routes wip --- src/routes/safe/components/Layout.jsx | 108 ++++++++++++++------------ 1 file changed, 59 insertions(+), 49 deletions(-) diff --git a/src/routes/safe/components/Layout.jsx b/src/routes/safe/components/Layout.jsx index d49c838e..f2e69274 100644 --- a/src/routes/safe/components/Layout.jsx +++ b/src/routes/safe/components/Layout.jsx @@ -1,6 +1,7 @@ // @flow import * as React from 'react' import classNames from 'classnames/bind' +import { Switch, Redirect, Route } from 'react-router-dom' import OpenInNew from '@material-ui/icons/OpenInNew' import Tabs from '@material-ui/core/Tabs' import Tab from '@material-ui/core/Tab' @@ -21,9 +22,7 @@ import Receive from './Balances/Receive' import NoSafe from '~/components/NoSafe' import { type SelectorProps } from '~/routes/safe/container/selector' import { getEtherScanLink } from '~/logic/wallets/getWeb3' -import { - secondary, border, -} from '~/theme/variables' +import { secondary, border } from '~/theme/variables' import { copyToClipboard } from '~/utils/clipboard' import { type Actions } from '../container/actions' import Balances from './Balances' @@ -49,7 +48,7 @@ type Props = SelectorProps & onShow: Function, onHide: Function, showSendFunds: Function, - hideSendFunds: Function + hideSendFunds: Function, } const openIconStyle = { @@ -99,6 +98,7 @@ class Layout extends React.Component { showSendFunds, hideSendFunds, } = this.props + console.log(this.props) const { tabIndex } = this.state if (!safe) { @@ -139,7 +139,7 @@ class Layout extends React.Component { disabled={!granted} > - Send + Send @@ -162,46 +162,61 @@ class Layout extends React.Component { - {tabIndex === 0 && ( - + ( + + )} /> - )} - {tabIndex === 1 && ( - ( + + )} /> - )} - {tabIndex === 2 && ( - ( + + )} /> - )} + + { open={showReceive} paperClassName={classes.receiveModal} > - + )