Replace AddressInfo by EthHashInfo

This commit is contained in:
nicosampler 2020-08-04 15:29:29 -03:00
parent 7f3a99b7f1
commit a21de8be18
6 changed files with 22 additions and 28 deletions

View File

@ -3,7 +3,7 @@ import Dot from '@material-ui/icons/FiberManualRecord'
import classNames from 'classnames' import classNames from 'classnames'
import * as React from 'react' import * as React from 'react'
import { Identicon } from '@gnosis.pm/safe-react-components' import { Identicon } from '@gnosis.pm/safe-react-components'
import { AddressInfo } from '@gnosis.pm/safe-react-components' import { EthHashInfo } from '@gnosis.pm/safe-react-components'
import CircleDot from 'src/components/Header/components/CircleDot' import CircleDot from 'src/components/Header/components/CircleDot'
import Spacer from 'src/components/Spacer' import Spacer from 'src/components/Spacer'
@ -105,7 +105,7 @@ const UserDetails = ({ classes, connected, network, onDisconnect, openDashboard,
</Row> </Row>
<Block className={classes.user} justify="center"> <Block className={classes.user} justify="center">
{userAddress ? ( {userAddress ? (
<AddressInfo address={userAddress} showCopyBtn showEtherscanBtn shortenAddress={4} network={network} /> <EthHashInfo hash={userAddress} showCopyBtn showEtherscanBtn shortenHash={4} network={network} />
) : ( ) : (
'Address not available' 'Address not available'
)} )}

View File

@ -1,6 +1,6 @@
import { makeStyles } from '@material-ui/core/styles' import { makeStyles } from '@material-ui/core/styles'
import * as React from 'react' import * as React from 'react'
import { AddressInfo, Text } from '@gnosis.pm/safe-react-components' import { EthHashInfo, Text } from '@gnosis.pm/safe-react-components'
import NetworkLabel from '../NetworkLabel' import NetworkLabel from '../NetworkLabel'
import CircleDot from 'src/components/Header/components/CircleDot' import CircleDot from 'src/components/Header/components/CircleDot'
@ -86,9 +86,9 @@ const ProviderInfo = ({ connected, provider, userAddress, network }: ProviderInf
</Paragraph> </Paragraph>
<div className={classes.providerContainer}> <div className={classes.providerContainer}>
{connected ? ( {connected ? (
<AddressInfo <EthHashInfo
address={userAddress} hash={userAddress}
shortenAddress={4} shortenHash={4}
showIdenticon showIdenticon
identiconSize="xs" identiconSize="xs"
textColor={addressColor} textColor={addressColor}

View File

@ -1,7 +1,7 @@
import MuiList from '@material-ui/core/List' import MuiList from '@material-ui/core/List'
import ListItem from '@material-ui/core/ListItem' import ListItem from '@material-ui/core/ListItem'
import { makeStyles } from '@material-ui/core/styles' import { makeStyles } from '@material-ui/core/styles'
import { AddressInfo, Icon, Text, ButtonLink } from '@gnosis.pm/safe-react-components' import { EthHashInfo, Icon, Text, ButtonLink } from '@gnosis.pm/safe-react-components'
import * as React from 'react' import * as React from 'react'
import styled from 'styled-components' import styled from 'styled-components'
@ -109,11 +109,11 @@ const SafeList = ({ currentSafe, defaultSafe, onSafeClick, safes, setDefaultSafe
)} )}
<AddressWrapper> <AddressWrapper>
<AddressInfo <EthHashInfo
address={safe.address} hash={safe.address}
name={safe.name} name={safe.name}
showIdenticon showIdenticon
shortenAddress={4} shortenHash={4}
network={getNetwork()} network={getNetwork()}
/> />

View File

@ -1,6 +1,6 @@
import { makeStyles } from '@material-ui/core/styles' import { makeStyles } from '@material-ui/core/styles'
import React from 'react' import React from 'react'
import { AddressInfo } from '@gnosis.pm/safe-react-components' import { EthHashInfo } from '@gnosis.pm/safe-react-components'
import { getNetwork } from 'src/config' import { getNetwork } from 'src/config'
import { Transaction } from 'src/routes/safe/store/models/types/transaction' import { Transaction } from 'src/routes/safe/store/models/types/transaction'
@ -46,7 +46,7 @@ export const CreationTx = ({ tx }: Props): React.ReactElement => {
<Block align="left" className={classes.txData}> <Block align="left" className={classes.txData}>
<Bold className={classes.txHash}>Creator:</Bold> <Bold className={classes.txHash}>Creator:</Bold>
{tx.creator ? ( {tx.creator ? (
<AddressInfo address={tx.creator} shortenAddress={4} showCopyBtn showEtherscanBtn network={getNetwork()} /> <EthHashInfo hash={tx.creator} shortenHash={4} showCopyBtn showEtherscanBtn network={getNetwork()} />
) : ( ) : (
'n/a' 'n/a'
)} )}
@ -54,13 +54,7 @@ export const CreationTx = ({ tx }: Props): React.ReactElement => {
<Block align="left" className={classes.txData}> <Block align="left" className={classes.txData}>
<Bold className={classes.txHash}>Factory:</Bold> <Bold className={classes.txHash}>Factory:</Bold>
{tx.factoryAddress ? ( {tx.factoryAddress ? (
<AddressInfo <EthHashInfo hash={tx.factoryAddress} shortenHash={4} showCopyBtn showEtherscanBtn network={getNetwork()} />
address={tx.factoryAddress}
shortenAddress={4}
showCopyBtn
showEtherscanBtn
network={getNetwork()}
/>
) : ( ) : (
'n/a' 'n/a'
)} )}
@ -68,7 +62,7 @@ export const CreationTx = ({ tx }: Props): React.ReactElement => {
<Block align="left" className={classes.txData}> <Block align="left" className={classes.txData}>
<Bold className={classes.txHash}>Mastercopy:</Bold> <Bold className={classes.txHash}>Mastercopy:</Bold>
{tx.masterCopy ? ( {tx.masterCopy ? (
<AddressInfo address={tx.masterCopy} shortenAddress={4} showCopyBtn showEtherscanBtn network={getNetwork()} /> <EthHashInfo hash={tx.masterCopy} shortenHash={4} showCopyBtn showEtherscanBtn network={getNetwork()} />
) : ( ) : (
'n/a' 'n/a'
)} )}

View File

@ -2,7 +2,7 @@ import { withStyles } from '@material-ui/core/styles'
import cn from 'classnames' import cn from 'classnames'
import React from 'react' import React from 'react'
import { useSelector } from 'react-redux' import { useSelector } from 'react-redux'
import { AddressInfo } from '@gnosis.pm/safe-react-components' import { EthHashInfo } from '@gnosis.pm/safe-react-components'
import { getNetwork } from 'src/config' import { getNetwork } from 'src/config'
import CancelSmallFilledCircle from './assets/cancel-small-filled.svg' import CancelSmallFilledCircle from './assets/cancel-small-filled.svg'
@ -152,10 +152,10 @@ const OwnerComponent = ({
<div className={classes.circleState}> <div className={classes.circleState}>
<Img alt="" src={imgCircle} /> <Img alt="" src={imgCircle} />
</div> </div>
<AddressInfo <EthHashInfo
address={owner} hash={owner}
name={nameInAdbk} name={nameInAdbk}
shortenAddress={4} shortenHash={4}
showIdenticon showIdenticon
showCopyBtn showCopyBtn
showEtherscanBtn showEtherscanBtn

View File

@ -2,7 +2,7 @@ import { makeStyles } from '@material-ui/core/styles'
import cn from 'classnames' import cn from 'classnames'
import React, { useState } from 'react' import React, { useState } from 'react'
import { useSelector } from 'react-redux' import { useSelector } from 'react-redux'
import { AddressInfo } from '@gnosis.pm/safe-react-components' import { EthHashInfo } from '@gnosis.pm/safe-react-components'
import ApproveTxModal from './ApproveTxModal' import ApproveTxModal from './ApproveTxModal'
import OwnersColumn from './OwnersColumn' import OwnersColumn from './OwnersColumn'
@ -67,9 +67,9 @@ const ExpandedTx = ({ cancelTx, tx }: Props): React.ReactElement => {
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<Bold className={classes.txHash}>Hash:</Bold> <Bold className={classes.txHash}>Hash:</Bold>
{tx.executionTxHash ? ( {tx.executionTxHash ? (
<AddressInfo <EthHashInfo
address={tx.executionTxHash} hash={tx.executionTxHash}
shortenAddress={4} shortenHash={4}
showCopyBtn showCopyBtn
showEtherscanBtn showEtherscanBtn
network={getNetwork()} network={getNetwork()}