From 52a6e6357b521e3e290103ba31ab91e9ede79d5c Mon Sep 17 00:00:00 2001 From: fragosti Date: Thu, 19 Jul 2018 06:57:00 -0700 Subject: Add lifecycle messages --- .../flash_messages/asset_send_completed.tsx | 35 ++++++++++++++++++++++ .../flash_messages/token_send_completed.tsx | 34 --------------------- 2 files changed, 35 insertions(+), 34 deletions(-) create mode 100644 packages/website/ts/components/flash_messages/asset_send_completed.tsx delete mode 100644 packages/website/ts/components/flash_messages/token_send_completed.tsx (limited to 'packages/website/ts/components/flash_messages') diff --git a/packages/website/ts/components/flash_messages/asset_send_completed.tsx b/packages/website/ts/components/flash_messages/asset_send_completed.tsx new file mode 100644 index 000000000..2c48f501b --- /dev/null +++ b/packages/website/ts/components/flash_messages/asset_send_completed.tsx @@ -0,0 +1,35 @@ +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 { Token } from 'ts/types'; +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} +
+ ); + } +} diff --git a/packages/website/ts/components/flash_messages/token_send_completed.tsx b/packages/website/ts/components/flash_messages/token_send_completed.tsx deleted file mode 100644 index f3f1ea2fc..000000000 --- a/packages/website/ts/components/flash_messages/token_send_completed.tsx +++ /dev/null @@ -1,34 +0,0 @@ -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 { Token } from 'ts/types'; -import { utils } from 'ts/utils/utils'; - -interface TokenSendCompletedProps { - etherScanLinkIfExists?: string; - token: Token; - toAddress: string; - amountInBaseUnits: BigNumber; -} - -interface TokenSendCompletedState {} - -export class TokenSendCompleted 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.token.decimals); - const truncatedAddress = utils.getAddressBeginAndEnd(this.props.toAddress); - return ( -
- {`Sent ${amountInUnits} ${this.props.token.symbol} to ${truncatedAddress}: `} - {etherScanLink} -
- ); - } -} -- cgit