Add lifecycle messages

This commit is contained in:
fragosti
2018-07-19 06:57:00 -07:00
parent dead04dce8
commit 52a6e6357b
3 changed files with 56 additions and 17 deletions

View File

@@ -6,27 +6,28 @@ import * as React from 'react';
import { Token } from 'ts/types';
import { utils } from 'ts/utils/utils';
interface TokenSendCompletedProps {
interface AssetSendCompletedProps {
etherScanLinkIfExists?: string;
token: Token;
toAddress: string;
amountInBaseUnits: BigNumber;
decimals: number;
symbol: string;
}
interface TokenSendCompletedState {}
interface AssetSendCompletedState {}
export class TokenSendCompleted extends React.Component<TokenSendCompletedProps, TokenSendCompletedState> {
export class AssetSendCompleted extends React.Component<AssetSendCompletedProps, AssetSendCompletedState> {
public render(): React.ReactNode {
const etherScanLink = !_.isUndefined(this.props.etherScanLinkIfExists) && (
<a style={{ color: colors.white }} href={`${this.props.etherScanLinkIfExists}`} target="_blank">
Verify on Etherscan
</a>
);
const amountInUnits = Web3Wrapper.toUnitAmount(this.props.amountInBaseUnits, this.props.token.decimals);
const amountInUnits = Web3Wrapper.toUnitAmount(this.props.amountInBaseUnits, this.props.decimals);
const truncatedAddress = utils.getAddressBeginAndEnd(this.props.toAddress);
return (
<div>
{`Sent ${amountInUnits} ${this.props.token.symbol} to ${truncatedAddress}: `}
{`Sent ${amountInUnits} ${this.props.symbol} to ${truncatedAddress}: `}
{etherScanLink}
</div>
);