Add etherscan/copy buttons to add owner

This commit is contained in:
Mikhail Mikheev 2019-10-09 17:23:10 +04:00
parent e1266b8ee0
commit 43b079f4e0
2 changed files with 12 additions and 24 deletions

View File

@ -3,11 +3,11 @@ import React from 'react'
import { List } from 'immutable' import { List } from 'immutable'
import classNames from 'classnames' import classNames from 'classnames'
import { withStyles } from '@material-ui/core/styles' import { withStyles } from '@material-ui/core/styles'
import OpenInNew from '@material-ui/icons/OpenInNew'
import Close from '@material-ui/icons/Close' import Close from '@material-ui/icons/Close'
import IconButton from '@material-ui/core/IconButton' import IconButton from '@material-ui/core/IconButton'
import Identicon from '~/components/Identicon' import Identicon from '~/components/Identicon'
import Link from '~/components/layout/Link' import EtherscanBtn from '~/components/EtherscanBtn'
import CopyBtn from '~/components/CopyBtn'
import Paragraph from '~/components/layout/Paragraph' import Paragraph from '~/components/layout/Paragraph'
import Row from '~/components/layout/Row' import Row from '~/components/layout/Row'
import Col from '~/components/layout/Col' import Col from '~/components/layout/Col'
@ -15,17 +15,10 @@ import Button from '~/components/layout/Button'
import Block from '~/components/layout/Block' import Block from '~/components/layout/Block'
import Hairline from '~/components/layout/Hairline' import Hairline from '~/components/layout/Hairline'
import type { Owner } from '~/routes/safe/store/models/owner' import type { Owner } from '~/routes/safe/store/models/owner'
import { getEtherScanLink } from '~/logic/wallets/getWeb3'
import { secondary } from '~/theme/variables'
import { styles } from './style' import { styles } from './style'
export const ADD_OWNER_SUBMIT_BTN_TEST_ID = 'add-owner-submit-btn' export const ADD_OWNER_SUBMIT_BTN_TEST_ID = 'add-owner-submit-btn'
const openIconStyle = {
height: '16px',
color: secondary,
}
type Props = { type Props = {
onClose: () => void, onClose: () => void,
classes: Object, classes: Object,
@ -84,9 +77,7 @@ const ReviewAddOwner = ({
<Col xs={8} layout="column" className={classes.owners}> <Col xs={8} layout="column" className={classes.owners}>
<Row className={classes.ownersTitle}> <Row className={classes.ownersTitle}>
<Paragraph size="lg" color="primary" noMargin> <Paragraph size="lg" color="primary" noMargin>
{owners.size + 1} {`${owners.size + 1} Safe owner(s)`}
{' '}
Safe owner(s)
</Paragraph> </Paragraph>
</Row> </Row>
<Hairline /> <Hairline />
@ -102,12 +93,11 @@ const ReviewAddOwner = ({
{owner.name} {owner.name}
</Paragraph> </Paragraph>
<Block justify="center" className={classes.user}> <Block justify="center" className={classes.user}>
<Paragraph size="md" color="disabled" noMargin> <Paragraph size="md" color="disabled" className={classes.address} noMargin>
{owner.address} {owner.address}
</Paragraph> </Paragraph>
<Link className={classes.open} to={getEtherScanLink('address', owner.address)} target="_blank"> <CopyBtn content={owner.address} />
<OpenInNew style={openIconStyle} /> <EtherscanBtn type="address" value={owner.address} />
</Link>
</Block> </Block>
</Block> </Block>
</Col> </Col>
@ -131,16 +121,11 @@ const ReviewAddOwner = ({
{values.ownerName} {values.ownerName}
</Paragraph> </Paragraph>
<Block justify="center" className={classes.user}> <Block justify="center" className={classes.user}>
<Paragraph size="md" color="disabled" noMargin> <Paragraph size="md" color="disabled" className={classes.address} noMargin>
{values.ownerAddress} {values.ownerAddress}
</Paragraph> </Paragraph>
<Link <CopyBtn content={values.ownerAddress} />
className={classes.open} <EtherscanBtn type="address" value={values.ownerAddress} />
to={getEtherScanLink('address', values.ownerAddress)}
target="_blank"
>
<OpenInNew style={openIconStyle} />
</Link>
</Block> </Block>
</Block> </Block>
</Col> </Col>

View File

@ -49,6 +49,9 @@ export const styles = () => ({
ownersTitle: { ownersTitle: {
padding: lg, padding: lg,
}, },
address: {
marginRight: sm,
},
owner: { owner: {
padding: sm, padding: sm,
alignItems: 'center', alignItems: 'center',