diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | app/images/ethereum-network.jpg | bin | 0 -> 10807 bytes | |||
-rw-r--r-- | app/images/morden-test-network.jpg | bin | 0 -> 10517 bytes | |||
-rw-r--r-- | app/images/no-connection.jpg | bin | 0 -> 6946 bytes | |||
-rw-r--r-- | app/images/unknown-private-network.jpg | bin | 0 -> 3962 bytes | |||
-rw-r--r-- | ui/app/actions.js | 8 | ||||
-rw-r--r-- | ui/app/app.js | 15 | ||||
-rw-r--r-- | ui/app/components/network.js | 34 |
9 files changed, 53 insertions, 6 deletions
diff --git a/.gitignore b/.gitignore index 476b197db..2ad6b035f 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ package .DS_Store builds/ +notes.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index 2bf056b31..97843cf58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Current Master +- show network conection in title bar - Redesigned init, vault create, vault restore and seed confirmation screens. - Added pending transactions to transaction list on account screen. - Clicking a pending transaction takes you back to the transaction approval screen. diff --git a/app/images/ethereum-network.jpg b/app/images/ethereum-network.jpg Binary files differnew file mode 100644 index 000000000..61cb000ed --- /dev/null +++ b/app/images/ethereum-network.jpg diff --git a/app/images/morden-test-network.jpg b/app/images/morden-test-network.jpg Binary files differnew file mode 100644 index 000000000..458708c78 --- /dev/null +++ b/app/images/morden-test-network.jpg diff --git a/app/images/no-connection.jpg b/app/images/no-connection.jpg Binary files differnew file mode 100644 index 000000000..a5d21242b --- /dev/null +++ b/app/images/no-connection.jpg diff --git a/app/images/unknown-private-network.jpg b/app/images/unknown-private-network.jpg Binary files differnew file mode 100644 index 000000000..b8a5a9bbf --- /dev/null +++ b/app/images/unknown-private-network.jpg diff --git a/ui/app/actions.js b/ui/app/actions.js index ae6125b20..982b1a2fb 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -6,6 +6,8 @@ var actions = { toggleMenu: toggleMenu, SET_MENU_STATE: 'SET_MENU_STATE', closeMenu: closeMenu, + getNetworkStatus: 'getNetworkStatus', + // remote state UPDATE_METAMASK_STATE: 'UPDATE_METAMASK_STATE', updateMetamaskState: updateMetamaskState, @@ -131,6 +133,12 @@ function closeMenu() { } } +function getNetworkStatus(){ + return { + type: actions.getNetworkStatus, + } +} + // async actions function tryUnlockMetamask(password) { diff --git a/ui/app/app.js b/ui/app/app.js index 7e7ca24ad..34cfef7c0 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -27,6 +27,7 @@ const txHelper = require('../lib/tx-helper') const SandwichExpando = require('sandwich-expando') const MenuDroppo = require('menu-droppo') const DropMenuItem = require('./components/drop-menu-item') +const NetworkIndicator = require('./components/network') module.exports = connect(mapStateToProps)(App) @@ -46,6 +47,7 @@ function mapStateToProps(state) { unconfTxs: state.metamask.unconfTxs, unconfMsgs: state.metamask.unconfMsgs, menuOpen: state.appState.menuOpen, + network: state.metamask.network, } } @@ -109,20 +111,21 @@ App.prototype.renderAppBar = function(){ }, state.isUnlocked && [ // mini logo - h('img', { - height: 24, - width: 24, - src: '/images/icon-128.png', - }), + // h('img', { + // height: 24, + // width: 24, + // src: '/images/icon-128.png', + // }), + h(NetworkIndicator, {network: this.props.network}), // metamask name h('h1', 'MetaMask'), - // hamburger h(SandwichExpando, { width: 16, barHeight: 2, padding: 0, + paddingLeft: '200px', isOpen: state.menuOpen, color: 'rgb(247,146,30)', onClick: (event) => { diff --git a/ui/app/components/network.js b/ui/app/components/network.js new file mode 100644 index 000000000..ac749fe5e --- /dev/null +++ b/ui/app/components/network.js @@ -0,0 +1,34 @@ +const Component = require('react').Component +const h = require('react-hyperscript') +const inherits = require('util').inherits + +module.exports = Network + +inherits(Network, Component) + +function Network() { + Component.call(this) +} + +Network.prototype.render = function() { + var state = this.props + var networkNumber = state.network + var networkName; + var imagePath = "/images/" + + if(networkNumber == undefined || networkNumber == "error"){ + networkName = "no-connection" + }else if(networkNumber == 1){ + networkName = "ethereum-network" + }else if(networkNumber == 2){ + networkName = "morden-test-network" + }else{ + networkName = "unknown-private-network" + } + return ( + h('#network_component.flex-center', { + style: {}, + title: networkName + },[ h('img',{src: imagePath + networkName + ".jpg", width: '25px'}) ]) + ) +} |