aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/components/ui/ethereum_address.tsx
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-11-28 00:05:47 +0800
committerGitHub <noreply@github.com>2017-11-28 00:05:47 +0800
commit48b3d8526560d389e74beb12bbd64b7be6e9268f (patch)
tree00ae6e24314793cd303b154ede4fe4f55c654e84 /packages/website/ts/components/ui/ethereum_address.tsx
parentb5ce876327fe6443364837ea65cf28ec0e371949 (diff)
parentecfee00feca331ee1efa55165471d79774cb03d2 (diff)
downloaddexon-0x-contracts-48b3d8526560d389e74beb12bbd64b7be6e9268f.tar.gz
dexon-0x-contracts-48b3d8526560d389e74beb12bbd64b7be6e9268f.tar.zst
dexon-0x-contracts-48b3d8526560d389e74beb12bbd64b7be6e9268f.zip
Merge pull request #237 from 0xProject/addWebsite
Add Website to Mono Repo
Diffstat (limited to 'packages/website/ts/components/ui/ethereum_address.tsx')
-rw-r--r--packages/website/ts/components/ui/ethereum_address.tsx35
1 files changed, 35 insertions, 0 deletions
diff --git a/packages/website/ts/components/ui/ethereum_address.tsx b/packages/website/ts/components/ui/ethereum_address.tsx
new file mode 100644
index 000000000..c3d03b78c
--- /dev/null
+++ b/packages/website/ts/components/ui/ethereum_address.tsx
@@ -0,0 +1,35 @@
+import * as React from 'react';
+import {EtherScanIcon} from 'ts/components/ui/etherscan_icon';
+import ReactTooltip = require('react-tooltip');
+import {EtherscanLinkSuffixes} from 'ts/types';
+import {utils} from 'ts/utils/utils';
+
+interface EthereumAddressProps {
+ address: string;
+ networkId: number;
+}
+
+export const EthereumAddress = (props: EthereumAddressProps) => {
+ const tooltipId = `${props.address}-ethereum-address`;
+ const truncatedAddress = utils.getAddressBeginAndEnd(props.address);
+ return (
+ <div>
+ <div
+ className="inline"
+ style={{fontSize: 13}}
+ data-tip={true}
+ data-for={tooltipId}
+ >
+ {truncatedAddress}
+ </div>
+ <div className="pl1 inline">
+ <EtherScanIcon
+ addressOrTxHash={props.address}
+ networkId={props.networkId}
+ etherscanLinkSuffixes={EtherscanLinkSuffixes.address}
+ />
+ </div>
+ <ReactTooltip id={tooltipId}>{props.address}</ReactTooltip>
+ </div>
+ );
+};