1import 'babel-polyfill'; // required for @ledgerhq/hw-transport-u2f
3import React from 'react';
4import { get } from 'lodash';
6import Bridge from './bridge/Bridge';
7import Walletgen from './walletgen/Walletgen';
8// import { AppNavigation } from './common/components/AppNavigation'
10import './common/style/index.css';
11import './bridge/style/index.css';
13class Root extends React.Component {
21 this.setView = this.setView.bind(this);
27 To switch between walletgen and bridge styles without them clobbering each
28 other, we need a way to identify which app the stylesheet belongs to.
30 So we include a "walletgen" or "bridge" style as the first rule of any
31 stylesheet. If this directive is included, we can disable the appropriate
32 sheet when the user switches applications
34 A bit hacky, but does the job for now. These styles should probably be
35 fully merged at some point.
38 isWalletgenStyle(styleSheet) {
39 return get(styleSheet, 'cssRules[0].selectorText', null) === 'walletgen';
42 isBridgeStyle(styleSheet) {
43 return get(styleSheet, 'cssRules[0].selectorText', null) === 'bridge';
46 disableStylesheets(appView) {
47 for (var i = 0; i < document.styleSheets.length; i++) {
48 let styleSheet = document.styleSheets[i];
50 if (appView === 'bridge') {
51 if (this.isWalletgenStyle(styleSheet)) styleSheet.disabled = true;
52 if (this.isBridgeStyle(styleSheet)) styleSheet.disabled = false;
53 } else if (appView === 'walletgen') {
54 if (this.isWalletgenStyle(styleSheet)) styleSheet.disabled = false;
55 if (this.isBridgeStyle(styleSheet)) styleSheet.disabled = true;
61 this.disableStylesheets(this.state.appView);
65 this.disableStylesheets(appView);
73 const { appView } = this.state;
77 return <Walletgen appView={appView} setView={this.setView} />;
79 return <Bridge appView={appView} setView={this.setView} />;
81 throw new Error(`Unknown appView ${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