1import React from 'react';
2import { hot } from 'react-hot-loader/root';
3import { Just, Nothing } from 'folktale/maybe';
4import { IndigoApp } from 'indigo-react';
6import Header from 'components/Header';
8import Router from 'components/Router';
10import Provider from 'store/Provider';
12import { ROUTE_NAMES } from 'lib/routeNames';
13import { ROUTES } from 'lib/router';
14import { NETWORK_TYPES } from 'lib/network';
15import { walletFromMnemonic } from 'lib/wallet';
16import { isDevelopment } from 'lib/flags';
17import useImpliedTicket from 'lib/useImpliedTicket';
18import useHasDisclaimed from 'lib/useHasDisclaimed';
20import 'style/index.scss';
21import WithErrorBoundary from 'components/WithErrorBoundary';
22import GlobalErrorBoundary from 'components/GlobalErrorBoundary';
24const INITIAL_NETWORK_TYPE = isDevelopment
26 : NETWORK_TYPES.MAINNET;
28// NB(shrugs): modify these variables to change the default local state.
29const SHOULD_STUB_LOCAL = process.env.REACT_APP_STUB_LOCAL === 'true';
30const IS_STUBBED = isDevelopment && SHOULD_STUB_LOCAL;
32const INITIAL_WALLET = IS_STUBBED
34 process.env.REACT_APP_DEV_MNEMONIC,
35 process.env.REACT_APP_HD_PATH
38const INITIAL_MNEMONIC = IS_STUBBED
39 ? Just(process.env.REACT_APP_DEV_MNEMONIC)
41const INITIAL_POINT_CURSOR = IS_STUBBED ? Just(65792) : Nothing();
43function useInitialRoutes() {
44 const [hasDisclaimed] = useHasDisclaimed();
45 const hasImpliedTicket = !!useImpliedTicket();
49 { key: ROUTE_NAMES.LOGIN },
50 { key: ROUTE_NAMES.POINTS },
51 { key: ROUTE_NAMES.POINT },
55 if (hasImpliedTicket) {
56 return [{ key: ROUTE_NAMES.ACTIVATE }];
60 return [{ key: ROUTE_NAMES.DISCLAIMER, data: { next: ROUTE_NAMES.LOGIN } }];
63 return [{ key: ROUTE_NAMES.LOGIN }];
67 const initialRoutes = useInitialRoutes();
70 <WithErrorBoundary render={error => <GlobalErrorBoundary error={error} />}>
74 initialRoutes={initialRoutes}
75 initialNetworkType={INITIAL_NETWORK_TYPE}
76 initialWallet={INITIAL_WALLET}
77 initialMnemonic={INITIAL_MNEMONIC}
78 initialPointCursor={INITIAL_POINT_CURSOR}>
88export default process.env.NODE_ENV === 'development' ? hot(Bridge) : Bridge;
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