From 09450fe7657408df342ff9bc65c644b64cc9fca9 Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Thu, 2 Apr 2020 11:49:19 -0230 Subject: [PATCH] Remove selectedAddress from SelectedAccount component (#8285) --- .../app/selected-account/selected-account.component.js | 7 +++---- .../app/selected-account/selected-account.container.js | 3 +-- .../tests/selected-account-component.test.js | 3 +-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/ui/app/components/app/selected-account/selected-account.component.js b/ui/app/components/app/selected-account/selected-account.component.js index 536e77572..5b7936656 100644 --- a/ui/app/components/app/selected-account/selected-account.component.js +++ b/ui/app/components/app/selected-account/selected-account.component.js @@ -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 (
diff --git a/ui/app/components/app/selected-account/selected-account.container.js b/ui/app/components/app/selected-account/selected-account.container.js index 571dc746e..4f1061aee 100644 --- a/ui/app/components/app/selected-account/selected-account.container.js +++ b/ui/app/components/app/selected-account/selected-account.container.js @@ -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), } } diff --git a/ui/app/components/app/selected-account/tests/selected-account-component.test.js b/ui/app/components/app/selected-account/tests/selected-account-component.test.js index 60d34b178..73b659e10 100644 --- a/ui/app/components/app/selected-account/tests/selected-account-component.test.js +++ b/ui/app/components/app/selected-account/tests/selected-account-component.test.js @@ -7,8 +7,7 @@ describe('SelectedAccount Component', function () { it('should render checksummed address', function () { const wrapper = render(( ), { context: { t: () => {} } }) // Checksummed version of address is displayed