Add etherscan/copy buttons to edit owner
This commit is contained in:
parent
43b079f4e0
commit
e583b041a0
|
@ -3,10 +3,10 @@ import React from 'react'
|
||||||
import { withSnackbar } from 'notistack'
|
import { withSnackbar } from 'notistack'
|
||||||
import { withStyles } from '@material-ui/core/styles'
|
import { withStyles } from '@material-ui/core/styles'
|
||||||
import Close from '@material-ui/icons/Close'
|
import Close from '@material-ui/icons/Close'
|
||||||
import OpenInNew from '@material-ui/icons/OpenInNew'
|
|
||||||
import IconButton from '@material-ui/core/IconButton'
|
import IconButton from '@material-ui/core/IconButton'
|
||||||
|
import EtherscanBtn from '~/components/EtherscanBtn'
|
||||||
|
import CopyBtn from '~/components/CopyBtn'
|
||||||
import Row from '~/components/layout/Row'
|
import Row from '~/components/layout/Row'
|
||||||
import Link from '~/components/layout/Link'
|
|
||||||
import Block from '~/components/layout/Block'
|
import Block from '~/components/layout/Block'
|
||||||
import GnoForm from '~/components/forms/GnoForm'
|
import GnoForm from '~/components/forms/GnoForm'
|
||||||
import Button from '~/components/layout/Button'
|
import Button from '~/components/layout/Button'
|
||||||
|
@ -18,19 +18,13 @@ import Identicon from '~/components/Identicon'
|
||||||
import { composeValidators, required, minMaxLength } from '~/components/forms/validator'
|
import { composeValidators, required, minMaxLength } from '~/components/forms/validator'
|
||||||
import { getNotificationsFromTxType, showSnackbar } from '~/logic/notifications'
|
import { getNotificationsFromTxType, showSnackbar } from '~/logic/notifications'
|
||||||
import { TX_NOTIFICATION_TYPES } from '~/logic/safe/transactions'
|
import { TX_NOTIFICATION_TYPES } from '~/logic/safe/transactions'
|
||||||
import { getEtherScanLink } from '~/logic/wallets/getWeb3'
|
|
||||||
import Modal from '~/components/Modal'
|
import Modal from '~/components/Modal'
|
||||||
import { styles } from './style'
|
import { styles } from './style'
|
||||||
import { secondary } from '~/theme/variables'
|
import { sm } from '~/theme/variables'
|
||||||
|
|
||||||
export const RENAME_OWNER_INPUT_TEST_ID = 'rename-owner-input'
|
export const RENAME_OWNER_INPUT_TEST_ID = 'rename-owner-input'
|
||||||
export const SAVE_OWNER_CHANGES_BTN_TEST_ID = 'save-owner-changes-btn'
|
export const SAVE_OWNER_CHANGES_BTN_TEST_ID = 'save-owner-changes-btn'
|
||||||
|
|
||||||
const openIconStyle = {
|
|
||||||
height: '16px',
|
|
||||||
color: secondary,
|
|
||||||
}
|
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
onClose: () => void,
|
onClose: () => void,
|
||||||
classes: Object,
|
classes: Object,
|
||||||
|
@ -100,12 +94,11 @@ const EditOwnerComponent = ({
|
||||||
<Row>
|
<Row>
|
||||||
<Block justify="center" className={classes.user}>
|
<Block justify="center" className={classes.user}>
|
||||||
<Identicon address={ownerAddress} diameter={32} />
|
<Identicon address={ownerAddress} diameter={32} />
|
||||||
<Paragraph style={{ marginLeft: 10 }} size="md" color="disabled" noMargin>
|
<Paragraph style={{ marginLeft: sm, marginRight: sm }} size="md" color="disabled" noMargin>
|
||||||
{ownerAddress}
|
{ownerAddress}
|
||||||
</Paragraph>
|
</Paragraph>
|
||||||
<Link className={classes.open} to={getEtherScanLink('address', ownerAddress)} target="_blank">
|
<CopyBtn content={safeAddress} />
|
||||||
<OpenInNew style={openIconStyle} />
|
<EtherscanBtn type="address" value={safeAddress} />
|
||||||
</Link>
|
|
||||||
</Block>
|
</Block>
|
||||||
</Row>
|
</Row>
|
||||||
</Block>
|
</Block>
|
||||||
|
@ -114,7 +107,14 @@ const EditOwnerComponent = ({
|
||||||
<Button minWidth={140} minHeight={42} onClick={onClose}>
|
<Button minWidth={140} minHeight={42} onClick={onClose}>
|
||||||
Cancel
|
Cancel
|
||||||
</Button>
|
</Button>
|
||||||
<Button type="submit" variant="contained" minWidth={140} minHeight={42} color="primary" testId={SAVE_OWNER_CHANGES_BTN_TEST_ID}>
|
<Button
|
||||||
|
type="submit"
|
||||||
|
variant="contained"
|
||||||
|
minWidth={140}
|
||||||
|
minHeight={42}
|
||||||
|
color="primary"
|
||||||
|
testId={SAVE_OWNER_CHANGES_BTN_TEST_ID}
|
||||||
|
>
|
||||||
Save
|
Save
|
||||||
</Button>
|
</Button>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
Loading…
Reference in New Issue