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 PrivacyPolicy from './views/PrivacyPolicy'
10import Welcome from './views/Welcome'
11import Eula from './views/Eula'
12import EulaView from './views/EulaView'
13import Upload from './views/Upload'
14import Understand from './views/Understand'
15import Generate from './views/Generate'
16import Custody from './views/Custody'
17import Download from './views/Download'
18import Done from './views/Done'
20const checkNetwork = () => navigator.onLine
21 ? NETWORK_STATES.ONLINE
22 : NETWORK_STATES.OFFLINE
34 { path: '/Understand',
35 Component: Understand,
49 { path: '/PrivacyPolicy',
50 Component: PrivacyPolicy,
59class Walletgen extends React.Component {
63 'network': checkNetwork(),
64 'profile.state': PROFILE_STATES.NOSTART,
65 'profile.value': null,
66 'profile.shipCount': 0,
68 'eny.state': GEN_STATES.ENY_NOSTART,
71 'wallets.state': GEN_STATES.DERIVATION_NOSTART,
72 'wallets.value': null,
74 'wallets.genCounter': 0,
75 'paperCollateral.state': GEN_STATES.PAPER_NOSTART,
76 'paperCollateral.value': null,
77 'paperCollateral.error': '',
79 'lastRoute': '/Welcome',
81 'totalSteps': TOTAL_STEPS,
83 'didClickDownload': false,
88 componentDidMount = () => {
89 window.addEventListener('online', () => this.setState({'network': NETWORK_STATES.ONLINE}));
90 window.addEventListener('offline', () => this.setState({'network': NETWORK_STATES.OFFLINE}));
94 setGlobalState = state => this.setState(state)
96 router = (network, path) => {
97 const route = key => {
98 const { Component } = lodash.find(ROUTES, { path: key })
100 setGlobalState: this.setGlobalState,
103 return <Component { ...globals } />
108 // return network === NETWORK_STATES.ONLINE
109 // ? <NetworkWarning />
110 // : !(network === NETWORK_STATES.OFFLINE)
111 // ? <h1>Detecting your network state.</h1>
117 const { network, route, currentStep, lastRoute } = this.state;
119 const routed = this.router(network, route) // hacky prod
120 // const routed = this.router(NETWORK_STATES.OFFLINE, true, route) // hacky dev
123 <main className={'container'}>
127 currentStep={ currentStep }
128 totalSteps={ TOTAL_STEPS } />
130 <div className={ 'row wrapper' }>
131 <div className={'col-'}>
134 <div className={'push'} />
139 lastRoute={ lastRoute }
140 setGlobalState={ this.setGlobalState }
147export default Walletgen
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