1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Remove selectedAddress from SelectedAccount component (#8285)

This commit is contained in:
Whymarrh Whitby 2020-04-02 11:49:19 -02:30 committed by GitHub
parent 1b38b4867a
commit 09450fe765
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 8 deletions

View File

@ -15,14 +15,13 @@ class SelectedAccount extends Component {
}
static propTypes = {
selectedAddress: PropTypes.string,
selectedIdentity: PropTypes.object,
selectedIdentity: PropTypes.object.isRequired,
}
render () {
const { t } = this.context
const { selectedAddress, selectedIdentity } = this.props
const checksummedAddress = checksumAddress(selectedAddress)
const { selectedIdentity } = this.props
const checksummedAddress = checksumAddress(selectedIdentity.address)
return (
<div className="selected-account">

View File

@ -1,11 +1,10 @@
import { connect } from 'react-redux'
import SelectedAccount from './selected-account.component'
import { getSelectedAddress, getSelectedIdentity } from '../../../selectors/selectors'
import { getSelectedIdentity } from '../../../selectors/selectors'
const mapStateToProps = (state) => {
return {
selectedAddress: getSelectedAddress(state),
selectedIdentity: getSelectedIdentity(state),
}
}

View File

@ -7,8 +7,7 @@ describe('SelectedAccount Component', function () {
it('should render checksummed address', function () {
const wrapper = render((
<SelectedAccount
selectedAddress="0x1b82543566f41a7db9a9a75fc933c340ffb55c9d"
selectedIdentity={{ name: 'testName' }}
selectedIdentity={{ name: 'testName', address: '0x1b82543566f41a7db9a9a75fc933c340ffb55c9d' }}
/>
), { context: { t: () => {} } })
// Checksummed version of address is displayed