@@ -9,10 +9,10 @@ import nest from './lib/nest';
99import { router } from './lib/router';
1010import { ROUTE_NAMES } from './lib/routeNames';
1111import { NETWORK_TYPES } from './lib/network';
12−import { DEFAULT_HD_PATH, walletFromMnemonic } from './lib/wallet';
12+import { walletFromMnemonic } from './lib/wallet';
1313import { isDevelopment } from './lib/flags';
1414
15−import { HistoryProvider, withHistory, useHistory } from './store/history';
15+import { HistoryProvider, useHistory } from './store/history';
1616import { TxnConfirmationsProvider } from './store/txnConfirmations';
1717import { OnlineProvider } from './store/online';
1818import { NetworkProvider } from './store/network';
@@ -42,6 +42,9 @@ const kInitialWallet = kIsStubbed
4242 process.env.REACT_APP_HD_PATH
4343 )
4444 : undefined;
45+const kInitialMnemonic = kIsStubbed
46+ ? process.env.REACT_APP_DEV_MNEMONIC
47+ : Nothing();
4548
4649// the router itself is just a component that renders a specific view
4750// depending on the history
@@ -52,23 +55,26 @@ const Router = function(props) {
5255 return <Route {...props} />;
5356};
5457
55−// NB(shrugs): separate component because it needs withHistory
58+// NB(shrugs): separate component because it needs useHistory
5659// this will be must better structured as part of the UI overhaul
57−const VariableWidthColumn = withHistory(({ history, children }) => (
60+const VariableWidthColumn = function({ children }) {
61+ const history = useHistory();
5862 // For the invite acceptance flow, widen the screen to use the full
5963 // container, and hide the breadcrumbs
60− <Col
61− className={
62− history.includes(ROUTE_NAMES.INVITE_TICKET)
63− ? 'col-md-12'
64− : 'col-md-offset-1 col-md-10'
65− }
66− style={
67− history.includes(ROUTE_NAMES.INVITE_TICKET) ? {} : { maxWidth: '620px' }
68− }>
69− {children}
70− </Col>
71−));
64+ return (
65+ <Col
66+ className={
67+ history.includes(ROUTE_NAMES.INVITE_TICKET)
68+ ? 'col-md-12'
69+ : 'col-md-offset-1 col-md-10'
70+ }
71+ style={
72+ history.includes(ROUTE_NAMES.INVITE_TICKET) ? {} : { maxWidth: '620px' }
73+ }>
74+ {children}
75+ </Col>
76+ );
77+};
7278
7379// nest all of the providers within each other to avoid hella depth
7480const AllProviders = nest([
@@ -84,9 +90,6 @@ class Bridge extends React.Component {
8490 super(props);
8591
8692 this.state = {
87− // urbit wallet-related
88− urbitWallet: Nothing(),
89− authMnemonic: Nothing(),
9093 networkSeedCache: null,
9194 // point
9295 pointCursor: Nothing(),
@@ -96,8 +99,6 @@ class Bridge extends React.Component {
9699 txnConfirmations: {},
97100 };
98101
99− this.setUrbitWallet = this.setUrbitWallet.bind(this);
100− this.setAuthMnemonic = this.setAuthMnemonic.bind(this);
101102 this.setPointCursor = this.setPointCursor.bind(this);
102103 this.setTxnHashCursor = this.setTxnHashCursor.bind(this);
103104 this.setNetworkSeedCache = this.setNetworkSeedCache.bind(this);
@@ -110,12 +111,8 @@ class Bridge extends React.Component {
110111 // If running in development, the following can be tweaked to get you set
111112 // up with a desirable initial state.
112113 if (kIsStubbed) {
113− const mnemonic = process.env.REACT_APP_DEV_MNEMONIC;
114−
115114 this.setState({
116115 pointCursor: Just(0),
117− urbitWallet: Nothing(),
118− authMnemonic: Just(mnemonic),
119116 });
120117 }
121118 }
@@ -127,28 +124,6 @@ class Bridge extends React.Component {
127124 });
128125 }
129126
130− // also sets wallet to ownership address
131− setUrbitWallet(urbitWallet) {
132− let wallet = this.state.wallet;
133− if (Just.hasInstance(urbitWallet)) {
134− const mnemonic = urbitWallet.value.ownership.seed;
135− wallet = walletFromMnemonic(
136− mnemonic,
137− DEFAULT_HD_PATH,
138− urbitWallet.value.meta.passphrase
139− );
140− wallet.map(wal => {
141− wal.address = urbitWallet.value.ownership.keys.address;
142− return wal;
143− });
144− }
145− this.setState({ urbitWallet, wallet });
146− }
147−
148− setAuthMnemonic(authMnemonic) {
149− this.setState({ authMnemonic });
150− }
151−
152127 setPointCursor(pointCursor) {
153128 this.setState({ pointCursor });
154129 }
@@ -165,8 +140,6 @@ class Bridge extends React.Component {
165140
166141 render() {
167142 const {
168− urbitWallet,
169− authMnemonic,
170143 networkSeedCache,
171144 networkRevisionCache,
172145 pointCursor,
@@ -178,7 +151,8 @@ class Bridge extends React.Component {
178151 <AllProviders
179152 initialRoutes={kInitialRoutes}
180153 initialNetworkType={kInitialNetworkType}
181− initialWallet={kInitialWallet}>
154+ initialWallet={kInitialWallet}
155+ initialMnemonic={kInitialMnemonic}>
182156 <Container>
183157 <Row>
184158 <VariableWidthColumn>
@@ -186,10 +160,6 @@ class Bridge extends React.Component {
186160
187161 <Row className={'row wrapper'}>
188162 <Router
189− urbitWallet={urbitWallet}
190− setUrbitWallet={this.setUrbitWallet}
191− authMnemonic={authMnemonic}
192− setAuthMnemonic={this.setAuthMnemonic}
193163 setPointCursor={this.setPointCursor}
194164 addToPointCache={this.addToPointCache}
195165 pointCursor={pointCursor}