diff --git a/src/routes/safe/component/Balances/index.jsx b/src/routes/safe/component/Balances/index.jsx new file mode 100644 index 00000000..74443780 --- /dev/null +++ b/src/routes/safe/component/Balances/index.jsx @@ -0,0 +1,128 @@ +// @flow +import * as React from 'react' +import { List } from 'immutable' +import Row from '~/components/layout/Row' +import Checkbox from '@material-ui/core/Checkbox' +import { withStyles } from '@material-ui/core/styles' +import Paragraph from '~/components/layout/Paragraph' +import { type Column } from '~/components/Table/TableHead' +import Table from '~/components/Table' +import { buildOrderFieldFrom } from '~/components/Table/sorting' +import { sm } from '~/theme/variables' + +const BALANCE_TABLE_ASSET_ID = 'asset' +const BALANCE_TABLE_BALANCE_ID = 'balance' +const BALANCE_TABLE_VALUE_ID = 'value' + +const generateColumns = () => { + const assetRow: Column = { + id: BALANCE_TABLE_ASSET_ID, + order: false, + numeric: false, + disablePadding: false, + label: 'Asset', + } + + const balanceRow: Column = { + id: BALANCE_TABLE_BALANCE_ID, + order: true, + numeric: true, + disablePadding: false, + label: 'Balance', + } + + const valueRow: Column = { + id: BALANCE_TABLE_VALUE_ID, + order: true, + numeric: true, + disablePadding: false, + label: 'Value', + } + + return List([assetRow, balanceRow, valueRow]) +} + +type State = { + hideZero: boolean, +} + +const styles = { + root: { + width: '20px', + marginRight: sm, + }, + zero: { + letterSpacing: '-0.5px', + }, +} + +type Props = { + classes: Object, +} + +class Balances extends React.Component { + state = { + hideZero: false, + } + + handleChange = (e: SyntheticInputEvent) => { + const { checked } = e.target + + this.setState(() => ({ hideZero: checked })) + } + + render() { + const { hideZero } = this.state + const { classes } = this.props + + const columns = generateColumns() + const checkboxClasses = { + root: classes.root, + } + + return ( + + + + Hide zero balances + + + + ) + } +} + +export default withStyles(styles)(Balances) diff --git a/src/routes/safe/component/Layout.jsx b/src/routes/safe/component/Layout.jsx index 231731cf..446a5e56 100644 --- a/src/routes/safe/component/Layout.jsx +++ b/src/routes/safe/component/Layout.jsx @@ -1,20 +1,111 @@ // @flow import * as React from 'react' +import OpenInNew from '@material-ui/icons/OpenInNew' +import Tabs from '@material-ui/core/Tabs' +import Tab from '@material-ui/core/Tab' +import Hairline from '~/components/layout/Hairline' +import Block from '~/components/layout/Block' +import Identicon from '~/components/Identicon' +import { withStyles } from '@material-ui/core/styles' +import Heading from '~/components/layout/Heading' +import Row from '~/components/layout/Row' +import Paragraph from '~/components/layout/Paragraph' import NoSafe from '~/components/NoSafe' import { type SelectorProps } from '~/routes/safe/container/selector' -import GnoSafe from './Safe' +import { openAddressInEtherScan } from '~/logic/wallets/getWeb3' +import { sm, secondary } from '~/theme/variables' +import Balances from './Balances' -type Props = SelectorProps +type Props = SelectorProps & { + classes: Object, +} -const Layout = ({ - safe, activeTokens, provider, userAddress, -}: Props) => ( - - { safe - ? - : +type State = { + value: number, +} + +const openIconStyle = { + height: '16px', + color: secondary, +} + +const styles = () => ({ + container: { + display: 'flex', + alignItems: 'center', + }, + name: { + marginLeft: sm, + textOverflow: 'ellipsis', + overflow: 'hidden', + whiteSpace: 'nowrap', + }, + user: { + justifyContent: 'left', + }, + open: { + paddingLeft: sm, + width: 'auto', + '&:hover': { + cursor: 'pointer', + }, + }, +}) + +class Layout extends React.Component { + state = { + value: 0, + } + + handleChange = (event, value) => { + this.setState({ value }) + } + + render() { + const { + safe, provider, network, classes, + } = this.props + const { value } = this.state + + if (!safe) { + return } - -) + // + const address = safe.get('address') -export default Layout + return ( + + + + + {safe.get('name')} + + {address} + + + + + + + + + + + + + {value === 0 && } + + ) + } +} + +export default withStyles(styles)(Layout)