be-components 0.5.3 → 0.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/lib/commonjs/Checkout/components/PayPalOrderCapture.js +3 -1
  2. package/lib/commonjs/Checkout/components/PayPalOrderCapture.js.map +1 -1
  3. package/lib/commonjs/Checkout/index.js +3 -2
  4. package/lib/commonjs/Checkout/index.js.map +1 -1
  5. package/lib/commonjs/Wallet/api/index.js +12 -8
  6. package/lib/commonjs/Wallet/api/index.js.map +1 -1
  7. package/lib/commonjs/Wallet/components/ACHAddCard.js +14 -2
  8. package/lib/commonjs/Wallet/components/ACHAddCard.js.map +1 -1
  9. package/lib/commonjs/Wallet/components/AccountManager.js +8 -3
  10. package/lib/commonjs/Wallet/components/AccountManager.js.map +1 -1
  11. package/lib/commonjs/Wallet/components/DepositCard.js +82 -25
  12. package/lib/commonjs/Wallet/components/DepositCard.js.map +1 -1
  13. package/lib/commonjs/Wallet/components/LinkAccountManager.js +110 -2
  14. package/lib/commonjs/Wallet/components/LinkAccountManager.js.map +1 -1
  15. package/lib/commonjs/Wallet/components/WalletActionSelector.js +29 -7
  16. package/lib/commonjs/Wallet/components/WalletActionSelector.js.map +1 -1
  17. package/lib/commonjs/Wallet/components/WalletSetup.js +1 -1
  18. package/lib/commonjs/Wallet/components/WithdrawCard.js +3 -2
  19. package/lib/commonjs/Wallet/components/WithdrawCard.js.map +1 -1
  20. package/lib/commonjs/Wallet/index.js +283 -60
  21. package/lib/commonjs/Wallet/index.js.map +1 -1
  22. package/lib/module/Checkout/components/PayPalOrderCapture.js +3 -1
  23. package/lib/module/Checkout/components/PayPalOrderCapture.js.map +1 -1
  24. package/lib/module/Checkout/index.js +3 -2
  25. package/lib/module/Checkout/index.js.map +1 -1
  26. package/lib/module/Wallet/api/index.js +12 -8
  27. package/lib/module/Wallet/api/index.js.map +1 -1
  28. package/lib/module/Wallet/components/ACHAddCard.js +14 -2
  29. package/lib/module/Wallet/components/ACHAddCard.js.map +1 -1
  30. package/lib/module/Wallet/components/AccountManager.js +8 -3
  31. package/lib/module/Wallet/components/AccountManager.js.map +1 -1
  32. package/lib/module/Wallet/components/DepositCard.js +82 -25
  33. package/lib/module/Wallet/components/DepositCard.js.map +1 -1
  34. package/lib/module/Wallet/components/LinkAccountManager.js +110 -2
  35. package/lib/module/Wallet/components/LinkAccountManager.js.map +1 -1
  36. package/lib/module/Wallet/components/WalletActionSelector.js +29 -7
  37. package/lib/module/Wallet/components/WalletActionSelector.js.map +1 -1
  38. package/lib/module/Wallet/components/WalletSetup.js +1 -1
  39. package/lib/module/Wallet/components/WithdrawCard.js +3 -2
  40. package/lib/module/Wallet/components/WithdrawCard.js.map +1 -1
  41. package/lib/module/Wallet/index.js +283 -60
  42. package/lib/module/Wallet/index.js.map +1 -1
  43. package/lib/typescript/src/Checkout/components/PayPalOrderCapture.d.ts.map +1 -1
  44. package/lib/typescript/src/Checkout/index.d.ts.map +1 -1
  45. package/lib/typescript/src/Wallet/api/index.d.ts.map +1 -1
  46. package/lib/typescript/src/Wallet/components/ACHAddCard.d.ts.map +1 -1
  47. package/lib/typescript/src/Wallet/components/AccountManager.d.ts.map +1 -1
  48. package/lib/typescript/src/Wallet/components/DepositCard.d.ts.map +1 -1
  49. package/lib/typescript/src/Wallet/components/LinkAccountManager.d.ts.map +1 -1
  50. package/lib/typescript/src/Wallet/components/WalletActionSelector.d.ts +1 -1
  51. package/lib/typescript/src/Wallet/components/WalletActionSelector.d.ts.map +1 -1
  52. package/lib/typescript/src/Wallet/index.d.ts +6 -1
  53. package/lib/typescript/src/Wallet/index.d.ts.map +1 -1
  54. package/package.json +1 -1
  55. package/src/Checkout/components/PayPalOrderCapture.tsx +3 -1
  56. package/src/Checkout/index.tsx +4 -2
  57. package/src/Observer/api/types.d.ts +1 -1
  58. package/src/Wallet/api/index.ts +7 -7
  59. package/src/Wallet/components/ACHAddCard.tsx +7 -1
  60. package/src/Wallet/components/AccountManager.tsx +3 -2
  61. package/src/Wallet/components/DepositCard.tsx +29 -6
  62. package/src/Wallet/components/LinkAccountManager.tsx +44 -1
  63. package/src/Wallet/components/WalletActionSelector.tsx +18 -4
  64. package/src/Wallet/components/WalletSetup.tsx +1 -1
  65. package/src/Wallet/components/WithdrawCard.tsx +3 -3
  66. package/src/Wallet/index.tsx +136 -52
