aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/modals/account-details-modal.js
diff options
context:
space:
mode:
authorAlexander Tseung <alextsg@gmail.com>2017-10-26 09:23:46 +0800
committerChi Kei Chan <chikeichan@gmail.com>2017-10-26 09:44:24 +0800
commit22d9e3a7e6dfd21b3ea52007030d71f53e29b851 (patch)
tree70cf675df91d5fe05185a99b72cb4edf44b5ba9a /ui/app/components/modals/account-details-modal.js
parentfa95303e1efef03db6c44878b89ccca680639598 (diff)
downloadtangerine-wallet-browser-22d9e3a7e6dfd21b3ea52007030d71f53e29b851.tar
tangerine-wallet-browser-22d9e3a7e6dfd21b3ea52007030d71f53e29b851.tar.gz
tangerine-wallet-browser-22d9e3a7e6dfd21b3ea52007030d71f53e29b851.tar.bz2
tangerine-wallet-browser-22d9e3a7e6dfd21b3ea52007030d71f53e29b851.tar.lz
tangerine-wallet-browser-22d9e3a7e6dfd21b3ea52007030d71f53e29b851.tar.xz
tangerine-wallet-browser-22d9e3a7e6dfd21b3ea52007030d71f53e29b851.tar.zst
tangerine-wallet-browser-22d9e3a7e6dfd21b3ea52007030d71f53e29b851.zip
Allow editing account name in account details modal
Diffstat (limited to 'ui/app/components/modals/account-details-modal.js')
-rw-r--r--ui/app/components/modals/account-details-modal.js21
1 files changed, 13 insertions, 8 deletions
diff --git a/ui/app/components/modals/account-details-modal.js b/ui/app/components/modals/account-details-modal.js
index 37a62e1c0..e3c936702 100644
--- a/ui/app/components/modals/account-details-modal.js
+++ b/ui/app/components/modals/account-details-modal.js
@@ -7,6 +7,7 @@ const AccountModalContainer = require('./account-modal-container')
const { getSelectedIdentity, getSelectedAddress } = require('../../selectors')
const genAccountLink = require('../../../lib/account-link.js')
const QrView = require('../qr-code')
+const EditableLabel = require('../editable-label')
function mapStateToProps (state) {
return {
@@ -23,6 +24,7 @@ function mapDispatchToProps (dispatch) {
dispatch(actions.showModal({ name: 'EXPORT_PRIVATE_KEY' }))
},
hideModal: () => dispatch(actions.hideModal()),
+ saveAccountLabel: (address, label) => dispatch(actions.saveAccountLabel(address, label)),
}
}
@@ -41,14 +43,19 @@ AccountDetailsModal.prototype.render = function () {
selectedIdentity,
network,
showExportPrivateKeyModal,
- hideModal,
+ saveAccountLabel,
} = this.props
const { name, address } = selectedIdentity
return h(AccountModalContainer, {}, [
+ h(EditableLabel, {
+ className: 'account-modal__name',
+ defaultValue: name,
+ onSubmit: label => saveAccountLabel(address, label),
+ }),
+
h(QrView, {
Qr: {
- message: name,
data: address,
},
}),
@@ -57,14 +64,12 @@ AccountDetailsModal.prototype.render = function () {
h('button.btn-clear', {
onClick: () => global.platform.openWindow({ url: genAccountLink(address, network) }),
- }, [ 'View account on Etherscan' ]),
+ }, 'View account on Etherscan'),
// Holding on redesign for Export Private Key functionality
h('button.btn-clear', {
- onClick: () => {
- showExportPrivateKeyModal()
- },
- }, [ 'Export private key' ]),
-
+ onClick: () => showExportPrivateKeyModal(),
+ }, 'Export private key'),
+
])
}