From 924a65c956bc6bea4708a0f58b688e4edbb5d3f2 Mon Sep 17 00:00:00 2001 From: Zac Mitton Date: Wed, 1 Jun 2016 16:30:14 -0700 Subject: network status getting set upon start-up and showing in title bar but not auto-updating yet --- ui/app/components/network.js | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 ui/app/components/network.js (limited to 'ui/app/components/network.js') 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'}) ]) + ) +} -- cgit