1import React from 'react'
2import * as lodash from 'lodash'
4import Header from './components/Header'
5import Footer from './components/Footer'
7import { NETWORK_STATES, PROFILE_STATES, GEN_STATES } from './lib/constants'
9import BrowserWarning from './views/BrowserWarning'
10import NetworkWarning from './views/NetworkWarning'
11import PrivacyPolicy from './views/PrivacyPolicy'
12import Welcome from './views/Welcome'
13import Eula from './views/Eula'
14import EulaView from './views/EulaView'
15import Upload from './views/Upload'
16import Understand from './views/Understand'
17import Generate from './views/Generate'
18import Custody from './views/Custody'
19import Download from './views/Download'
20import Done from './views/Done'
23const checkNetwork = () => navigator.onLine
24 ? NETWORK_STATES.ONLINE
25 : NETWORK_STATES.OFFLINE
37 { path: '/Understand',
38 Component: Understand,
52 { path: '/PrivacyPolicy',
53 Component: PrivacyPolicy,
62class App extends React.Component {
66 'network': checkNetwork(),
67 'profile.state': PROFILE_STATES.NOSTART,
68 'profile.value': null,
69 'profile.shipCount': 0,
71 'eny.state': GEN_STATES.ENY_NOSTART,
74 'wallets.state': GEN_STATES.DERIVATION_NOSTART,
75 'wallets.value': null,
77 'wallets.genCounter': 0,
78 'paperCollateral.state': GEN_STATES.PAPER_NOSTART,
79 'paperCollateral.value': null,
80 'paperCollateral.error': '',
82 'lastRoute': '/Welcome',
84 'totalSteps': TOTAL_STEPS,
86 'didClickDownload': false,
91 componentDidMount = () => {
92 window.addEventListener('online', () => this.setState({'network': NETWORK_STATES.ONLINE}));
93 window.addEventListener('offline', () => this.setState({'network': NETWORK_STATES.OFFLINE}));
97 setGlobalState = state => this.setState(state)
99 router = (network, path) => {
100 const route = key => {
101 const { Component } = lodash.find(ROUTES, { path: key })
103 setGlobalState: this.setGlobalState,
106 return <Component { ...globals } />
111 // return network === NETWORK_STATES.ONLINE
112 // ? <NetworkWarning />
113 // : !(network === NETWORK_STATES.OFFLINE)
114 // ? <h1>Detecting your network state.</h1>
120 const { network, route, currentStep, stepCount, lastRoute } = this.state;
122 const routed = this.router(network, route) // hacky prod
123 // const routed = this.router(NETWORK_STATES.OFFLINE, true, route) // hacky dev
126 <main className={'container'}>
130 currentStep={ currentStep }
131 totalSteps={ TOTAL_STEPS } />
133 <div className={ 'row wrapper' }>
134 <div className={'col-'}>
137 <div className={'push'} />
142 lastRoute={ lastRoute }
143 setGlobalState={ this.setGlobalState }
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