Ensures that new accounts are only created from the modal, and not when clicking 'Create New Account'

feature/default_network_editable
Dan 7 years ago committed by Chi Kei Chan
parent feb90f2fc4
commit b0f1fba2e5
  1. 5
      ui/app/components/dropdowns/components/account-dropdowns.js
  2. 8
      ui/app/components/modals/new-account-modal.js
  3. 1
      ui/app/css/itcss/components/modal.scss

@ -162,11 +162,11 @@ class AccountDropdowns extends Component {
DropdownMenuItem, DropdownMenuItem,
{ {
closeMenu: () => {}, closeMenu: () => {},
onClick: () => actions.addNewAccount(),
style: Object.assign( style: Object.assign(
{}, {},
menuItemStyles, menuItemStyles,
), ),
onClick: () => actions.showNewAccountModal(),
}, },
[ [
h( h(
@ -185,9 +185,6 @@ class AccountDropdowns extends Component {
fontSize: '16px', fontSize: '16px',
lineHeight: '23px', lineHeight: '23px',
}, },
onClick: () => {
actions.showNewAccountModal()
},
}, 'Create Account'), }, 'Create Account'),
], ],
), ),

@ -19,6 +19,10 @@ function mapDispatchToProps (dispatch) {
hideModal: () => { hideModal: () => {
dispatch(actions.hideModal()) dispatch(actions.hideModal())
}, },
createAccount: () => {
dispatch(actions.addNewAccount())
dispatch(actions.hideModal())
},
} }
} }
@ -60,7 +64,9 @@ NewAccountModal.prototype.render = function () {
]), ]),
h('div.new-account-modal-content.button', {}, [ h('div.new-account-modal-content.button', {}, [
h('button.btn-clear', {}, [ h('button.btn-clear', {
onClick: this.props.createAccount
}, [
'SAVE', 'SAVE',
]), ]),
]), ]),

@ -284,6 +284,7 @@
top: 25px; top: 25px;
right: 17.5px; right: 17.5px;
font-family: sans-serif; font-family: sans-serif;
cursor: pointer;
} }
.new-account-modal-content { .new-account-modal-content {

Loading…
Cancel
Save