on master help sign in
feat: correctly import walletgen styles for walletgen appview
045685dMatt Condon (shrugs)
src/Root.js+16−21
@@ -1,7 +1,7 @@
1import 'babel-polyfill' // required for @ledgerhq/hw-transport-u2f
1import 'babel-polyfill' // required for @ledgerhq/hw-transport-u2f
2
2
3import React from 'react'
3import React from 'react'
4−import _ from 'lodash'
4+import { get } from 'lodash'
5
5
6import Bridge from './bridge/Bridge'
6import Bridge from './bridge/Bridge'
7import Walletgen from './walletgen/Walletgen'
7import Walletgen from './walletgen/Walletgen'
@@ -36,11 +36,11 @@ class Root extends React.Component {
36 */
36 */
37
37
38 isWalletgenStyle(styleSheet) {
38 isWalletgenStyle(styleSheet) {
39− return _.get(styleSheet, 'cssRules[0].selectorText', null) === "walletgen"
39+ return get(styleSheet, 'cssRules[0].selectorText', null) === "walletgen"
40 }
40 }
41
41
42 isBridgeStyle(styleSheet) {
42 isBridgeStyle(styleSheet) {
43− return _.get(styleSheet, 'cssRules[0].selectorText', null) === "bridge"
43+ return get(styleSheet, 'cssRules[0].selectorText', null) === "bridge"
44 }
44 }
45
45
46 disableStylesheets(appView) {
46 disableStylesheets(appView) {
@@ -70,25 +70,20 @@ class Root extends React.Component {
70 }
70 }
71
71
72 render() {
72 render() {
73− let appComponent = null;
73+ const { appView } = this.state;
74−
74+
75+ switch (appView) {
75− if (this.state.appView === "walletgen") {
76+ case "walletgen":
76− appComponent = <Walletgen
77+ return <Walletgen
77− appView={this.state.appView}
78+ appView={appView}
78− setView={this.setView} />
79+ setView={this.setView} />
79− }
80+ case "bridge":
80−
81− if (this.state.appView === "bridge") {
82− appComponent = <Bridge
81+ return <Bridge
83− appView={this.state.appView}
82+ appView={appView}
84− setView={this.setView} />
83+ setView={this.setView} />
84+ default:
85+ throw new Error(`Unknown appView ${appView}`)
85 }
86 }
86−
87− return (
88− <React.Fragment>
89− {appComponent}
90− </React.Fragment>
91− )
92 }
87 }
93}
88}
94
89
src/walletgen/Walletgen.js+2
@@ -17,6 +17,8 @@ import Custody from './views/Custody'
17import Download from './views/Download'
17import Download from './views/Download'
18import Done from './views/Done'
18import Done from './views/Done'
19
19
20+import './style/index.css';
21+
20const checkNetwork = () => navigator.onLine
22const checkNetwork = () => navigator.onLine
21 ? NETWORK_STATES.ONLINE
23 ? NETWORK_STATES.ONLINE
22 : NETWORK_STATES.OFFLINE
24 : NETWORK_STATES.OFFLINE
src/walletgen/index.jsdeleted−8
@@ -1,8 +0,0 @@
1−import "babel-polyfill";
2−import React from 'react';
3−import ReactDOM from 'react-dom';
4−// import styles from './styles/index.css';
5−
6−import App from './App'
7−
8−ReactDOM.render(<App />, document.getElementById('root-walletgen'))