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,
|
memo: PropTypes.string,
|
||||||
viewRoute: PropTypes.string,
|
viewRoute: PropTypes.string,
|
||||||
listRoute: PropTypes.string,
|
listRoute: PropTypes.string,
|
||||||
setAccountLabel: PropTypes.func,
|
|
||||||
showingMyAccounts: PropTypes.bool.isRequired,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
@ -52,8 +50,6 @@ export default class EditContact extends PureComponent {
|
|||||||
memo,
|
memo,
|
||||||
name,
|
name,
|
||||||
removeFromAddressBook,
|
removeFromAddressBook,
|
||||||
setAccountLabel,
|
|
||||||
showingMyAccounts,
|
|
||||||
viewRoute,
|
viewRoute,
|
||||||
} = this.props;
|
} = 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__content-row address-book__edit-contact">
|
||||||
<div className="settings-page__header address-book__header--edit">
|
<div className="settings-page__header address-book__header--edit">
|
||||||
<Identicon address={address} diameter={60} />
|
<Identicon address={address} diameter={60} />
|
||||||
{showingMyAccounts ? null : (
|
|
||||||
<Button
|
<Button
|
||||||
type="link"
|
type="link"
|
||||||
className="settings-page__address-book-button"
|
className="settings-page__address-book-button"
|
||||||
@ -76,7 +71,6 @@ export default class EditContact extends PureComponent {
|
|||||||
>
|
>
|
||||||
{t('deleteAccount')}
|
{t('deleteAccount')}
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
<div className="address-book__edit-contact__content">
|
<div className="address-book__edit-contact__content">
|
||||||
<div className="address-book__view-contact__group">
|
<div className="address-book__view-contact__group">
|
||||||
@ -157,12 +151,6 @@ export default class EditContact extends PureComponent {
|
|||||||
this.state.newName || name,
|
this.state.newName || name,
|
||||||
this.state.newMemo || memo,
|
this.state.newMemo || memo,
|
||||||
);
|
);
|
||||||
if (showingMyAccounts) {
|
|
||||||
setAccountLabel(
|
|
||||||
this.state.newAddress,
|
|
||||||
this.state.newName || name,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
history.push(listRoute);
|
history.push(listRoute);
|
||||||
} else {
|
} else {
|
||||||
this.setState({ error: this.context.t('invalidAddress') });
|
this.setState({ error: this.context.t('invalidAddress') });
|
||||||
@ -174,9 +162,6 @@ export default class EditContact extends PureComponent {
|
|||||||
this.state.newName || name,
|
this.state.newName || name,
|
||||||
this.state.newMemo || memo,
|
this.state.newMemo || memo,
|
||||||
);
|
);
|
||||||
if (showingMyAccounts) {
|
|
||||||
setAccountLabel(address, this.state.newName || name);
|
|
||||||
}
|
|
||||||
history.push(listRoute);
|
history.push(listRoute);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
@ -9,7 +9,6 @@ import {
|
|||||||
import {
|
import {
|
||||||
addToAddressBook,
|
addToAddressBook,
|
||||||
removeFromAddressBook,
|
removeFromAddressBook,
|
||||||
setAccountLabel,
|
|
||||||
} from '../../../../store/actions';
|
} from '../../../../store/actions';
|
||||||
import EditContact from './edit-contact.component';
|
import EditContact from './edit-contact.component';
|
||||||
|
|
||||||
@ -44,8 +43,6 @@ const mapDispatchToProps = (dispatch) => {
|
|||||||
dispatch(addToAddressBook(recipient, nickname, memo)),
|
dispatch(addToAddressBook(recipient, nickname, memo)),
|
||||||
removeFromAddressBook: (chainId, addressToRemove) =>
|
removeFromAddressBook: (chainId, addressToRemove) =>
|
||||||
dispatch(removeFromAddressBook(chainId, addressToRemove)),
|
dispatch(removeFromAddressBook(chainId, addressToRemove)),
|
||||||
setAccountLabel: (address, label) =>
|
|
||||||
dispatch(setAccountLabel(address, label)),
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user