1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

catching up with develop

This commit is contained in:
brunobar79 2018-07-12 13:19:51 -04:00
parent 07d8bfaec5
commit 4b528405ea
5 changed files with 80 additions and 27 deletions

44
package-lock.json generated
View File

@ -11853,9 +11853,9 @@
}
},
"ganache-core": {
"version": "2.1.4",
"resolved": "https://registry.npmjs.org/ganache-core/-/ganache-core-2.1.4.tgz",
"integrity": "sha512-wYpfArYA/pCgoQtsb5V8E62b580MnQfMQHuldWToc6Fa7Z5r5u8eB0oftxbrgbdJkR3oJkNykfc2clq0hgZfWQ==",
"version": "2.1.5",
"resolved": "https://registry.npmjs.org/ganache-core/-/ganache-core-2.1.5.tgz",
"integrity": "sha512-PuHUfISgrQknb7JpspxSzhpoYfqBWoOdTBHQj/81gu6YypRUHzD2Z6gZmFDxDzG30MFElEHp8JtexaGdgq9iYw==",
"dev": true,
"requires": {
"abstract-leveldown": "^3.0.0",
@ -11867,7 +11867,7 @@
"clone": "^2.1.1",
"ethereumjs-account": "~2.0.4",
"ethereumjs-block": "~1.2.2",
"ethereumjs-tx": "^1.3.0",
"ethereumjs-tx": "1.3.4",
"ethereumjs-util": "^5.2.0",
"ethereumjs-vm": "2.3.5",
"ethereumjs-wallet": "~0.6.0",
@ -12024,6 +12024,24 @@
}
}
},
"ethereumjs-tx": {
"version": "1.3.4",
"resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-1.3.4.tgz",
"integrity": "sha512-kOgUd5jC+0tgV7t52UDECMMz9Uf+Lro+6fSpCvzWemtXfMEcwI3EOxf5mVPMRbTFkMMhuERokNNVF3jItAjidg==",
"dev": true,
"requires": {
"ethereum-common": "^0.0.18",
"ethereumjs-util": "^5.0.0"
},
"dependencies": {
"ethereum-common": {
"version": "0.0.18",
"resolved": "https://registry.npmjs.org/ethereum-common/-/ethereum-common-0.0.18.tgz",
"integrity": "sha1-L9w1dvIykDNYl26znaeDIT/5Uj8=",
"dev": true
}
}
},
"ethereumjs-util": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz",
@ -12188,9 +12206,9 @@
"dev": true
},
"ws": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/ws/-/ws-5.2.1.tgz",
"integrity": "sha512-2NkHdPKjDBj3CHdnAGNpmlliryKqF+n9MYXX7/wsVC4yqYocKreKNjydPDvT3wShAZnndlM0RytEfTALCDvz7A==",
"version": "5.2.2",
"resolved": "https://registry.npmjs.org/ws/-/ws-5.2.2.tgz",
"integrity": "sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA==",
"dev": true,
"requires": {
"async-limiter": "~1.0.0"
@ -18644,9 +18662,9 @@
}
},
"log4js": {
"version": "2.10.0",
"resolved": "https://registry.npmjs.org/log4js/-/log4js-2.10.0.tgz",
"integrity": "sha512-NnhN9PjFF9zhxinAjlmDYvkqqrIW+yA3LLJAoTJ3fs6d1zru86OqQHfsxiUcc1kRq3z+faGR4DeyXUfiNbVxKQ==",
"version": "2.11.0",
"resolved": "https://registry.npmjs.org/log4js/-/log4js-2.11.0.tgz",
"integrity": "sha512-z1XdwyGFg8/WGkOyF6DPJjivCWNLKrklGdViywdYnSKOvgtEBo2UyEMZS5sD2mZrQlU3TvO8wDWLc8mzE1ncBQ==",
"dev": true,
"requires": {
"amqplib": "^0.5.2",
@ -18665,9 +18683,9 @@
},
"dependencies": {
"circular-json": {
"version": "0.5.4",
"resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.5.4.tgz",
"integrity": "sha512-vnJA8KS0BfOihugYEUkLRcnmq21FbuivbxgzDLXNs3zIk4KllV4Mx4UuTzBXht9F00C7QfD1YqMXg1zP6EXpig==",
"version": "0.5.5",
"resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.5.5.tgz",
"integrity": "sha512-13YaR6kiz0kBNmIVM87Io8Hp7bWOo4r61vkEANy8iH9R9bc6avud/1FT0SBpqR1RpIQADOh/Q+yHZDA1iL6ysA==",
"dev": true
},
"debug": {

View File

@ -238,7 +238,7 @@
"file-loader": "^1.1.11",
"fs-promise": "^2.0.3",
"ganache-cli": "^6.1.0",
"ganache-core": "^2.1.4",
"ganache-core": "^2.1.5",
"geckodriver": "^1.11.0",
"gh-pages": "^1.2.0",
"gifencoder": "^1.1.0",

View File

@ -69,8 +69,8 @@ function mapDispatchToProps (dispatch) {
dispatch(actions.hideSidebar())
dispatch(actions.toggleAccountMenu())
},
showRemoveAccountConfirmationModal: (address) => {
return dispatch(actions.showModal({ name: 'CONFIRM_REMOVE_ACCOUNT', address }))
showRemoveAccountConfirmationModal: (identity) => {
return dispatch(actions.showModal({ name: 'CONFIRM_REMOVE_ACCOUNT', identity }))
},
}
}
@ -193,13 +193,13 @@ AccountMenu.prototype.renderAccounts = function () {
]),
this.renderKeyringType(keyring),
this.renderRemoveAccount(keyring, identity.address),
this.renderRemoveAccount(keyring, identity),
],
)
})
}
AccountMenu.prototype.renderRemoveAccount = function (keyring, address) {
AccountMenu.prototype.renderRemoveAccount = function (keyring, identity) {
// Any account that's not from the HD wallet Keyring can be removed
const type = keyring.type
const isRemovable = type !== 'HD Key Tree'
@ -209,18 +209,18 @@ AccountMenu.prototype.renderRemoveAccount = function (keyring, address) {
position: 'bottom',
}, [
h('a.remove-account-icon', {
onClick: (e) => this.removeAccount(e, address),
onClick: (e) => this.removeAccount(e, identity),
}, ''),
])
}
return null
}
AccountMenu.prototype.removeAccount = function (e, address) {
AccountMenu.prototype.removeAccount = function (e, identity) {
e.preventDefault()
e.stopPropagation()
const { showRemoveAccountConfirmationModal } = this.props
showRemoveAccountConfirmationModal(address)
showRemoveAccountConfirmationModal(identity)
}
AccountMenu.prototype.renderKeyringType = function (keyring) {

View File

@ -2,12 +2,15 @@ import React, { Component } from 'react'
import PropTypes from 'prop-types'
import Button from '../../button'
import { addressSummary } from '../../../util'
import Identicon from '../../identicon'
import genAccountLink from '../../../../lib/account-link'
class ConfirmRemoveAccount extends Component {
static propTypes = {
hideModal: PropTypes.func.isRequired,
removeAccount: PropTypes.func.isRequired,
address: PropTypes.string.isRequired,
identity: PropTypes.object.isRequired,
network: PropTypes.string.isRequired,
}
static contextTypes = {
@ -15,10 +18,43 @@ class ConfirmRemoveAccount extends Component {
}
handleRemove () {
this.props.removeAccount(this.props.address)
this.props.removeAccount(this.props.identity.address)
.then(() => this.props.hideModal())
}
renderSelectedAccount () {
const { identity } = this.props
return (
<div className="modal-container__address">
<div className="account_identicon">
<Identicon
address={identity.address}
diameter={32}
style={{'marginLeft': '10px'}}
/>
</div>
<div className="account_name">
<span className="account_label">Name</span>
<span className="account_value">{identity.name}</span>
</div>
<div className="account_address">
<span className="account_label">Public Address</span>
<span className="account_value">{ addressSummary(identity.address) }</span>
</div>
<div className="account_link">
<a
className="hw-account-list__item__link"
href={genAccountLink(identity.address, this.props.network)}
target={'_blank'}
title={this.context.t('etherscanView')}
>
<img src="images/popout.svg" />
</a>
</div>
</div>
)
}
render () {
const { t } = this.context
@ -28,9 +64,7 @@ class ConfirmRemoveAccount extends Component {
<div className="modal-container__title">
{ `${t('removeAccount')}` }?
</div>
<div className="modal-container__address">
{addressSummary(this.props.address)}
</div>
{ this.renderSelectedAccount() }
<div className="modal-container__description">
{ t('removeAccountDescription') }
<a className="modal-container__link" rel="noopener noreferrer" target="_blank" href="https://consensys.zendesk.com/hc/en-us/articles/360004180111-What-are-imported-accounts-New-UI-">{ t('learnMore') }</a>

View File

@ -5,7 +5,8 @@ const { hideModal, removeAccount } = require('../../../actions')
const mapStateToProps = state => {
return {
address: state.appState.modal.modalState.props.address,
identity: state.appState.modal.modalState.props.identity,
network: state.metamask.network,
}
}