From 52a6e6357b521e3e290103ba31ab91e9ede79d5c Mon Sep 17 00:00:00 2001
From: fragosti <francesco.agosti93@gmail.com>
Date: Thu, 19 Jul 2018 06:57:00 -0700
Subject: Add lifecycle messages

---
 .../flash_messages/asset_send_completed.tsx        | 35 ++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 packages/website/ts/components/flash_messages/asset_send_completed.tsx

(limited to 'packages/website/ts/components/flash_messages/asset_send_completed.tsx')

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<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.decimals);
+        const truncatedAddress = utils.getAddressBeginAndEnd(this.props.toAddress);
+        return (
+            <div>
+                {`Sent ${amountInUnits} ${this.props.symbol} to ${truncatedAddress}: `}
+                {etherScanLink}
+            </div>
+        );
+    }
+}
-- 
cgit v1.2.3

