From e9b69bceab88355d459ab7d0c396ceb20848f795 Mon Sep 17 00:00:00 2001 From: Jannis R Date: Thu, 10 Nov 2016 18:09:54 +0100 Subject: [PATCH] Account Header: use CopyToClipboard --- js/src/views/Account/Header/header.css | 4 +- js/src/views/Account/Header/header.js | 58 ++------------------------ 2 files changed, 6 insertions(+), 56 deletions(-) diff --git a/js/src/views/Account/Header/header.css b/js/src/views/Account/Header/header.css index ff3f985c3..74390face 100644 --- a/js/src/views/Account/Header/header.css +++ b/js/src/views/Account/Header/header.css @@ -43,6 +43,6 @@ } .address { - white-space: nowrap; - font-family: monospace; + display: inline-block; + margin-left: .5em; } diff --git a/js/src/views/Account/Header/header.js b/js/src/views/Account/Header/header.js index d4b01cf56..66f0a36b9 100644 --- a/js/src/views/Account/Header/header.js +++ b/js/src/views/Account/Header/header.js @@ -15,13 +15,9 @@ // along with Parity. If not, see . import React, { Component, PropTypes } from 'react'; -import CopyToClipboard from 'react-copy-to-clipboard'; -import IconButton from 'material-ui/IconButton'; -import Snackbar from 'material-ui/Snackbar'; -import CopyIcon from 'material-ui/svg-icons/content/content-copy'; -import { lightWhite, fullWhite, darkBlack } from 'material-ui/styles/colors'; import { Balance, Container, ContainerTitle, IdentityIcon, IdentityName, Tags } from '../../../ui'; +import CopyToClipboard from '../../../ui/CopyToClipboard'; import styles from './header.css'; @@ -37,8 +33,7 @@ export default class Header extends Component { } state = { - name: null, - addressCopied: false + name: null } componentWillMount () { @@ -51,7 +46,6 @@ export default class Header extends Component { render () { const { account, balance } = this.props; - const { addressCopied } = this.state; const { address, meta, uuid } = account; if (!account) { @@ -64,50 +58,14 @@ export default class Header extends Component { return (
- - - Address - { address } - copied to clipboard - - } - autoHideDuration={ 4000 } - onRequestClose={ this.handleCopyAddressClose } - bodyStyle={ { - backgroundColor: darkBlack - } } - /> -
} />
- - - - - - { address } + +
{ address }
{ uuidText }
@@ -157,14 +115,6 @@ export default class Header extends Component { }); } - handleCopyAddress = () => { - this.setState({ addressCopied: true }); - } - - handleCopyAddressClose = () => { - this.setState({ addressCopied: false }); - } - setName () { const { account } = this.props;