mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-22 17:33:23 +01:00
Merge branch 'master' of github.com:MetaMask/metamask-plugin into networkIndication
This commit is contained in:
commit
41598a32a6
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
- Added a network indicator mark in dropdown menu
|
- Added a network indicator mark in dropdown menu
|
||||||
- Added network name next to network indicator
|
- Added network name next to network indicator
|
||||||
|
- Add copy transaction hash button to completed transaction list items.
|
||||||
- Unify wording for transaction approve/reject options on notifications and the extension.
|
- Unify wording for transaction approve/reject options on notifications and the extension.
|
||||||
|
|
||||||
## 2.4.5 2016-06-29
|
## 2.4.5 2016-06-29
|
||||||
|
@ -54,6 +54,7 @@
|
|||||||
"react-dom": "^15.0.2",
|
"react-dom": "^15.0.2",
|
||||||
"react-hyperscript": "^2.2.2",
|
"react-hyperscript": "^2.2.2",
|
||||||
"react-redux": "^4.4.5",
|
"react-redux": "^4.4.5",
|
||||||
|
"react-tooltip-component": "^0.3.0",
|
||||||
"readable-stream": "^2.1.2",
|
"readable-stream": "^2.1.2",
|
||||||
"redux": "^3.0.5",
|
"redux": "^3.0.5",
|
||||||
"redux-logger": "^2.3.1",
|
"redux-logger": "^2.3.1",
|
||||||
|
@ -3,7 +3,7 @@ const extend = require('xtend')
|
|||||||
const Component = require('react').Component
|
const Component = require('react').Component
|
||||||
const h = require('react-hyperscript')
|
const h = require('react-hyperscript')
|
||||||
const connect = require('react-redux').connect
|
const connect = require('react-redux').connect
|
||||||
const copyToClipboard = require('copy-to-clipboard')
|
const CopyButton = require('./components/copyButton')
|
||||||
const actions = require('./actions')
|
const actions = require('./actions')
|
||||||
const ReactCSSTransitionGroup = require('react-addons-css-transition-group')
|
const ReactCSSTransitionGroup = require('react-addons-css-transition-group')
|
||||||
const valuesFor = require('./util').valuesFor
|
const valuesFor = require('./util').valuesFor
|
||||||
@ -14,6 +14,7 @@ const TransactionList = require('./components/transaction-list')
|
|||||||
const ExportAccountView = require('./components/account-export')
|
const ExportAccountView = require('./components/account-export')
|
||||||
const ethUtil = require('ethereumjs-util')
|
const ethUtil = require('ethereumjs-util')
|
||||||
const EditableLabel = require('./components/editable-label')
|
const EditableLabel = require('./components/editable-label')
|
||||||
|
const Tooltip = require('./components/tooltip')
|
||||||
|
|
||||||
module.exports = connect(mapStateToProps)(AccountDetailScreen)
|
module.exports = connect(mapStateToProps)(AccountDetailScreen)
|
||||||
|
|
||||||
@ -105,28 +106,32 @@ AccountDetailScreen.prototype.render = function () {
|
|||||||
},
|
},
|
||||||
}, ethUtil.toChecksumAddress(selected)),
|
}, ethUtil.toChecksumAddress(selected)),
|
||||||
|
|
||||||
h('img.cursor-pointer.color-orange', {
|
h(CopyButton, {
|
||||||
src: 'images/copy.svg',
|
value: ethUtil.toChecksumAddress(selected),
|
||||||
title: 'Copy Address',
|
|
||||||
onClick: () => copyToClipboard(ethUtil.toChecksumAddress(selected)),
|
|
||||||
style: {
|
|
||||||
margin: '0px 5px',
|
|
||||||
},
|
|
||||||
}),
|
}),
|
||||||
|
|
||||||
h('img.cursor-pointer.color-orange', {
|
h(Tooltip, {
|
||||||
src: 'images/key-32.png',
|
|
||||||
title: 'Export Private Key',
|
title: 'Export Private Key',
|
||||||
onClick: () => this.requestAccountExport(selected),
|
}, [
|
||||||
style: {
|
h('div', {
|
||||||
margin: '0px 5px',
|
style: {
|
||||||
width: '20px',
|
margin: '5px',
|
||||||
height: '20px',
|
},
|
||||||
position: 'relative',
|
}, [
|
||||||
top: '3px',
|
h('img.cursor-pointer.color-orange', {
|
||||||
right: '4px',
|
src: 'images/key-32.png',
|
||||||
},
|
onClick: () => this.requestAccountExport(selected),
|
||||||
}),
|
style: {
|
||||||
|
margin: '0px 5px',
|
||||||
|
width: '20px',
|
||||||
|
height: '20px',
|
||||||
|
position: 'relative',
|
||||||
|
top: '3px',
|
||||||
|
right: '4px',
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
|
||||||
]),
|
]),
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ const inherits = require('util').inherits
|
|||||||
const ethUtil = require('ethereumjs-util')
|
const ethUtil = require('ethereumjs-util')
|
||||||
|
|
||||||
const EtherBalance = require('../components/eth-balance')
|
const EtherBalance = require('../components/eth-balance')
|
||||||
const copyToClipboard = require('copy-to-clipboard')
|
const CopyButton = require('../components/copyButton')
|
||||||
const Identicon = require('../components/identicon')
|
const Identicon = require('../components/identicon')
|
||||||
|
|
||||||
module.exports = NewComponent
|
module.exports = NewComponent
|
||||||
@ -61,14 +61,8 @@ NewComponent.prototype.render = function () {
|
|||||||
margin: '0 20px',
|
margin: '0 20px',
|
||||||
},
|
},
|
||||||
}, [
|
}, [
|
||||||
h('img.cursor-pointer.color-orange', {
|
h(CopyButton, {
|
||||||
title: 'Copy Address',
|
value: ethUtil.toChecksumAddress(identity.address),
|
||||||
src: 'images/copy.svg',
|
|
||||||
onClick: (event) => {
|
|
||||||
event.stopPropagation()
|
|
||||||
event.preventDefault()
|
|
||||||
copyToClipboard(ethUtil.toChecksumAddress(identity.address))
|
|
||||||
},
|
|
||||||
}),
|
}),
|
||||||
]),
|
]),
|
||||||
])
|
])
|
||||||
|
@ -26,6 +26,7 @@ const SandwichExpando = require('sandwich-expando')
|
|||||||
const MenuDroppo = require('menu-droppo')
|
const MenuDroppo = require('menu-droppo')
|
||||||
const DropMenuItem = require('./components/drop-menu-item')
|
const DropMenuItem = require('./components/drop-menu-item')
|
||||||
const NetworkIndicator = require('./components/network')
|
const NetworkIndicator = require('./components/network')
|
||||||
|
const Tooltip = require('./components/tooltip')
|
||||||
|
|
||||||
module.exports = connect(mapStateToProps)(App)
|
module.exports = connect(mapStateToProps)(App)
|
||||||
|
|
||||||
@ -152,18 +153,19 @@ App.prototype.renderAppBar = function () {
|
|||||||
}, [
|
}, [
|
||||||
|
|
||||||
// small accounts nav
|
// small accounts nav
|
||||||
h('img.cursor-pointer.color-orange', {
|
h(Tooltip, { title: 'Switch Accounts' }, [
|
||||||
src: 'images/switch_acc.svg',
|
h('img.cursor-pointer.color-orange', {
|
||||||
style: {
|
src: 'images/switch_acc.svg',
|
||||||
width: '23.5px',
|
style: {
|
||||||
marginRight: '8px',
|
width: '23.5px',
|
||||||
},
|
marginRight: '8px',
|
||||||
title: 'Switch Accounts',
|
},
|
||||||
onClick: (event) => {
|
onClick: (event) => {
|
||||||
event.stopPropagation()
|
event.stopPropagation()
|
||||||
this.props.dispatch(actions.showAccountsPage())
|
this.props.dispatch(actions.showAccountsPage())
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
]),
|
||||||
|
|
||||||
// hamburger
|
// hamburger
|
||||||
h(SandwichExpando, {
|
h(SandwichExpando, {
|
||||||
|
61
ui/app/components/copyButton.js
Normal file
61
ui/app/components/copyButton.js
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
const Component = require('react').Component
|
||||||
|
const h = require('react-hyperscript')
|
||||||
|
const inherits = require('util').inherits
|
||||||
|
const copyToClipboard = require('copy-to-clipboard')
|
||||||
|
|
||||||
|
const Tooltip = require('./tooltip')
|
||||||
|
|
||||||
|
module.exports = CopyButton
|
||||||
|
|
||||||
|
inherits(CopyButton, Component)
|
||||||
|
function CopyButton () {
|
||||||
|
Component.call(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
// As parameters, accepts:
|
||||||
|
// "value", which is the value to copy (mandatory)
|
||||||
|
// "title", which is the text to show on hover (optional, defaults to 'Copy')
|
||||||
|
CopyButton.prototype.render = function () {
|
||||||
|
const props = this.props
|
||||||
|
const state = this.state || {}
|
||||||
|
|
||||||
|
const value = props.value
|
||||||
|
const copied = state.copied
|
||||||
|
|
||||||
|
const message = copied ? 'Copied' : props.title || ' Copy '
|
||||||
|
|
||||||
|
return h('.copy-button', {
|
||||||
|
style: {
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
},
|
||||||
|
}, [
|
||||||
|
|
||||||
|
h(Tooltip, {
|
||||||
|
title: message,
|
||||||
|
}, [
|
||||||
|
h('i.fa.fa-clipboard.cursor-pointer.color-orange', {
|
||||||
|
style: {
|
||||||
|
margin: '5px',
|
||||||
|
},
|
||||||
|
onClick: (event) => {
|
||||||
|
event.preventDefault()
|
||||||
|
event.stopPropagation()
|
||||||
|
copyToClipboard(value)
|
||||||
|
this.debounceRestore()
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
]),
|
||||||
|
|
||||||
|
])
|
||||||
|
}
|
||||||
|
|
||||||
|
CopyButton.prototype.debounceRestore = function() {
|
||||||
|
|
||||||
|
this.setState({ copied: true })
|
||||||
|
clearTimeout(this.timeout)
|
||||||
|
this.timeout = setTimeout(() => {
|
||||||
|
this.setState({ copied: false })
|
||||||
|
}, 850)
|
||||||
|
|
||||||
|
}
|
22
ui/app/components/tooltip.js
Normal file
22
ui/app/components/tooltip.js
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
const Component = require('react').Component
|
||||||
|
const h = require('react-hyperscript')
|
||||||
|
const inherits = require('util').inherits
|
||||||
|
const ReactTooltip = require('react-tooltip-component')
|
||||||
|
|
||||||
|
module.exports = Tooltip
|
||||||
|
|
||||||
|
inherits(Tooltip, Component)
|
||||||
|
function Tooltip () {
|
||||||
|
Component.call(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.render = function () {
|
||||||
|
const props = this.props
|
||||||
|
|
||||||
|
return h(ReactTooltip, {
|
||||||
|
position: 'left',
|
||||||
|
title: props.title,
|
||||||
|
fixed: false,
|
||||||
|
}, props.children)
|
||||||
|
|
||||||
|
}
|
@ -5,6 +5,7 @@ const inherits = require('util').inherits
|
|||||||
const EtherBalance = require('./eth-balance')
|
const EtherBalance = require('./eth-balance')
|
||||||
const addressSummary = require('../util').addressSummary
|
const addressSummary = require('../util').addressSummary
|
||||||
const explorerLink = require('../../lib/explorer-link')
|
const explorerLink = require('../../lib/explorer-link')
|
||||||
|
const CopyButton = require('./copyButton')
|
||||||
const vreme = new (require('vreme'))
|
const vreme = new (require('vreme'))
|
||||||
|
|
||||||
const TransactionIcon = require('./transaction-list-item-icon')
|
const TransactionIcon = require('./transaction-list-item-icon')
|
||||||
@ -67,6 +68,8 @@ TransactionListItem.prototype.render = function () {
|
|||||||
recipientField(txParams, transaction, isTx, isMsg),
|
recipientField(txParams, transaction, isTx, isMsg),
|
||||||
]),
|
]),
|
||||||
|
|
||||||
|
transaction.hash ? h(CopyButton, { value: transaction.hash }) : null,
|
||||||
|
|
||||||
isTx ? h(EtherBalance, {
|
isTx ? h(EtherBalance, {
|
||||||
value: txParams.value,
|
value: txParams.value,
|
||||||
}) : h('.flex-column'),
|
}) : h('.flex-column'),
|
||||||
|
@ -9,6 +9,7 @@ var cssFiles = {
|
|||||||
'lib.css': fs.readFileSync(path.join(__dirname, '/app/css/lib.css'), 'utf8'),
|
'lib.css': fs.readFileSync(path.join(__dirname, '/app/css/lib.css'), 'utf8'),
|
||||||
'index.css': fs.readFileSync(path.join(__dirname, '/app/css/index.css'), 'utf8'),
|
'index.css': fs.readFileSync(path.join(__dirname, '/app/css/index.css'), 'utf8'),
|
||||||
'transitions.css': fs.readFileSync(path.join(__dirname, '/app/css/transitions.css'), 'utf8'),
|
'transitions.css': fs.readFileSync(path.join(__dirname, '/app/css/transitions.css'), 'utf8'),
|
||||||
|
'react-tooltip-component.css': fs.readFileSync(path.join(__dirname, '..', 'node_modules', 'react-tooltip-component', 'dist', 'react-tooltip-component.css'), 'utf8'),
|
||||||
}
|
}
|
||||||
|
|
||||||
function bundleCss () {
|
function bundleCss () {
|
||||||
|
Loading…
Reference in New Issue
Block a user