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:
parent
1b38b4867a
commit
09450fe765
@ -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">
|
||||
|
@ -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),
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user