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

View File

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