on e9a3a34 help sign in
bridge/src/Root.js
51 lines 967 B history raw
1import 'babel-polyfill' // required for @ledgerhq/hw-transport-u2f
3import React from 'react'
4import ReactDOM from 'react-dom'
6import Bridge from './Bridge'
7import Walletgen from './walletgen/Walletgen'
9class Root extends React.Component {
10 constructor(props) {
11 super(props)
13 this.state = {
14 appView: "bridge"
15 }
17 this.setView = this.setView.bind(this)
18 }
20 setView(appView) {
21 this.setState({
22 appView
23 })
24 }
26 render() {
27 let appComponent = null;
29 if (this.state.appView === "walletgen") {
30 appComponent = <Walletgen
31 appView={this.state.appView}
32 setView={this.setView} />
33 }
35 if (this.state.appView === "bridge") {
36 appComponent = <Bridge
37 appView={this.state.appView}
38 setView={this.setView} />
39 }
41 return (
42 <React.Fragment>
43 {appComponent}
44 </React.Fragment>
45 )
46 }
49export {
50 Root