mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Merge pull request #970 from MetaMask/network-indicator-refactor
Network indicator modifications
This commit is contained in:
commit
98ebdeeeac
@ -4,6 +4,8 @@
|
|||||||
|
|
||||||
- Remove certain non-essential permissions from certain builds.
|
- Remove certain non-essential permissions from certain builds.
|
||||||
- Add a check for when a tx is included in a block.
|
- Add a check for when a tx is included in a block.
|
||||||
|
- Minor modifications to network display.
|
||||||
|
- Network now displays properly for pending transactions.
|
||||||
- Implement replay attack protections allowed by EIP 155.
|
- Implement replay attack protections allowed by EIP 155.
|
||||||
- Fix bug where sometimes loading account data would fail by querying a future block.
|
- Fix bug where sometimes loading account data would fail by querying a future block.
|
||||||
|
|
||||||
|
@ -141,15 +141,21 @@ App.prototype.renderAppBar = function () {
|
|||||||
src: '/images/icon-128.png',
|
src: '/images/icon-128.png',
|
||||||
}),
|
}),
|
||||||
|
|
||||||
h(NetworkIndicator, {
|
h('#network-spacer.flex-center', {
|
||||||
network: this.props.network,
|
style: {
|
||||||
provider: this.props.provider,
|
marginRight: '-72px',
|
||||||
onClick: (event) => {
|
|
||||||
event.preventDefault()
|
|
||||||
event.stopPropagation()
|
|
||||||
this.setState({ isNetworkMenuOpen: !isNetworkMenuOpen })
|
|
||||||
},
|
},
|
||||||
}),
|
}, [
|
||||||
|
h(NetworkIndicator, {
|
||||||
|
network: this.props.network,
|
||||||
|
provider: this.props.provider,
|
||||||
|
onClick: (event) => {
|
||||||
|
event.preventDefault()
|
||||||
|
event.stopPropagation()
|
||||||
|
this.setState({ isNetworkMenuOpen: !isNetworkMenuOpen })
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
]),
|
||||||
]),
|
]),
|
||||||
|
|
||||||
// metamask name
|
// metamask name
|
||||||
|
@ -46,11 +46,7 @@ Network.prototype.render = function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
h('#network_component.flex-center.pointer', {
|
h('#network_component.pointer', {
|
||||||
style: {
|
|
||||||
marginRight: '-27px',
|
|
||||||
marginLeft: '-3px',
|
|
||||||
},
|
|
||||||
title: hoverText,
|
title: hoverText,
|
||||||
onClick: (event) => this.props.onClick(event),
|
onClick: (event) => this.props.onClick(event),
|
||||||
}, [
|
}, [
|
||||||
|
@ -4,6 +4,7 @@ const ReactCSSTransitionGroup = require('react-addons-css-transition-group')
|
|||||||
const h = require('react-hyperscript')
|
const h = require('react-hyperscript')
|
||||||
const connect = require('react-redux').connect
|
const connect = require('react-redux').connect
|
||||||
const actions = require('./actions')
|
const actions = require('./actions')
|
||||||
|
const NetworkIndicator = require('./components/network')
|
||||||
const txHelper = require('../lib/tx-helper')
|
const txHelper = require('../lib/tx-helper')
|
||||||
const isPopupOrNotification = require('../../app/scripts/lib/is-popup-or-notification')
|
const isPopupOrNotification = require('../../app/scripts/lib/is-popup-or-notification')
|
||||||
const ethUtil = require('ethereumjs-util')
|
const ethUtil = require('ethereumjs-util')
|
||||||
@ -24,6 +25,7 @@ function mapStateToProps (state) {
|
|||||||
index: state.appState.currentView.context,
|
index: state.appState.currentView.context,
|
||||||
warning: state.appState.warning,
|
warning: state.appState.warning,
|
||||||
network: state.metamask.network,
|
network: state.metamask.network,
|
||||||
|
provider: state.metamask.provider,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -36,6 +38,7 @@ ConfirmTxScreen.prototype.render = function () {
|
|||||||
var state = this.props
|
var state = this.props
|
||||||
|
|
||||||
var network = state.network
|
var network = state.network
|
||||||
|
var provider = state.provider
|
||||||
var unconfTxs = state.unconfTxs
|
var unconfTxs = state.unconfTxs
|
||||||
var unconfMsgs = state.unconfMsgs
|
var unconfMsgs = state.unconfMsgs
|
||||||
var unconfTxList = txHelper(unconfTxs, unconfMsgs, network)
|
var unconfTxList = txHelper(unconfTxs, unconfMsgs, network)
|
||||||
@ -54,6 +57,10 @@ ConfirmTxScreen.prototype.render = function () {
|
|||||||
onClick: this.goHome.bind(this),
|
onClick: this.goHome.bind(this),
|
||||||
}) : null,
|
}) : null,
|
||||||
h('h2.page-subtitle', 'Confirm Transaction'),
|
h('h2.page-subtitle', 'Confirm Transaction'),
|
||||||
|
isNotification ? h(NetworkIndicator, {
|
||||||
|
network: network,
|
||||||
|
provider: provider,
|
||||||
|
}) : null,
|
||||||
]),
|
]),
|
||||||
|
|
||||||
h('h3', {
|
h('h3', {
|
||||||
|
@ -165,9 +165,6 @@ textarea.twelve-word-phrase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.network-name {
|
.network-name {
|
||||||
position: absolute;
|
|
||||||
top: 8px;
|
|
||||||
left: 60px;
|
|
||||||
width: 5.2em;
|
width: 5.2em;
|
||||||
line-height: 9px;
|
line-height: 9px;
|
||||||
text-rendering: geometricPrecision;
|
text-rendering: geometricPrecision;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user