|
|
@ -22,8 +22,7 @@ function mapDispatchToProps (dispatch) { |
|
|
|
setProviderType: (type) => { |
|
|
|
setProviderType: (type) => { |
|
|
|
dispatch(actions.setProviderType(type)) |
|
|
|
dispatch(actions.setProviderType(type)) |
|
|
|
}, |
|
|
|
}, |
|
|
|
setDefaultRpcTarget: () => { |
|
|
|
setDefaultRpcTarget: type => { |
|
|
|
// TODO: type is not defined. Is it needed?
|
|
|
|
|
|
|
|
dispatch(actions.setDefaultRpcTarget(type)) |
|
|
|
dispatch(actions.setDefaultRpcTarget(type)) |
|
|
|
}, |
|
|
|
}, |
|
|
|
setRpcTarget: (target) => { |
|
|
|
setRpcTarget: (target) => { |
|
|
@ -51,6 +50,11 @@ NetworkDropdown.prototype.render = function () { |
|
|
|
const { provider: { type: providerType, rpcTarget: activeNetwork } } = props |
|
|
|
const { provider: { type: providerType, rpcTarget: activeNetwork } } = props |
|
|
|
const rpcList = props.frequentRpcList |
|
|
|
const rpcList = props.frequentRpcList |
|
|
|
const isOpen = this.props.networkDropdownOpen |
|
|
|
const isOpen = this.props.networkDropdownOpen |
|
|
|
|
|
|
|
const dropdownMenuItemStyle = { |
|
|
|
|
|
|
|
fontFamily: 'DIN OT', |
|
|
|
|
|
|
|
fontSize: '16px', |
|
|
|
|
|
|
|
lineHeight: '20px', |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
return h(Dropdown, { |
|
|
|
return h(Dropdown, { |
|
|
|
useCssTransition: true, |
|
|
|
useCssTransition: true, |
|
|
@ -73,9 +77,10 @@ NetworkDropdown.prototype.render = function () { |
|
|
|
position: 'absolute', |
|
|
|
position: 'absolute', |
|
|
|
right: '2px', |
|
|
|
right: '2px', |
|
|
|
top: '38px', |
|
|
|
top: '38px', |
|
|
|
|
|
|
|
minWidth: '309px', |
|
|
|
}, |
|
|
|
}, |
|
|
|
innerStyle: { |
|
|
|
innerStyle: { |
|
|
|
padding: '2px 16px 2px 0px', |
|
|
|
padding: '10px 8px', |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, [ |
|
|
|
}, [ |
|
|
|
|
|
|
|
|
|
|
@ -85,14 +90,16 @@ NetworkDropdown.prototype.render = function () { |
|
|
|
key: 'main', |
|
|
|
key: 'main', |
|
|
|
closeMenu: () => this.props.hideNetworkDropdown(), |
|
|
|
closeMenu: () => this.props.hideNetworkDropdown(), |
|
|
|
onClick: () => props.setProviderType('mainnet'), |
|
|
|
onClick: () => props.setProviderType('mainnet'), |
|
|
|
style: { |
|
|
|
style: dropdownMenuItemStyle, |
|
|
|
fontSize: '18px', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
[ |
|
|
|
[ |
|
|
|
|
|
|
|
providerType === 'mainnet' ? h('.network-check', '✓') : h('.network-check__transparent', '✓'), |
|
|
|
h('.menu-icon.diamond'), |
|
|
|
h('.menu-icon.diamond'), |
|
|
|
'Main Ethereum Network', |
|
|
|
h('span.network-name', { |
|
|
|
providerType === 'mainnet' ? h('.check', '✓') : null, |
|
|
|
style: { |
|
|
|
|
|
|
|
color: providerType === 'mainnet' ? '#ffffff' : '#9b9b9b' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, 'Main Ethereum Network'), |
|
|
|
] |
|
|
|
] |
|
|
|
), |
|
|
|
), |
|
|
|
|
|
|
|
|
|
|
@ -102,14 +109,16 @@ NetworkDropdown.prototype.render = function () { |
|
|
|
key: 'ropsten', |
|
|
|
key: 'ropsten', |
|
|
|
closeMenu: () => this.props.hideNetworkDropdown(), |
|
|
|
closeMenu: () => this.props.hideNetworkDropdown(), |
|
|
|
onClick: () => props.setProviderType('ropsten'), |
|
|
|
onClick: () => props.setProviderType('ropsten'), |
|
|
|
style: { |
|
|
|
style: dropdownMenuItemStyle, |
|
|
|
fontSize: '18px', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
[ |
|
|
|
[ |
|
|
|
|
|
|
|
providerType === 'ropsten' ? h('.network-check', '✓') : h('.network-check__transparent', '✓'), |
|
|
|
h('.menu-icon.red-dot'), |
|
|
|
h('.menu-icon.red-dot'), |
|
|
|
'Ropsten Test Network', |
|
|
|
h('span.network-name', { |
|
|
|
providerType === 'ropsten' ? h('.check', '✓') : null, |
|
|
|
style: { |
|
|
|
|
|
|
|
color: providerType === 'ropsten' ? '#ffffff' : '#9b9b9b' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, 'Ropsten Test Network'), |
|
|
|
] |
|
|
|
] |
|
|
|
), |
|
|
|
), |
|
|
|
|
|
|
|
|
|
|
@ -119,14 +128,16 @@ NetworkDropdown.prototype.render = function () { |
|
|
|
key: 'kovan', |
|
|
|
key: 'kovan', |
|
|
|
closeMenu: () => this.props.hideNetworkDropdown(), |
|
|
|
closeMenu: () => this.props.hideNetworkDropdown(), |
|
|
|
onClick: () => props.setProviderType('kovan'), |
|
|
|
onClick: () => props.setProviderType('kovan'), |
|
|
|
style: { |
|
|
|
style: dropdownMenuItemStyle, |
|
|
|
fontSize: '18px', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
[ |
|
|
|
[ |
|
|
|
|
|
|
|
providerType === 'kovan' ? h('.network-check', '✓') : h('.network-check__transparent', '✓'), |
|
|
|
h('.menu-icon.hollow-diamond'), |
|
|
|
h('.menu-icon.hollow-diamond'), |
|
|
|
'Kovan Test Network', |
|
|
|
h('span.network-name', { |
|
|
|
providerType === 'kovan' ? h('.check', '✓') : null, |
|
|
|
style: { |
|
|
|
|
|
|
|
color: providerType === 'kovan' ? '#ffffff' : '#9b9b9b' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, 'Kovan Test Network'), |
|
|
|
] |
|
|
|
] |
|
|
|
), |
|
|
|
), |
|
|
|
|
|
|
|
|
|
|
@ -136,14 +147,22 @@ NetworkDropdown.prototype.render = function () { |
|
|
|
key: 'rinkeby', |
|
|
|
key: 'rinkeby', |
|
|
|
closeMenu: () => this.props.hideNetworkDropdown(), |
|
|
|
closeMenu: () => this.props.hideNetworkDropdown(), |
|
|
|
onClick: () => props.setProviderType('rinkeby'), |
|
|
|
onClick: () => props.setProviderType('rinkeby'), |
|
|
|
|
|
|
|
<<<<<<< HEAD |
|
|
|
style: { |
|
|
|
style: { |
|
|
|
fontSize: '18px', |
|
|
|
fontSize: '18px', |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
======= |
|
|
|
|
|
|
|
style: dropdownMenuItemStyle, |
|
|
|
|
|
|
|
>>>>>>> Fix menu style |
|
|
|
}, |
|
|
|
}, |
|
|
|
[ |
|
|
|
[ |
|
|
|
|
|
|
|
providerType === 'rinkeby' ? h('.network-check', '✓') : h('.network-check__transparent', '✓'), |
|
|
|
h('.menu-icon.golden-square'), |
|
|
|
h('.menu-icon.golden-square'), |
|
|
|
'Rinkeby Test Network', |
|
|
|
h('span.network-name', { |
|
|
|
providerType === 'rinkeby' ? h('.check', '✓') : null, |
|
|
|
style: { |
|
|
|
|
|
|
|
color: providerType === 'rinkeby' ? '#ffffff' : '#9b9b9b' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, 'Rinkeby Test Network'), |
|
|
|
] |
|
|
|
] |
|
|
|
), |
|
|
|
), |
|
|
|
|
|
|
|
|
|
|
@ -153,14 +172,16 @@ NetworkDropdown.prototype.render = function () { |
|
|
|
key: 'default', |
|
|
|
key: 'default', |
|
|
|
closeMenu: () => this.props.hideNetworkDropdown(), |
|
|
|
closeMenu: () => this.props.hideNetworkDropdown(), |
|
|
|
onClick: () => props.setDefaultRpcTarget(), |
|
|
|
onClick: () => props.setDefaultRpcTarget(), |
|
|
|
style: { |
|
|
|
style: dropdownMenuItemStyle, |
|
|
|
fontSize: '18px', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
[ |
|
|
|
[ |
|
|
|
|
|
|
|
activeNetwork === 'http://localhost:8545' ? h('.network-check', '✓') : h('.network-check__transparent', '✓'), |
|
|
|
h('i.fa.fa-question-circle.fa-lg.menu-icon'), |
|
|
|
h('i.fa.fa-question-circle.fa-lg.menu-icon'), |
|
|
|
'Localhost 8545', |
|
|
|
h('span.network-name', { |
|
|
|
activeNetwork === 'http://localhost:8545' ? h('.check', '✓') : null, |
|
|
|
style: { |
|
|
|
|
|
|
|
color: activeNetwork === 'http://localhost:8545' ? '#ffffff' : '#9b9b9b' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, 'Localhost 8545'), |
|
|
|
] |
|
|
|
] |
|
|
|
), |
|
|
|
), |
|
|
|
|
|
|
|
|
|
|
@ -172,14 +193,16 @@ NetworkDropdown.prototype.render = function () { |
|
|
|
{ |
|
|
|
{ |
|
|
|
closeMenu: () => this.props.hideNetworkDropdown(), |
|
|
|
closeMenu: () => this.props.hideNetworkDropdown(), |
|
|
|
onClick: () => this.props.showConfigPage(), |
|
|
|
onClick: () => this.props.showConfigPage(), |
|
|
|
style: { |
|
|
|
style: dropdownMenuItemStyle, |
|
|
|
fontSize: '18px', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
[ |
|
|
|
[ |
|
|
|
|
|
|
|
activeNetwork === 'custom' ? h('.check', '✓') : h('.network-check__transparent', '✓'), |
|
|
|
h('i.fa.fa-question-circle.fa-lg.menu-icon'), |
|
|
|
h('i.fa.fa-question-circle.fa-lg.menu-icon'), |
|
|
|
'Custom RPC', |
|
|
|
h('span.network-name', { |
|
|
|
activeNetwork === 'custom' ? h('.check', '✓') : null, |
|
|
|
style: { |
|
|
|
|
|
|
|
color: activeNetwork === 'custom' ? '#ffffff' : '#9b9b9b' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, 'Custom RPC'), |
|
|
|
] |
|
|
|
] |
|
|
|
), |
|
|
|
), |
|
|
|
|
|
|
|
|
|
|
|