@@ -25,20 +25,30 @@ import WalletActionSelector from './components/WalletActionSelector';
25
25
  import ACHAddCard from './components/ACHAddCard';
26
26
  import OrderManager from './components/OrderManager';
27
27
  import WalletSettings from './components/WalletSettings';
28
+ import type { BEEventProps } from '../Observer/api/types';
28
29
 
29
30
  type MyWalletProps = {
30
31
  account_id?:string,
32
+ new_balance?:PlayerBalanceProps,
33
+ height?:number,
31
34
  onClose:() => void,
35
+ onEvent:(event:BEEventProps) => void
32
36
  onTransact: (item_order:ItemOrderProps, account_id?:string) => void
33
37
  }
34
38
 
35
39
 
36
- const MyWallet = ({ account_id, onTransact, onClose }:MyWalletProps) => {
40
+ const MyWallet = ({ height, new_balance, account_id, onTransact, onClose, onEvent }:MyWalletProps) => {
37
41
  const [ wallet_size, setWalletSize ] = useState({ height:0, width:0 });
38
- const [ active_view, setActiveView ] = useState('wallet');
42
+ const [ view, setView ] = useState<{
43
+ active_view:string,
44
+ on_next_view?:string
45
+ }>({
46
+ active_view: 'wallet'
47
+ });
39
48
  const [ walkthrough, setWalkthrough ] = useState<{
40
49
  enabled:boolean,
41
- active_step:string,
50
+ active_step?:string,
51
+ next_step?:string,
42
52
  steps:any[],
43
53
  step_action?:string,
44
54
  }>({
@@ -79,12 +89,23 @@ const MyWallet = ({ account_id, onTransact, onClose }:MyWalletProps) => {
79
89
  player_addresses:[],
80
90
  code_details: {}
81
91
  })
92
+ const { active_view } = view;
82
93
  const { my_referral, loaded, player, wallet_settings, player_balance, deposit_limit, code_details, withdraw_limit, accounts, player_addresses, my_orders } = wallet
83
94
  const ibt_placeholder_account = accounts.find(a => a.ibt_placeholder);
84
95
 
85
96
  useEffect(() => {
86
- getData()
87
- },[])
97
+ if(!loaded){ getData() }
98
+ if(loaded && new_balance){ setWallet({ ...wallet, player_balance:new_balance }) }
99
+ },[new_balance])
100
+
101
+ useEffect(() => {
102
+ if(onEvent){ onEvent({ event_name: 'wallet_view', event_data: { active_view, account_id:selected_account?.account_id }, level: 2 }) }
103
+ },[active_view])
104
+
105
+ useEffect(() => {
106
+ if(!walkthrough.enabled){ return }
107
+ if(onEvent){ onEvent({ event_name: 'wallet_walkthrough', event_data: { active_step: walkthrough.active_step, step_action: walkthrough.step_action }, level:1 }) }
108
+ },[walkthrough])
88
109
 
89
110
  const getData = async() => {
90
111
  WalletApi.setEnvironment();
@@ -103,8 +124,9 @@ const MyWallet = ({ account_id, onTransact, onClose }:MyWalletProps) => {
103
124
 
104
125
 
105
126
  const steps = WalletHelpers.genWalkthroughSteps(ws, accts, { item_orders, items })
106
- setWalkthrough({ enabled:!ws.pin?true:false, active_step: 'add_ach_account', steps })
107
-
127
+ setWalkthrough({ enabled:!ws.pin?true:false, active_step: 'welcome', steps, next_step: 'my_balance' })
128
+ if(!ws.pin && onEvent){ onEvent({ event_name: 'launch_wallet_wizard', event_data:{}, level:1 })}
129
+
108
130
  setWallet({
109
131
  ...wallet,
110
132
  loaded:true,
@@ -136,8 +158,8 @@ const MyWallet = ({ account_id, onTransact, onClose }:MyWalletProps) => {
136
158
  }
137
159
  const handleSelectAccount = async(account:AccountProps) => {
138
160
  setSelectedAccount(account)
139
- if(account.status == 'verify'){ return setActiveView('verify') }
140
- setActiveView('manage_account')
161
+ if(account.status == 'verify'){ return setView({active_view:'verify'}) }
162
+ setView({active_view:'manage_account'})
141
163
  }
142
164
 
143
165
  const renderWalkthroughProgress = (data:{ item:any, index:number }) => {
@@ -175,7 +197,7 @@ const MyWallet = ({ account_id, onTransact, onClose }:MyWalletProps) => {
175
197
 
176
198
  if(walkthrough.enabled){
177
199
  return (
178
- <View style={{ flex:1 }}>
200
+ <View style={{ flex:1, height }}>
179
201
  <View style={{ padding:10, marginRight:10, marginLeft:10, justifyContent:'center', alignItems:'center' }} onLayout={(ev) => {
180
202
  const { height, width } = ev.nativeEvent.layout;
181
203
  setWalletSize({ height, width })
@@ -196,27 +218,37 @@ const MyWallet = ({ account_id, onTransact, onClose }:MyWalletProps) => {
196
218
  <WalletSetup
197
219
  player={player}
198
220
  wallet_settings={wallet_settings}
199
- onClose={() => setWalkthrough({ ...walkthrough, enabled:false })}
221
+ onClose={() => {
222
+ if(!wallet_settings.pin){ return onClose() }
223
+ setWalkthrough({ ...walkthrough, enabled:false })
224
+ if(onEvent){ onEvent({ event_name:'close_wallet_walkthrough', event_data: {}, level:1 }) }
225
+ }}
200
226
  onNext={() => {
201
227
  if(WalletHelpers.isWalletAuthenticated(wallet_settings)){
202
- const steps = WalletHelpers.genWalkthroughSteps(wallet_settings, accounts, my_orders)
203
- setWalkthrough({ ...walkthrough, steps, active_step:'my_balance' })
228
+ setWalkthrough({ ...walkthrough, active_step:walkthrough.next_step, next_step:'fund_account' })
204
229
  }
205
230
  }}
206
231
  onSettingsUpdate={(ws) => {
207
232
  setWallet({ ...wallet, wallet_settings: ws })
233
+ if(WalletHelpers.isWalletAuthenticated(ws)){
234
+ const steps = WalletHelpers.genWalkthroughSteps(ws, accounts, my_orders)
235
+ setWalkthrough({ ...walkthrough, steps })
236
+ }
208
237
  }}
209
238
  />
210
239
  :walkthrough.active_step == 'my_balance' ?
211
240
  <MyBalance
212
241
  player={player}
213
242
  player_balance={player_balance}
214
- onClose={() => setWalkthrough({ ...walkthrough, enabled:false })}
243
+ onClose={() => {
244
+ setWalkthrough({ ...walkthrough, enabled:false })
245
+ if(onEvent){ onEvent({ event_name:'close_wallet_walkthrough', event_data: {}, level:1 }) }
246
+ }}
215
247
  onNext={() => {
216
- setWalkthrough({ ...walkthrough, active_step: 'add_ach_account' })
248
+ setWalkthrough({ ...walkthrough, active_step: walkthrough.next_step, next_step: 'deposit' })
217
249
  }}
218
250
  />
219
- :walkthrough.active_step == 'add_ach_account' ?
251
+ :walkthrough.active_step == 'fund_account' ?
220
252
  <View style={{ flex:1 }}>
221
253
  {!walkthrough.step_action ?
222
254
  <FundAccountCard
@@ -225,9 +257,11 @@ const MyWallet = ({ account_id, onTransact, onClose }:MyWalletProps) => {
225
257
  walkthrough
226
258
  code_details={code_details}
227
259
  onManualACH={() => setWalkthrough({ ...walkthrough, step_action:'manual_ach' })}
228
- onClose={() => setWalkthrough({ ...walkthrough, enabled:false })}
260
+ onClose={() => {
261
+ setWalkthrough({ ...walkthrough, enabled:false })
262
+ if(onEvent){ onEvent({ event_name:'close_wallet_walkthrough', event_data: {}, level:1 }) }
263
+ }}
229
264
  onCard={(account) => {
230
- console.log(account)
231
265
  if(account){
232
266
  setSelectedAccount(account)
233
267
  return setWalkthrough({ ...walkthrough, active_step:'deposit' })
@@ -236,15 +270,17 @@ const MyWallet = ({ account_id, onTransact, onClose }:MyWalletProps) => {
236
270
  }}
237
271
  onSelectAccount={(acct) => {
238
272
  setSelectedAccount(acct);
273
+ setWalkthrough({ ...walkthrough, active_step:'deposit' })
239
274
  }}
240
275
  onNext={() => {
241
- setWalkthrough({ ...walkthrough, active_step: 'deposit' })
242
276
  let default_account = accounts.find(a => a.default_account)
243
277
  if(!default_account){
244
278
  default_account = accounts.find(a => a.account_type == 'paypal');
245
279
  }
246
- setSelectedAccount(default_account)
247
- setActiveView('deposit')
280
+ if(default_account){
281
+ setSelectedAccount(default_account)
282
+ setWalkthrough({ ...walkthrough, active_step: walkthrough.next_step })
283
+ }
248
284
  }}
249
285
  />
250
286
  :walkthrough.step_action == 'manual_ach' ?
@@ -270,12 +306,51 @@ const MyWallet = ({ account_id, onTransact, onClose }:MyWalletProps) => {
270
306
  player={player}
271
307
  onAddAccount={(acct) => {
272
308
  setWallet({ ...wallet, accounts: accounts.concat(acct) })
273
- setWalkthrough({ ...walkthrough, step_action: undefined })
309
+ setSelectedAccount(acct)
310
+ setWalkthrough({ ...walkthrough, step_action: undefined, active_step:'deposit' })
274
311
  }}
275
312
  onCancel={() => setWalkthrough({ ...walkthrough, step_action: undefined })}
276
313
  />
277
314
  :<></>}
278
315
  </View>
316
+ : walkthrough.active_step == 'withdraw'?
317
+ <View style={{ flex:1 }}>
318
+ {!walkthrough.step_action ?
319
+ <ACHAddCard
320
+ player={player}
321
+ accounts={accounts}
322
+ onManualACH={() => {
323
+ setWalkthrough({ ...walkthrough, step_action: 'manual_ach' })
324
+ }}
325
+ onClose={() => {
326
+ setWalkthrough({ ...walkthrough, enabled:false })
327
+ }}
328
+ onNext={() => {
329
+ setWalkthrough({ ...walkthrough, enabled:false })
330
+ }}
331
+ onLinkACH={() => {
332
+ setWalkthrough({ ...walkthrough, step_action: 'link_ach' })
333
+ }}
334
+ />
335
+ :<></>}
336
+ {walkthrough.step_action == 'manual_ach' ?
337
+ <ManualACHAdd
338
+ player={player}
339
+ onAddAccount={(acct) => setWallet({ ...wallet, accounts: accounts.concat(acct) })}
340
+ onCancel={() => setWalkthrough({ ...walkthrough, step_action: undefined })}
341
+ />
342
+ :walkthrough.step_action == 'link_ach' && ibt_placeholder_account ?
343
+ <LinkAccountManager
344
+ ibt_placeholer_account={ibt_placeholder_account}
345
+ onComplete={(acct) => {
346
+ setWallet({ ...wallet, accounts: accounts.filter(a => a.account_id != acct.account_id).concat(acct) })
347
+ setWalkthrough({ ...walkthrough, step_action:undefined });
348
+ }}
349
+ onCancel={() => setWalkthrough({ ...walkthrough, step_action:undefined })}
350
+ />
351
+ :<></>}
352
+ </View>
353
+
279
354
  : walkthrough.active_step == 'deposit' && selected_account ?
280
355
  <DepositCard
281
356
  player={player}
@@ -284,7 +359,7 @@ const MyWallet = ({ account_id, onTransact, onClose }:MyWalletProps) => {
284
359
  code_details={code_details}
285
360
  account={selected_account}
286
361
  onCancel={() => {
287
- setWalkthrough({ ...walkthrough, active_step:'add_ach_account' })
362
+ setWalkthrough({ ...walkthrough, active_step:'fund_account' })
288
363
  }}
289
364
  onTransact={(item_order) => onTransact(item_order, selected_account.account_id)}
290
365
  />
@@ -293,17 +368,17 @@ const MyWallet = ({ account_id, onTransact, onClose }:MyWalletProps) => {
293
368
  )
294
369
  }
295
370
 
296
-
297
371
  return (
298
- <View style={{ flex:1, backgroundColor:Colors.brand.midnight }}>
372
+ <View style={{ flex:1, height }}>
299
373
  {!WalletHelpers.isWalletAuthenticated(wallet_settings) ?
300
374
  <WalletSetup
301
375
  player={player}
302
376
  wallet_settings={wallet_settings}
377
+ onClose={() => onClose()}
303
378
  onSettingsUpdate={(ws) => {
304
379
  setWallet({ ...wallet, wallet_settings: ws })
305
380
  if(WalletHelpers.isWalletAuthenticated(ws)){
306
- setActiveView('wallet')
381
+ setView({ active_view: 'wallet' })
307
382
  }
308
383
  }}
309
384
  />
@@ -313,10 +388,12 @@ const MyWallet = ({ account_id, onTransact, onClose }:MyWalletProps) => {
313
388
  player={player}
314
389
  player_balance={player_balance}
315
390
  accounts={accounts}
316
- onStartWalkthrough={(walkthrough) => setWalkthrough(walkthrough)}
391
+ onStartWalkthrough={(walkthrough, account) => {
392
+ if(account){ setSelectedAccount(account) }
393
+ setWalkthrough(walkthrough)
394
+ }}
317
395
  onActionSelect={(action, account) => {
318
- setActiveView(action.action);
319
- console.log(action.action)
396
+ setView({ active_view: action.action })
320
397
  if(account){ setSelectedAccount(account) }
321
398
  }}
322
399
  onClose={onClose}
@@ -325,11 +402,11 @@ const MyWallet = ({ account_id, onTransact, onClose }:MyWalletProps) => {
325
402
  <AccountManager
326
403
  accounts={accounts}
327
404
  onSelectInstantBankTransfer={() => {
328
- setActiveView('add_ibt');
405
+ setView({ active_view: 'add_ibt' });
329
406
  }}
330
- onClose={() => setActiveView('wallet')}
331
- onSelectManualACH={() => setActiveView('add_ach')}
332
- onSelectManualCard={() => setActiveView('add_card')}
407
+ onClose={() => setView({ active_view: 'wallet' })}
408
+ onSelectManualACH={() => setView({active_view:'add_ach'})}
409
+ onSelectManualCard={() => setView({active_view:'add_card'})}
333
410
  onSelectAccount={(acct) => handleSelectAccount(acct)}
334
411
  />
335
412
  :active_view == 'addresses' ?
@@ -343,7 +420,7 @@ const MyWallet = ({ account_id, onTransact, onClose }:MyWalletProps) => {
343
420
  />
344
421
  :active_view == 'order_history' ?
345
422
  <OrderManager
346
- onClose={() => setActiveView('wallet')}
423
+ onClose={() => setView({ active_view:'wallet' })}
347
424
 
348
425
  />
349
426
  :active_view == 'wallet_settings' ?
@@ -353,16 +430,20 @@ const MyWallet = ({ account_id, onTransact, onClose }:MyWalletProps) => {
353
430
  deposit_limit={deposit_limit}
354
431
  my_referral={my_referral}
355
432
  onPremium={() => console.log('go premium')}
356
- onClose={() => setActiveView('wallet')}
433
+ onClose={() => setView({active_view:'wallet'})}
357
434
  />
358
- : active_view == 'add_ach_account' ?
435
+ : active_view == 'ach_add' ?
359
436
  <ACHAddCard
360
437
  player={player}
361
438
  accounts={accounts}
362
- onManualACH={() => setActiveView('add_ach')}
363
- onClose={() => setActiveView('wallet')}
364
- onNext={() => console.log('NEXT!')}
365
- onLinkACH={() => setActiveView('link_ach')}
439
+ onManualACH={() => setView({active_view:'add_ach'})}
440
+ onClose={() => setView({ active_view: 'wallet' })}
441
+ onNext={(account) => {
442
+ setSelectedAccount(account);
443
+ if(account.status == 'verify'){ return setView({active_view:'verify'}) }
444
+ return setView({active_view:'wallet'})
445
+ }}
446
+ onLinkACH={() => setView({active_view:'add_ibt'})}
366
447
  />
367
448
  :active_view == 'account_limit' && selected_account ?
368
449
  <AccountLimitManager
@@ -391,7 +472,7 @@ const MyWallet = ({ account_id, onTransact, onClose }:MyWalletProps) => {
391
472
  deposit_limit={deposit_limit}
392
473
  withdraw_limit={withdraw_limit}
393
474
  onAccountUpdate={(acct) => setWallet({ ...wallet, accounts: accounts.filter(a => a.account_id != acct.account_id) })}
394
- onClose={() => setActiveView('my_accounts')}
475
+ onClose={() => setView({active_view:'my_accounts'})}
395
476
  onTransact={onTransact}
396
477
  />
397
478
  :active_view == 'deposit' && selected_account ?
@@ -402,7 +483,7 @@ const MyWallet = ({ account_id, onTransact, onClose }:MyWalletProps) => {
402
483
  account={selected_account}
403
484
  code_details={code_details}
404
485
  onCancel={() => {
405
- return setActiveView('wallet')
486
+ return setView({active_view:'wallet'})
406
487
  //return setActiveView('manage_account')
407
488
  }}
408
489
  onTransact={(item_order) => onTransact(item_order, selected_account.account_id)}
@@ -416,13 +497,13 @@ const MyWallet = ({ account_id, onTransact, onClose }:MyWalletProps) => {
416
497
  deposit_limit={deposit_limit}
417
498
  account={selected_account}
418
499
  onTransact={(item_order) => onTransact(item_order, selected_account.account_id)}
419
- onCancel={() => setActiveView('my_accounts')}
500
+ onCancel={() => setView({active_view:'my_accounts'})}
420
501
  />
421
502
  :active_view == 'verify' && selected_account ?
422
503
  <VerifyACHAccount
423
504
  account={selected_account}
424
505
  onClose={() => {
425
- setActiveView('my_accounts')
506
+ setView({active_view:'my_accounts'})
426
507
  setSelectedAccount(undefined);
427
508
  }}
428
509
  onUpdateAccount={(acct) => {
@@ -433,23 +514,26 @@ const MyWallet = ({ account_id, onTransact, onClose }:MyWalletProps) => {
433
514
  :active_view == 'add_ibt' && ibt_placeholder_account?
434
515
  <LinkAccountManager
435
516
  ibt_placeholer_account={ibt_placeholder_account}
436
- onComplete={(account_id) => console.log(account_id)}
437
- onCancel={() => setActiveView('my_accounts')}
517
+ onComplete={(acct) => {
518
+ setWallet({ ...wallet, accounts: accounts.filter(a => a.account_id != acct.account_id).concat(acct) })
519
+ setView({active_view:'my_accounts'});
520
+ }}
521
+ onCancel={() => setView({active_view:'my_accounts'})}
438
522
  />
439
523
  :active_view == 'add_ach'?
440
524
  <ManualACHAdd
441
525
  player={player}
442
526
  onAddAccount={(acct) => setWallet({ ...wallet, accounts: accounts.concat(acct) })}
443
- onCancel={() => setActiveView('my_accounts')}
527
+ onCancel={() => setView({active_view:'my_accounts'})}
444
528
  />
445
529
  :active_view == 'add_card'?
446
530
  <ManualCardAdd
447
531
  player={player}
448
532
  onAddAccount={(acct) => {
449
533
  setWallet({ ...wallet, accounts: accounts.concat(acct) })
450
- setActiveView('my_accounts')
534
+ setView({active_view:'my_accounts'})
451
535
  }}
452
- onCancel={() => setActiveView('my_accounts')}
536
+ onCancel={() => setView({active_view:'my_accounts'})}
453
537
  />
454
538
  :active_view == 'add' ?
455
539
  <FundAccountCard
@@ -462,12 +546,12 @@ const MyWallet = ({ account_id, onTransact, onClose }:MyWalletProps) => {
462
546
  setSelectedAccount(account)
463
547
  return setWalkthrough({ ...walkthrough, step_action: 'deposit' })
464
548
  }
465
- setActiveView('add_card')
549
+ setView({active_view:'add_card'})
466
550
  }}
467
- onManualACH={() => setActiveView('add_ach')}
551
+ onManualACH={() => setView({active_view:'add_ach'})}
468
552
  onSelectAccount={(acct) => {
469
553
  setSelectedAccount(acct);
470
- setActiveView('deposit')
554
+ setView({active_view:'deposit'})
471
555
  }}
472
556
  onNext={() => console.log('next')}
473
557
  onClose={() => console.log('')}