From df8b825a671b67733777b0a53420de506292d2be Mon Sep 17 00:00:00 2001 From: Thomas Date: Tue, 29 Oct 2019 16:14:18 -0700 Subject: [PATCH 1/4] Adjust copy-to-clipboard svg width and height on edit contact screen --- ui/app/pages/settings/contact-list-tab/index.scss | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/app/pages/settings/contact-list-tab/index.scss b/ui/app/pages/settings/contact-list-tab/index.scss index aad50c419..0e338450f 100644 --- a/ui/app/pages/settings/contact-list-tab/index.scss +++ b/ui/app/pages/settings/contact-list-tab/index.scss @@ -98,6 +98,8 @@ &--copy-icon { padding-left: 4px; + width: 30px; + height: 20px; } } From cbd1d47559a9113a4a72b383447a570205c7a79b Mon Sep 17 00:00:00 2001 From: Thomas Date: Tue, 29 Oct 2019 16:21:18 -0700 Subject: [PATCH 2/4] Allow removing of contact details to change details. --- .../edit-contact/edit-contact.component.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/ui/app/pages/settings/contact-list-tab/edit-contact/edit-contact.component.js b/ui/app/pages/settings/contact-list-tab/edit-contact/edit-contact.component.js index 975f10fa1..81ffb49dd 100644 --- a/ui/app/pages/settings/contact-list-tab/edit-contact/edit-contact.component.js +++ b/ui/app/pages/settings/contact-list-tab/edit-contact/edit-contact.component.js @@ -26,9 +26,9 @@ export default class EditContact extends PureComponent { } state = { - newName: '', - newAddress: '', - newMemo: '', + newName: this.props.name, + newAddress: this.props.address, + newMemo: this.props.memo, error: '', } @@ -59,8 +59,7 @@ export default class EditContact extends PureComponent { this.setState({ newName: e.target.value })} fullWidth margin="dense" @@ -74,8 +73,7 @@ export default class EditContact extends PureComponent { this.setState({ newAddress: e.target.value })} fullWidth @@ -91,7 +89,7 @@ export default class EditContact extends PureComponent { type="text" id="memo" placeholder={memo} - value={this.state.newMemo || memo} + value={this.state.newMemo} onChange={e => this.setState({ newMemo: e.target.value })} fullWidth margin="dense" @@ -110,12 +108,12 @@ export default class EditContact extends PureComponent { if (this.state.newAddress !== '' && this.state.newAddress !== address) { // if the user makes a valid change to the address field, remove the original address if (isValidAddress(this.state.newAddress)) { - removeFromAddressBook(address) + removeFromAddressBook(chainId, address) addToAddressBook(this.state.newAddress, this.state.newName || name, this.state.newMemo || memo) setAccountLabel(this.state.newAddress, this.state.newName || name) history.push(listRoute) } else { - this.setState({ error: 'invalid address' }) + this.setState({ error: this.context.t('invalidAddress') }) } } else { // update name From d90b3feab809002629c9317dda1e221dad521a2d Mon Sep 17 00:00:00 2001 From: Thomas Date: Tue, 29 Oct 2019 16:42:56 -0700 Subject: [PATCH 3/4] Add back placeholder addAlias for nickname --- .../contact-list-tab/edit-contact/edit-contact.component.js | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/app/pages/settings/contact-list-tab/edit-contact/edit-contact.component.js b/ui/app/pages/settings/contact-list-tab/edit-contact/edit-contact.component.js index 81ffb49dd..6af5dd567 100644 --- a/ui/app/pages/settings/contact-list-tab/edit-contact/edit-contact.component.js +++ b/ui/app/pages/settings/contact-list-tab/edit-contact/edit-contact.component.js @@ -59,6 +59,7 @@ export default class EditContact extends PureComponent { this.setState({ newName: e.target.value })} fullWidth From 9d793015d39b2483ac190b53ada93e1b43d136a8 Mon Sep 17 00:00:00 2001 From: Thomas Date: Tue, 29 Oct 2019 17:55:10 -0700 Subject: [PATCH 4/4] Add static defaultProps --- .../contact-list-tab/edit-contact/edit-contact.component.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ui/app/pages/settings/contact-list-tab/edit-contact/edit-contact.component.js b/ui/app/pages/settings/contact-list-tab/edit-contact/edit-contact.component.js index 6af5dd567..bab0253d6 100644 --- a/ui/app/pages/settings/contact-list-tab/edit-contact/edit-contact.component.js +++ b/ui/app/pages/settings/contact-list-tab/edit-contact/edit-contact.component.js @@ -25,6 +25,12 @@ export default class EditContact extends PureComponent { setAccountLabel: PropTypes.func, } + static defaultProps = { + name: '', + address: '', + memo: '', + } + state = { newName: this.props.name, newAddress: this.props.address,