1import 'babel-polyfill' // required for @ledgerhq/hw-transport-u2f
3import React from 'react'
4import ReactDOM from 'react-dom'
7import Bridge from './bridge/Bridge'
8import Walletgen from './walletgen/Walletgen'
9import { AppNavigation } from './common/components/AppNavigation'
11import './common/style/index.css'
12import './bridge/style/index.css'
13import './walletgen/style/index.css'
15class Root extends React.Component {
23 this.setView = this.setView.bind(this)
29 To switch between walletgen and bridge styles without them clobbering each
30 other, we need a way to identify which app the stylesheet belongs to.
32 So we include a "walletgen" or "bridge" style as the first rule of any
33 stylesheet. If this directive is included, we can disable the appropriate
34 sheet when the user switches applications
36 A bit hacky, but does the job for now. These styles should probably be
37 fully merged at some point.
40 isWalletgenStyle(styleSheet) {
41 return _.get(styleSheet, 'cssRules[0].selectorText', null) === "walletgen"
44 isBridgeStyle(styleSheet) {
45 return _.get(styleSheet, 'cssRules[0].selectorText', null) === "bridge"
48 disableStylesheets(appView) {
49 for (var i = 0; i < document.styleSheets.length; i++) {
50 let styleSheet = document.styleSheets[i]
52 if (appView === "bridge") {
53 if (this.isWalletgenStyle(styleSheet)) styleSheet.disabled = true
54 if (this.isBridgeStyle(styleSheet)) styleSheet.disabled = false
55 } else if (appView === "walletgen") {
56 if (this.isWalletgenStyle(styleSheet)) styleSheet.disabled = false
57 if (this.isBridgeStyle(styleSheet)) styleSheet.disabled = true
63 this.disableStylesheets(this.state.appView)
67 this.disableStylesheets(appView)
75 let appComponent = null;
77 if (this.state.appView === "walletgen") {
78 appComponent = <Walletgen
79 appView={this.state.appView}
80 setView={this.setView} />
83 if (this.state.appView === "bridge") {
84 appComponent = <Bridge
85 appView={this.state.appView}
86 setView={this.setView} />
93 setView={this.setView}
94 appView={this.state.appView}
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list