make owner address a link in expanded tx view

This commit is contained in:
Mikhail Mikheev 2019-07-01 18:30:07 +04:00
parent c56847d427
commit da45a784b3
1 changed files with 18 additions and 12 deletions

View File

@ -1,5 +1,5 @@
// @flow
import React, { useState } from 'react'
import React from 'react'
import { List } from 'immutable'
import { withStyles } from '@material-ui/core/styles'
import OpenInNew from '@material-ui/icons/OpenInNew'
@ -7,18 +7,10 @@ import MuiList from '@material-ui/core/List'
import ListItem from '@material-ui/core/ListItem'
import ListItemIcon from '@material-ui/core/ListItemIcon'
import ListItemText from '@material-ui/core/ListItemText'
import Tab from '@material-ui/core/Tab'
import Row from '~/components/layout/Row'
import Block from '~/components/layout/Block'
import Col from '~/components/layout/Col'
import Bold from '~/components/layout/Bold'
import Span from '~/components/layout/Span'
import Paragraph from '~/components/layout/Paragraph'
import Hairline from '~/components/layout/Hairline'
import Identicon from '~/components/Identicon'
import { type Owner } from '~/routes/safe/store/models/owner'
import { openTxInEtherScan } from '~/logic/wallets/getWeb3'
import { shortVersionOf } from '~/logic/wallets/ethAddresses'
import { getEtherScanLink } from '~/logic/wallets/getWeb3'
import { secondary } from '~/theme/variables'
import { styles } from './style'
type Props = {
@ -26,6 +18,11 @@ type Props = {
classes: Object,
}
const openIconStyle = {
height: '13px',
color: secondary,
}
const OwnersList = ({ owners, classes }: Props) => (
<MuiList className={classes.ownersList}>
{owners.map(owner => (
@ -33,7 +30,16 @@ const OwnersList = ({ owners, classes }: Props) => (
<ListItemIcon>
<Identicon address={owner.address} diameter={32} className={classes.icon} />
</ListItemIcon>
<ListItemText primary={owner.name} secondary={owner.address} />
<ListItemText
primary={owner.name}
secondary={(
<a href={getEtherScanLink(owner.address, 'rinkeby')} target="_blank" rel="noopener noreferrer">
{owner.address}
{' '}
<OpenInNew style={openIconStyle} />
</a>
)}
/>
</ListItem>
))}
</MuiList>