mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Removing unused prop/code paths from EditContact (#12419)
This commit is contained in:
parent
3f687ff45f
commit
1a1fa3aac5
@ -25,8 +25,6 @@ export default class EditContact extends PureComponent {
|
||||
memo: PropTypes.string,
|
||||
viewRoute: PropTypes.string,
|
||||
listRoute: PropTypes.string,
|
||||
setAccountLabel: PropTypes.func,
|
||||
showingMyAccounts: PropTypes.bool.isRequired,
|
||||
};
|
||||
|
||||
static defaultProps = {
|
||||
@ -52,8 +50,6 @@ export default class EditContact extends PureComponent {
|
||||
memo,
|
||||
name,
|
||||
removeFromAddressBook,
|
||||
setAccountLabel,
|
||||
showingMyAccounts,
|
||||
viewRoute,
|
||||
} = this.props;
|
||||
|
||||
@ -65,7 +61,6 @@ export default class EditContact extends PureComponent {
|
||||
<div className="settings-page__content-row address-book__edit-contact">
|
||||
<div className="settings-page__header address-book__header--edit">
|
||||
<Identicon address={address} diameter={60} />
|
||||
{showingMyAccounts ? null : (
|
||||
<Button
|
||||
type="link"
|
||||
className="settings-page__address-book-button"
|
||||
@ -76,7 +71,6 @@ export default class EditContact extends PureComponent {
|
||||
>
|
||||
{t('deleteAccount')}
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
<div className="address-book__edit-contact__content">
|
||||
<div className="address-book__view-contact__group">
|
||||
@ -157,12 +151,6 @@ export default class EditContact extends PureComponent {
|
||||
this.state.newName || name,
|
||||
this.state.newMemo || memo,
|
||||
);
|
||||
if (showingMyAccounts) {
|
||||
setAccountLabel(
|
||||
this.state.newAddress,
|
||||
this.state.newName || name,
|
||||
);
|
||||
}
|
||||
history.push(listRoute);
|
||||
} else {
|
||||
this.setState({ error: this.context.t('invalidAddress') });
|
||||
@ -174,9 +162,6 @@ export default class EditContact extends PureComponent {
|
||||
this.state.newName || name,
|
||||
this.state.newMemo || memo,
|
||||
);
|
||||
if (showingMyAccounts) {
|
||||
setAccountLabel(address, this.state.newName || name);
|
||||
}
|
||||
history.push(listRoute);
|
||||
}
|
||||
}}
|
||||
|
@ -9,7 +9,6 @@ import {
|
||||
import {
|
||||
addToAddressBook,
|
||||
removeFromAddressBook,
|
||||
setAccountLabel,
|
||||
} from '../../../../store/actions';
|
||||
import EditContact from './edit-contact.component';
|
||||
|
||||
@ -44,8 +43,6 @@ const mapDispatchToProps = (dispatch) => {
|
||||
dispatch(addToAddressBook(recipient, nickname, memo)),
|
||||
removeFromAddressBook: (chainId, addressToRemove) =>
|
||||
dispatch(removeFromAddressBook(chainId, addressToRemove)),
|
||||
setAccountLabel: (address, label) =>
|
||||
dispatch(setAccountLabel(address, label)),
|
||||
};
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user