aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/network.js
blob: ac749fe5e7b489d6691ca4e9a16c89bd506e6e3e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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'}) ])
  )
}