diff options
Diffstat (limited to 'ui/app/components/selected-account')
5 files changed, 0 insertions, 125 deletions
diff --git a/ui/app/components/selected-account/index.js b/ui/app/components/selected-account/index.js deleted file mode 100644 index eb342181f..000000000 --- a/ui/app/components/selected-account/index.js +++ /dev/null @@ -1,2 +0,0 @@ -import SelectedAccount from './selected-account.container' -module.exports = SelectedAccount diff --git a/ui/app/components/selected-account/index.scss b/ui/app/components/selected-account/index.scss deleted file mode 100644 index 5339a228b..000000000 --- a/ui/app/components/selected-account/index.scss +++ /dev/null @@ -1,38 +0,0 @@ -.selected-account { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - flex: 1; - - &__name { - max-width: 200px; - text-overflow: ellipsis; - overflow: hidden; - white-space: nowrap; - text-align: center; - } - - &__address { - font-size: .75rem; - color: $silver-chalice; - } - - &__clickable { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - padding: 5px 15px; - border-radius: 10px; - cursor: pointer; - - &:hover { - background-color: #e8e6e8; - } - - &:active { - background-color: #d9d7da; - } - } -} diff --git a/ui/app/components/selected-account/selected-account.component.js b/ui/app/components/selected-account/selected-account.component.js deleted file mode 100644 index 47c56e312..000000000 --- a/ui/app/components/selected-account/selected-account.component.js +++ /dev/null @@ -1,55 +0,0 @@ -import React, { Component } from 'react' -import PropTypes from 'prop-types' -import copyToClipboard from 'copy-to-clipboard' -import { addressSlicer, checksumAddress } from '../../util' - -const Tooltip = require('../tooltip-v2.js').default - -class SelectedAccount extends Component { - state = { - copied: false, - } - - static contextTypes = { - t: PropTypes.func, - } - - static propTypes = { - selectedAddress: PropTypes.string, - selectedIdentity: PropTypes.object, - network: PropTypes.string, - } - - render () { - const { t } = this.context - const { selectedAddress, selectedIdentity, network } = this.props - const checksummedAddress = checksumAddress(selectedAddress, network) - - return ( - <div className="selected-account"> - <Tooltip - position="bottom" - title={this.state.copied ? t('copiedExclamation') : t('copyToClipboard')} - > - <div - className="selected-account__clickable" - onClick={() => { - this.setState({ copied: true }) - setTimeout(() => this.setState({ copied: false }), 3000) - copyToClipboard(checksummedAddress) - }} - > - <div className="selected-account__name"> - { selectedIdentity.name } - </div> - <div className="selected-account__address"> - { addressSlicer(checksummedAddress) } - </div> - </div> - </Tooltip> - </div> - ) - } -} - -export default SelectedAccount diff --git a/ui/app/components/selected-account/selected-account.container.js b/ui/app/components/selected-account/selected-account.container.js deleted file mode 100644 index 1c8d17d8d..000000000 --- a/ui/app/components/selected-account/selected-account.container.js +++ /dev/null @@ -1,14 +0,0 @@ -import { connect } from 'react-redux' -import SelectedAccount from './selected-account.component' - -const selectors = require('../../selectors') - -const mapStateToProps = state => { - return { - selectedAddress: selectors.getSelectedAddress(state), - selectedIdentity: selectors.getSelectedIdentity(state), - network: state.metamask.network, - } -} - -export default connect(mapStateToProps)(SelectedAccount) diff --git a/ui/app/components/selected-account/tests/selected-account-component.test.js b/ui/app/components/selected-account/tests/selected-account-component.test.js deleted file mode 100644 index 78a94d1c8..000000000 --- a/ui/app/components/selected-account/tests/selected-account-component.test.js +++ /dev/null @@ -1,16 +0,0 @@ -import React from 'react' -import assert from 'assert' -import { render } from 'enzyme' -import SelectedAccount from '../selected-account.component' - -describe('SelectedAccount Component', () => { - it('should render checksummed address', () => { - const wrapper = render(<SelectedAccount - selectedAddress="0x1b82543566f41a7db9a9a75fc933c340ffb55c9d" - selectedIdentity={{ name: 'testName' }} - />, { context: { t: () => {}}}) - // Checksummed version of address is displayed - assert.equal(wrapper.find('.selected-account__address').text(), '0x1B82...5C9D') - assert.equal(wrapper.find('.selected-account__name').text(), 'testName') - }) -}) |