1249c0df71
* chore: initial commit * refactor: remove unnecessary wrappers * style: add missing newline * chore: bump bee-js * chore: ignore any cast in fdp * fix: remove cid import * fix: make TextEncoder and TextDecoder available in jest * refactor: dedupe stamp ttl second conversion * refactor: use convenience methods from bee-js * feat: update to bee-js for restored ens support * fix: bump bee-js to get download fix * fix: resolve feed before downloading reference * fix: fix token displays * fix: fix token input modal error message * refactor: remove wallet balance provider * chore: remove dead code * refactor: upcoming bee js 0.15.0 (#692) * chore: initial commit * fix: do not break page when duration seconds is 0 * ci: remove cache * chore: upgrade bee-js * feat: bee-js and bee v2.6 compatibility * chore: switch upcoming/bee-js to ethersphere/bee-js
57 lines
1.7 KiB
TypeScript
57 lines
1.7 KiB
TypeScript
import { Typography } from '@material-ui/core/'
|
|
import { EthAddress } from '@ethersphere/bee-js'
|
|
import { ReactElement } from 'react'
|
|
import Identicon from 'react-identicons'
|
|
import { BLOCKCHAIN_EXPLORER_URL } from '../constants'
|
|
import ClipboardCopy from './ClipboardCopy'
|
|
import { Flex } from './Flex'
|
|
import QRCodeModal from './QRCodeModal'
|
|
|
|
interface Props {
|
|
address: EthAddress | undefined
|
|
hideBlockie?: boolean
|
|
transaction?: boolean
|
|
truncate?: boolean
|
|
}
|
|
|
|
export default function EthereumAddress(props: Props): ReactElement {
|
|
return (
|
|
<Typography component="div" variant="subtitle1">
|
|
{props.address ? (
|
|
<Flex>
|
|
{props.hideBlockie ? null : (
|
|
<div style={{ paddingTop: '5px', marginRight: '10px' }}>
|
|
<Identicon size={20} string={props.address.toChecksum()} />
|
|
</div>
|
|
)}
|
|
<div>
|
|
<a
|
|
style={
|
|
props.truncate
|
|
? {
|
|
marginRight: '7px',
|
|
maxWidth: '200px',
|
|
overflow: 'hidden',
|
|
textOverflow: 'ellipsis',
|
|
whiteSpace: 'nowrap',
|
|
display: 'block',
|
|
}
|
|
: { marginRight: '7px' }
|
|
}
|
|
href={`${BLOCKCHAIN_EXPLORER_URL}/${props.transaction ? 'tx' : 'address'}/${props.address}`}
|
|
target="_blank"
|
|
rel="noreferrer"
|
|
>
|
|
{props.address}
|
|
</a>
|
|
</div>
|
|
<QRCodeModal value={props.address.toChecksum()} label={'Ethereum Address'} />
|
|
<ClipboardCopy value={props.address.toChecksum()} />
|
|
</Flex>
|
|
) : (
|
|
'-'
|
|
)}
|
|
</Typography>
|
|
)
|
|
}
|