1import 'babel-polyfill' // required for @ledgerhq/hw-transport-u2f
3import React from 'react'
6import Bridge from './bridge/Bridge'
7import Walletgen from './walletgen/Walletgen'
8import { AppNavigation } from './common/components/AppNavigation'
10import './common/style/index.css'
11import './bridge/style/index.css'
12import './walletgen/style/index.css'
14class Root extends React.Component {
22 this.setView = this.setView.bind(this)
28 To switch between walletgen and bridge styles without them clobbering each
29 other, we need a way to identify which app the stylesheet belongs to.
31 So we include a "walletgen" or "bridge" style as the first rule of any
32 stylesheet. If this directive is included, we can disable the appropriate
33 sheet when the user switches applications
35 A bit hacky, but does the job for now. These styles should probably be
36 fully merged at some point.
39 isWalletgenStyle(styleSheet) {
40 return _.get(styleSheet, 'cssRules[0].selectorText', null) === "walletgen"
43 isBridgeStyle(styleSheet) {
44 return _.get(styleSheet, 'cssRules[0].selectorText', null) === "bridge"
47 disableStylesheets(appView) {
48 for (var i = 0; i < document.styleSheets.length; i++) {
49 let styleSheet = document.styleSheets[i]
51 if (appView === "bridge") {
52 if (this.isWalletgenStyle(styleSheet)) styleSheet.disabled = true
53 if (this.isBridgeStyle(styleSheet)) styleSheet.disabled = false
54 } else if (appView === "walletgen") {
55 if (this.isWalletgenStyle(styleSheet)) styleSheet.disabled = false
56 if (this.isBridgeStyle(styleSheet)) styleSheet.disabled = true
62 this.disableStylesheets(this.state.appView)
66 this.disableStylesheets(appView)
74 let appComponent = null;
76 if (this.state.appView === "walletgen") {
77 appComponent = <Walletgen
78 appView={this.state.appView}
79 setView={this.setView} />
82 if (this.state.appView === "bridge") {
83 appComponent = <Bridge
84 appView={this.state.appView}
85 setView={this.setView} />
92 setView={this.setView}
93 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