import { colors } from '@0xproject/react-shared'; import { BigNumber } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as _ from 'lodash'; import * as React from 'react'; import { utils } from 'ts/utils/utils'; interface AssetSendCompletedProps { etherScanLinkIfExists?: string; toAddress: string; amountInBaseUnits: BigNumber; decimals: number; symbol: string; } interface AssetSendCompletedState {} export class AssetSendCompleted extends React.Component { public render(): React.ReactNode { const etherScanLink = !_.isUndefined(this.props.etherScanLinkIfExists) && ( Verify on Etherscan ); const amountInUnits = Web3Wrapper.toUnitAmount(this.props.amountInBaseUnits, this.props.decimals); const truncatedAddress = utils.getAddressBeginAndEnd(this.props.toAddress); return (
{`Sent ${amountInUnits} ${this.props.symbol} to ${truncatedAddress}: `} {etherScanLink}
); } }