-
Notifications
You must be signed in to change notification settings - Fork 291
Expand file tree
/
Copy pathMain.tsx
More file actions
1325 lines (1293 loc) · 49.5 KB
/
Copy pathMain.tsx
File metadata and controls
1325 lines (1293 loc) · 49.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import {
type BottomTabNavigationOptions,
createBottomTabNavigator
} from '@react-navigation/bottom-tabs'
import { createDrawerNavigator } from '@react-navigation/drawer'
import { DefaultTheme, NavigationContainer } from '@react-navigation/native'
import {
createStackNavigator,
type StackNavigationOptions
} from '@react-navigation/stack'
import * as React from 'react'
import { Platform } from 'react-native'
import { getDeviceSettings } from '../actions/DeviceSettingsActions'
import { SwapCreateScene as SwapCreateSceneComponent } from '../components/scenes/SwapCreateScene'
import { ENV } from '../env'
import { useExperimentConfig } from '../hooks/useExperimentConfig'
import { useMount } from '../hooks/useMount'
import { lstrings } from '../locales/strings'
import { cleanBrandName } from '../plugins/gift-cards/phazeGiftCardTypes'
import { AddressFormScene } from '../plugins/gui/scenes/AddressFormScene'
import { ConfirmationScene } from '../plugins/gui/scenes/ConfirmationScene'
import { ContactFormScene } from '../plugins/gui/scenes/ContactFormScene'
import { FiatPluginEnterAmountScene as FiatPluginEnterAmountSceneComponent } from '../plugins/gui/scenes/FiatPluginEnterAmountScene'
import { FiatPluginWebViewComponent } from '../plugins/gui/scenes/FiatPluginWebView'
import { InfoDisplayScene } from '../plugins/gui/scenes/InfoDisplayScene'
import { RewardsCardDashboardScene as RewardsCardListSceneComponent } from '../plugins/gui/scenes/RewardsCardDashboardScene'
import { RewardsCardWelcomeScene as RewardsCardWelcomeSceneComponent } from '../plugins/gui/scenes/RewardsCardWelcomeScene'
import { SepaFormScene } from '../plugins/gui/scenes/SepaFormScene'
import { useDispatch, useSelector } from '../types/reactRedux'
import type {
BuySellTabParamList,
DrawerParamList,
EdgeAppStackParamList,
EdgeTabsParamList,
NavigationBase,
RootParamList,
RootSceneProps,
SwapTabParamList,
WalletsTabParamList
} from '../types/routerTypes'
import { isMaestro } from '../util/maestro'
import { logEvent } from '../util/tracking'
import { getUkCompliantString } from '../util/ukComplianceUtils'
import { ifLoggedIn } from './hoc/IfLoggedIn'
import { BackButton } from './navigation/BackButton'
import { CurrencySettingsTitle } from './navigation/CurrencySettingsTitle'
import { EdgeHeader } from './navigation/EdgeHeader'
import { PluginBackButton } from './navigation/GuiPluginBackButton'
import { HeaderBackground } from './navigation/HeaderBackground'
import { HeaderTextButton } from './navigation/HeaderTextButton'
import { HeaderTitle } from './navigation/HeaderTitle'
import { ParamHeaderTitle } from './navigation/ParamHeaderTitle'
import { SideMenuButton } from './navigation/SideMenuButton'
import { TransactionDetailsTitle } from './navigation/TransactionDetailsTitle'
import { LoadingSplashScreen } from './progress-indicators/LoadingSplashScreen'
import { AssetSettingsScene as AssetSettingsSceneComponent } from './scenes/AssetSettingsScene'
import { ChangeMiningFeeScene as ChangeMiningFeeSceneComponent } from './scenes/ChangeMiningFeeScene'
import { ChangePasswordScene as ChangePasswordSceneComponent } from './scenes/ChangePasswordScene'
import { ChangePinScene as ChangePinSceneComponent } from './scenes/ChangePinScene'
import { ChangeUsernameScene as ChangeUsernameSceneComponent } from './scenes/ChangeUsernameScene'
import { CoinRankingDetailsScene as CoinRankingDetailsSceneComponent } from './scenes/CoinRankingDetailsScene'
import { CoinRankingScene as CoinRankingSceneComponent } from './scenes/CoinRankingScene'
import { ConfirmScene as ConfirmSceneComponent } from './scenes/ConfirmScene'
import { CreateWalletAccountSelectScene as CreateWalletAccountSelectSceneComponent } from './scenes/CreateWalletAccountSelectScene'
import { CreateWalletAccountSetupScene as CreateWalletAccountSetupSceneComponent } from './scenes/CreateWalletAccountSetupScene'
import { CreateWalletCompletionScene as CreateWalletCompletionSceneComponent } from './scenes/CreateWalletCompletionScene'
import { CreateWalletEditNameScene as CreateWalletSelectFiatSceneComponent } from './scenes/CreateWalletEditNameScene'
import { CreateWalletImportScene as CreateWalletImportSceneComponent } from './scenes/CreateWalletImportScene'
import { CreateWalletSelectCryptoScene as CreateWalletSelectCryptoSceneComponent } from './scenes/CreateWalletSelectCryptoScene'
import { CurrencyNotificationScene as CurrencyNotificationSceneComponent } from './scenes/CurrencyNotificationScene'
import { CurrencySettingsScene as CurrencySettingsSceneComponent } from './scenes/CurrencySettingsScene'
import { DebugScene as DebugSceneComponent } from './scenes/DebugScene'
import { DefaultFiatSettingScene as DefaultFiatSettingSceneComponent } from './scenes/DefaultFiatSettingScene'
import { DevTestScene } from './scenes/DevTestScene'
import { DuressModeHowToScene as DuressModeHowToSceneComponent } from './scenes/DuressModeHowToScene'
import { DuressModeSettingScene as DuressModeSettingSceneComponent } from './scenes/DuressModeSettingScene'
import { DuressPinScene as DuressPinSceneComponent } from './scenes/DuressPinScene'
import { EdgeLoginScene as EdgeLoginSceneComponent } from './scenes/EdgeLoginScene'
import { EditTokenScene as EditTokenSceneComponent } from './scenes/EditTokenScene'
import { ExtraTabScene as ExtraTabSceneComponent } from './scenes/ExtraTabScene'
import { FioAddressDetailsScene as FioAddressDetailsSceneComponent } from './scenes/Fio/FioAddressDetailsScene'
import { FioAddressListScene as FioAddressListSceneComponent } from './scenes/Fio/FioAddressListScene'
import { FioAddressRegisteredScene as FioAddressRegisteredSceneComponent } from './scenes/Fio/FioAddressRegisteredScene'
import { FioAddressRegisterScene as FioAddressRegisterSceneComponent } from './scenes/Fio/FioAddressRegisterScene'
import { FioAddressRegisterSelectWalletScene as FioAddressRegisterSelectWalletSceneComponent } from './scenes/Fio/FioAddressRegisterSelectWalletScene'
import { FioAddressSettingsScene as FioAddressSettingsSceneComponent } from './scenes/Fio/FioAddressSettingsScene'
import { FioConnectWalletConfirmScene as FioConnectWalletConfirmSceneComponent } from './scenes/Fio/FioConnectWalletConfirmScene'
import { FioDomainRegisterScene as FioDomainRegisterSceneComponent } from './scenes/Fio/FioDomainRegisterScene'
import { FioDomainRegisterSelectWalletScene as FioDomainRegisterSelectWalletSceneComponent } from './scenes/Fio/FioDomainRegisterSelectWalletScene'
import { FioDomainSettingsScene as FioDomainSettingsSceneComponent } from './scenes/Fio/FioDomainSettingsScene'
import { FioNameConfirmScene as FioNameConfirmSceneComponent } from './scenes/Fio/FioNameConfirmScene'
import { FioRequestConfirmationScene as FioRequestConfirmationSceneComponent } from './scenes/Fio/FioRequestConfirmationScene'
import { FioRequestListScene as FioRequestListSceneComponent } from './scenes/Fio/FioRequestListScene'
import { FioSentRequestDetailsScene as FioSentRequestDetailsSceneComponent } from './scenes/Fio/FioSentRequestDetailsScene'
import { FioStakingChangeScene as FioStakingChangeSceneComponent } from './scenes/Fio/FioStakingChangeScene'
import { FioStakingOverviewScene as FioStakingOverviewSceneComponent } from './scenes/Fio/FioStakingOverviewScene'
import { GettingStartedScene } from './scenes/GettingStartedScene'
import { GiftCardAccountInfoScene as GiftCardAccountInfoSceneComponent } from './scenes/GiftCardAccountInfoScene'
import { GiftCardListScene as GiftCardListSceneComponent } from './scenes/GiftCardListScene'
import { GiftCardMarketScene as GiftCardMarketSceneComponent } from './scenes/GiftCardMarketScene'
import { GiftCardPurchaseScene as GiftCardPurchaseSceneComponent } from './scenes/GiftCardPurchaseScene'
import {
BuyScene as BuySceneComponent,
SellScene as SellSceneComponent
} from './scenes/GuiPluginListScene'
import { GuiPluginViewScene as GuiPluginViewSceneComponent } from './scenes/GuiPluginViewScene'
import { HomeScene as HomeSceneComponent } from './scenes/HomeScene'
import { LoanCloseScene as LoanCloseSceneComponent } from './scenes/Loans/LoanCloseScene'
import { LoanCreateConfirmationScene as LoanCreateConfirmationSceneComponent } from './scenes/Loans/LoanCreateConfirmationScene'
import { LoanCreateScene as LoanCreateSceneComponent } from './scenes/Loans/LoanCreateScene'
import { LoanDashboardScene as LoanDashboardSceneComponent } from './scenes/Loans/LoanDashboardScene'
import { LoanDetailsScene as LoanDetailsSceneComponent } from './scenes/Loans/LoanDetailsScene'
import { LoanManageScene as LoanManageSceneComponent } from './scenes/Loans/LoanManageScene'
import { LoanStatusScene as LoanStatusSceneComponent } from './scenes/Loans/LoanStatusScene'
import { LoginScene } from './scenes/LoginScene'
import { ManageTokensScene as ManageTokensSceneComponent } from './scenes/ManageTokensScene'
import { MigrateWalletCalculateFeeScene as MigrateWalletCalculateFeeSceneComponent } from './scenes/MigrateWalletCalculateFeeScene'
import { MigrateWalletCompletionScene as MigrateWalletCompletionSceneComponent } from './scenes/MigrateWalletCompletionScene'
import { MigrateWalletSelectCryptoScene as MigrateWalletSelectCryptoSceneComponent } from './scenes/MigrateWalletSelectCryptoScene'
import { NotificationCenterScene as NotificationCenterSceneComponent } from './scenes/NotificationCenterScene'
import { NotificationScene as NotificationSceneComponent } from './scenes/NotificationScene'
import { OtpRepairScene as OtpRepairSceneComponent } from './scenes/OtpRepairScene'
import { OtpSettingsScene as OtpSettingsSceneComponent } from './scenes/OtpSettingsScene'
import { ChangeRecoveryScene as ChangeRecoverySceneComponent } from './scenes/PasswordRecoveryScene'
import { PrivacySettingsScene as PrivacySettingsSceneComponent } from './scenes/PrivacySettingsScene'
import { PromotionSettingsScene as PromotionSettingsSceneComponent } from './scenes/PromotionSettingsScene'
import { RampBankFormScene as RampBankFormSceneComponent } from './scenes/RampBankFormScene'
import { RampBankRoutingDetailsScene as RampBankRoutingDetailsSceneComponent } from './scenes/RampBankRoutingDetailsScene'
import { RampConfirmationScene as RampConfirmationSceneComponent } from './scenes/RampConfirmationScene'
import {
RampCreateBuyScene as RampCreateBuySceneComponent,
RampCreateSellScene as RampCreateSellSceneComponent
} from './scenes/RampCreateScene'
import { RampKycFormScene } from './scenes/RampKycFormScene'
import { RampPendingScene as RampPendingSceneComponent } from './scenes/RampPendingScene'
import { RampSelectOptionScene as RampSelectOptionSceneComponent } from './scenes/RampSelectOptionScene'
import { RequestScene as RequestSceneComponent } from './scenes/RequestScene'
import { ReviewTriggerTestScene } from './scenes/ReviewTriggerTestScene'
import { SecurityAlertsScene as SecurityAlertsSceneComponent } from './scenes/SecurityAlertsScene'
import { SendScene2 as SendScene2Component } from './scenes/SendScene2'
import { SettingsScene as SettingsSceneComponent } from './scenes/SettingsScene'
import { SpendingLimitsScene as SpendingLimitsSceneComponent } from './scenes/SpendingLimitsScene'
import { EarnScene as EarnSceneComponent } from './scenes/Staking/EarnScene'
import { StakeModifyScene as StakeModifySceneComponent } from './scenes/Staking/StakeModifyScene'
import { StakeOptionsScene as StakeOptionsSceneComponent } from './scenes/Staking/StakeOptionsScene'
import { StakeOverviewScene as StakeOverviewSceneComponent } from './scenes/Staking/StakeOverviewScene'
import { SwapConfirmationScene as SwapConfirmationSceneComponent } from './scenes/SwapConfirmationScene'
import { SwapProcessingScene as SwapProcessingSceneComponent } from './scenes/SwapProcessingScene'
import { SwapSettingsScene as SwapSettingsSceneComponent } from './scenes/SwapSettingsScene'
import { SwapSuccessScene as SwapSuccessSceneComponent } from './scenes/SwapSuccessScene'
import { SweepPrivateKeyCalculateFeeScene as SweepPrivateKeyCalculateFeeSceneComponent } from './scenes/SweepPrivateKeyCalculateFeeScene'
import { SweepPrivateKeyCompletionScene as SweepPrivateKeyCompletionSceneComponent } from './scenes/SweepPrivateKeyCompletionScene'
import { SweepPrivateKeyProcessingScene as SweepPrivateKeyProcessingSceneComponent } from './scenes/SweepPrivateKeyProcessingScene'
import { SweepPrivateKeySelectCryptoScene as SweepPrivateKeySelectCryptoSceneComponent } from './scenes/SweepPrivateKeySelectCryptoScene'
import { TransactionDetailsScene as TransactionDetailsSceneComponent } from './scenes/TransactionDetailsScene'
import {
TransactionList as TransactionListComponent,
TransactionListTitle
} from './scenes/TransactionListScene'
import { TransactionsExportScene as TransactionsExportSceneComponent } from './scenes/TransactionsExportScene'
import { UpgradeUsernameScene as UpgradeUsernameSceneComponent } from './scenes/UpgradeUsernameScreen'
import {
WalletDetails as WalletDetailsComponent,
WalletDetailsTitle
} from './scenes/WalletDetailsScene'
import { WalletListScene as WalletListSceneComponent } from './scenes/WalletListScene'
import { WalletRestoreScene as WalletRestoreSceneComponent } from './scenes/WalletRestoreScene'
import { WcConnectionsScene as WcConnectionsSceneComponent } from './scenes/WcConnectionsScene'
import { WcConnectScene as WcConnectSceneComponent } from './scenes/WcConnectScene'
import { WcDisconnectScene as WcDisconnectSceneComponent } from './scenes/WcDisconnectScene'
import { WebViewScene as WebViewSceneComponent } from './scenes/WebViewScene'
import { ZcashMigrationInfoScene as ZcashMigrationInfoSceneComponent } from './scenes/ZcashMigrationInfoScene'
import { ZcashMigrationOptionsScene as ZcashMigrationOptionsSceneComponent } from './scenes/ZcashMigrationOptionsScene'
import { ZcashMigrationPlanConfirmScene as ZcashMigrationPlanConfirmSceneComponent } from './scenes/ZcashMigrationPlanConfirmScene'
import { ZcashMigrationStatusScene as ZcashMigrationStatusSceneComponent } from './scenes/ZcashMigrationStatusScene'
import { DeepLinkingManager } from './services/DeepLinkingManager'
import { useTheme } from './services/ThemeContext'
import { MenuTabs } from './themed/MenuTabs'
import { SideMenu } from './themed/SideMenu'
const AssetSettingsScene = ifLoggedIn(AssetSettingsSceneComponent)
const PrivacySettingsScene = ifLoggedIn(PrivacySettingsSceneComponent)
const BuyScene = ifLoggedIn(BuySceneComponent)
const ChangeMiningFeeScene = ifLoggedIn(ChangeMiningFeeSceneComponent)
const ChangePasswordScene = ifLoggedIn(ChangePasswordSceneComponent)
const ChangePinScene = ifLoggedIn(ChangePinSceneComponent)
const ChangeUsernameScene = ifLoggedIn(ChangeUsernameSceneComponent)
const DuressPinScene = ifLoggedIn(DuressPinSceneComponent)
const ChangeRecoveryScene = ifLoggedIn(ChangeRecoverySceneComponent)
const CoinRankingDetailsScene = ifLoggedIn(CoinRankingDetailsSceneComponent)
const CoinRankingScene = ifLoggedIn(CoinRankingSceneComponent)
const ConfirmScene = ifLoggedIn(ConfirmSceneComponent)
const CreateWalletAccountSelectScene = ifLoggedIn(
CreateWalletAccountSelectSceneComponent
)
const CreateWalletAccountSetupScene = ifLoggedIn(
CreateWalletAccountSetupSceneComponent
)
const CreateWalletCompletionScene = ifLoggedIn(
CreateWalletCompletionSceneComponent
)
const CreateWalletImportScene = ifLoggedIn(CreateWalletImportSceneComponent)
const CreateWalletSelectCryptoScene = ifLoggedIn(
CreateWalletSelectCryptoSceneComponent
)
const CreateWalletSelectFiatScene = ifLoggedIn(
CreateWalletSelectFiatSceneComponent
)
const CurrencyNotificationScene = ifLoggedIn(CurrencyNotificationSceneComponent)
const CurrencySettingsScene = ifLoggedIn(CurrencySettingsSceneComponent)
const DebugScene = ifLoggedIn(DebugSceneComponent)
const DefaultFiatSettingScene = ifLoggedIn(DefaultFiatSettingSceneComponent)
const EarnScene = ifLoggedIn(EarnSceneComponent)
const EdgeLoginScene = ifLoggedIn(EdgeLoginSceneComponent)
const EditTokenScene = ifLoggedIn(EditTokenSceneComponent)
const ExtraTabScene = ifLoggedIn(ExtraTabSceneComponent)
const FiatPluginEnterAmountScene = ifLoggedIn(
FiatPluginEnterAmountSceneComponent
)
const FioAddressDetailsScene = ifLoggedIn(FioAddressDetailsSceneComponent)
const FioAddressListScene = ifLoggedIn(FioAddressListSceneComponent)
const FioAddressRegisteredScene = ifLoggedIn(FioAddressRegisteredSceneComponent)
const FioAddressRegisterScene = ifLoggedIn(FioAddressRegisterSceneComponent)
const FioAddressRegisterSelectWalletScene = ifLoggedIn(
FioAddressRegisterSelectWalletSceneComponent
)
const FioAddressSettingsScene = ifLoggedIn(FioAddressSettingsSceneComponent)
const FioConnectWalletConfirmScene = ifLoggedIn(
FioConnectWalletConfirmSceneComponent
)
const FioDomainRegisterScene = ifLoggedIn(FioDomainRegisterSceneComponent)
const FioDomainRegisterSelectWalletScene = ifLoggedIn(
FioDomainRegisterSelectWalletSceneComponent
)
const FioDomainSettingsScene = ifLoggedIn(FioDomainSettingsSceneComponent)
const FioNameConfirmScene = ifLoggedIn(FioNameConfirmSceneComponent)
const FioRequestConfirmationScene = ifLoggedIn(
FioRequestConfirmationSceneComponent
)
const FioRequestListScene = ifLoggedIn(FioRequestListSceneComponent)
const FioSentRequestDetailsScene = ifLoggedIn(
FioSentRequestDetailsSceneComponent
)
const FioStakingChangeScene = ifLoggedIn(FioStakingChangeSceneComponent)
const FioStakingOverviewScene = ifLoggedIn(FioStakingOverviewSceneComponent)
const GuiPluginViewScene = ifLoggedIn(GuiPluginViewSceneComponent)
const HomeScene = ifLoggedIn(HomeSceneComponent)
const GiftCardAccountInfoScene = ifLoggedIn(GiftCardAccountInfoSceneComponent)
const GiftCardListScene = ifLoggedIn(GiftCardListSceneComponent)
const GiftCardMarketScene = ifLoggedIn(GiftCardMarketSceneComponent)
const GiftCardPurchaseScene = ifLoggedIn(GiftCardPurchaseSceneComponent)
const LoanCloseScene = ifLoggedIn(LoanCloseSceneComponent)
const LoanCreateConfirmationScene = ifLoggedIn(
LoanCreateConfirmationSceneComponent
)
const LoanCreateScene = ifLoggedIn(LoanCreateSceneComponent)
const LoanDashboardScene = ifLoggedIn(LoanDashboardSceneComponent)
const LoanDetailsScene = ifLoggedIn(LoanDetailsSceneComponent)
const LoanManageScene = ifLoggedIn(LoanManageSceneComponent)
const LoanStatusScene = ifLoggedIn(LoanStatusSceneComponent)
const ManageTokensScene = ifLoggedIn(ManageTokensSceneComponent)
const MigrateWalletCalculateFeeScene = ifLoggedIn(
MigrateWalletCalculateFeeSceneComponent
)
const MigrateWalletCompletionScene = ifLoggedIn(
MigrateWalletCompletionSceneComponent
)
const MigrateWalletSelectCryptoScene = ifLoggedIn(
MigrateWalletSelectCryptoSceneComponent
)
const ZcashMigrationInfoScene = ifLoggedIn(ZcashMigrationInfoSceneComponent)
const ZcashMigrationOptionsScene = ifLoggedIn(
ZcashMigrationOptionsSceneComponent
)
const ZcashMigrationPlanConfirmScene = ifLoggedIn(
ZcashMigrationPlanConfirmSceneComponent
)
const ZcashMigrationStatusScene = ifLoggedIn(ZcashMigrationStatusSceneComponent)
const NotificationCenterScene = ifLoggedIn(NotificationCenterSceneComponent)
const NotificationScene = ifLoggedIn(NotificationSceneComponent)
const OtpRepairScene = ifLoggedIn(OtpRepairSceneComponent)
const OtpSettingsScene = ifLoggedIn(OtpSettingsSceneComponent)
const PromotionSettingsScene = ifLoggedIn(PromotionSettingsSceneComponent)
const RampBankFormScene = ifLoggedIn(RampBankFormSceneComponent)
const RampBankRoutingDetailsScene = ifLoggedIn(
RampBankRoutingDetailsSceneComponent
)
const RampConfirmationScene = ifLoggedIn(RampConfirmationSceneComponent)
const RampPendingScene = ifLoggedIn(RampPendingSceneComponent)
const RequestScene = ifLoggedIn(RequestSceneComponent)
const RewardsCardDashboardScene = ifLoggedIn(RewardsCardListSceneComponent)
const RewardsCardWelcomeScene = ifLoggedIn(RewardsCardWelcomeSceneComponent)
const SecurityAlertsScene = ifLoggedIn(SecurityAlertsSceneComponent)
const SellScene = ifLoggedIn(SellSceneComponent)
const SendScene2 = ifLoggedIn(SendScene2Component)
const SettingsScene = ifLoggedIn(SettingsSceneComponent)
const SpendingLimitsScene = ifLoggedIn(SpendingLimitsSceneComponent)
const StakeModifyScene = ifLoggedIn(StakeModifySceneComponent)
const StakeOptionsScene = ifLoggedIn(StakeOptionsSceneComponent)
const StakeOverviewScene = ifLoggedIn(StakeOverviewSceneComponent)
const SwapConfirmationScene = ifLoggedIn(SwapConfirmationSceneComponent)
const SwapCreateScene = ifLoggedIn(SwapCreateSceneComponent)
const SwapProcessingScene = ifLoggedIn(SwapProcessingSceneComponent)
const SwapSettingsScene = ifLoggedIn(SwapSettingsSceneComponent)
const SwapSuccessScene = ifLoggedIn(SwapSuccessSceneComponent)
const SweepPrivateKeyCalculateFeeScene = ifLoggedIn(
SweepPrivateKeyCalculateFeeSceneComponent
)
const SweepPrivateKeyCompletionScene = ifLoggedIn(
SweepPrivateKeyCompletionSceneComponent
)
const SweepPrivateKeyProcessingScene = ifLoggedIn(
SweepPrivateKeyProcessingSceneComponent
)
const SweepPrivateKeySelectCryptoScene = ifLoggedIn(
SweepPrivateKeySelectCryptoSceneComponent
)
const TransactionDetailsScene = ifLoggedIn(TransactionDetailsSceneComponent)
const TransactionList = ifLoggedIn(TransactionListComponent)
const TransactionsExportScene = ifLoggedIn(TransactionsExportSceneComponent)
const RampCreateBuyScene = ifLoggedIn(RampCreateBuySceneComponent)
const RampCreateSellScene = ifLoggedIn(RampCreateSellSceneComponent)
const RampSelectOptionScene = ifLoggedIn(RampSelectOptionSceneComponent)
const UpgradeUsernameScene = ifLoggedIn(UpgradeUsernameSceneComponent)
const WalletDetails = ifLoggedIn(WalletDetailsComponent)
const WalletListScene = ifLoggedIn(WalletListSceneComponent)
const WalletRestoreScene = ifLoggedIn(WalletRestoreSceneComponent)
const WcConnectionsScene = ifLoggedIn(WcConnectionsSceneComponent)
const WcConnectScene = ifLoggedIn(WcConnectSceneComponent)
const WcDisconnectScene = ifLoggedIn(WcDisconnectSceneComponent)
const WebViewScene = ifLoggedIn(WebViewSceneComponent)
const DuressModeHowToScene = ifLoggedIn(DuressModeHowToSceneComponent)
const DuressModeSettingScene = ifLoggedIn(DuressModeSettingSceneComponent)
const RootStack = createStackNavigator<RootParamList>()
const Drawer = createDrawerNavigator<DrawerParamList>()
const AppStack = createStackNavigator<EdgeAppStackParamList>()
const Tabs = createBottomTabNavigator<EdgeTabsParamList>()
const SwapStack = createStackNavigator<SwapTabParamList>()
const BuyStack = createStackNavigator<BuySellTabParamList>()
const SellStack = createStackNavigator<BuySellTabParamList>()
const WalletsStack = createStackNavigator<WalletsTabParamList>()
const headerMode =
isMaestro() && Platform.OS === 'android' ? 'float' : undefined
const defaultScreenOptions: StackNavigationOptions &
BottomTabNavigationOptions = {
title: '',
headerTitle: EdgeHeader,
headerLeft: () => <BackButton />,
headerRight: () => <SideMenuButton />,
headerShown: true,
headerMode,
headerTitleAlign: 'center',
headerBackground: HeaderBackground,
headerTransparent: true
}
const firstSceneScreenOptions: StackNavigationOptions &
BottomTabNavigationOptions = {
headerLeft: () => <HeaderTextButton type="help" />,
headerTitle: EdgeHeader,
headerTitleAlign: 'center'
}
// -------------------------------------------------------------------------
// Tab router
// -------------------------------------------------------------------------
const EdgeWalletsTabScreen: React.FC = () => {
return (
<WalletsStack.Navigator
initialRouteName="walletList"
screenOptions={defaultScreenOptions}
>
<WalletsStack.Screen
name="transactionDetails"
component={TransactionDetailsScene}
options={{
headerTitle: () => <TransactionDetailsTitle />
}}
/>
<WalletsStack.Screen
name="walletList"
component={WalletListScene}
options={firstSceneScreenOptions}
/>
<WalletsStack.Screen
name="transactionList"
component={TransactionList}
options={{
headerTitle: () => <TransactionListTitle />
}}
/>
<WalletsStack.Screen
name="walletDetails"
component={WalletDetails}
options={{
headerTitle: () => <WalletDetailsTitle />
}}
/>
</WalletsStack.Navigator>
)
}
const EdgeBuyTabScreen: React.FC = () => {
return (
<BuyStack.Navigator
initialRouteName="pluginListBuy"
screenOptions={defaultScreenOptions}
>
<BuyStack.Screen
name="pluginListBuy"
component={RampCreateBuyScene}
options={firstSceneScreenOptions}
/>
<BuyStack.Screen
name="rampSelectOption"
component={RampSelectOptionScene}
/>
<BuyStack.Screen
name="pluginListBuyOld"
component={BuyScene}
options={firstSceneScreenOptions}
/>
<BuyStack.Screen
name="pluginViewBuy"
component={GuiPluginViewScene}
options={{
headerTitle: () => (
<ParamHeaderTitle<'pluginViewBuy'>
fromParams={params => params.plugin.displayName}
/>
),
headerRight: () => <HeaderTextButton type="exit" />,
headerLeft: () => <PluginBackButton />
}}
/>
<BuyStack.Screen
name="guiPluginAddressForm"
component={AddressFormScene}
options={{
headerRight: () => null
}}
/>
<BuyStack.Screen
name="guiPluginConfirmation"
component={ConfirmationScene}
options={{
headerLeft: () => null,
headerRight: () => null
}}
/>
<BuyStack.Screen
name="guiPluginContactForm"
component={ContactFormScene}
options={{
headerRight: () => null
}}
/>
<BuyStack.Screen
name="kycForm"
component={RampKycFormScene}
options={{
headerRight: () => null
}}
/>
<BuyStack.Screen
name="guiPluginEnterAmount"
component={FiatPluginEnterAmountScene}
options={{
headerRight: () => null
}}
/>
<BuyStack.Screen
name="guiPluginInfoDisplay"
component={InfoDisplayScene}
options={{
headerRight: () => null
}}
/>
<BuyStack.Screen
name="guiPluginSepaForm"
component={SepaFormScene}
options={{
headerRight: () => null
}}
/>
<BuyStack.Screen
name="guiPluginWebView"
component={FiatPluginWebViewComponent}
/>
<BuyStack.Screen
name="rewardsCardDashboard"
component={RewardsCardDashboardScene}
/>
<BuyStack.Screen
name="rewardsCardWelcome"
component={RewardsCardWelcomeScene}
/>
<BuyStack.Screen name="rampBankForm" component={RampBankFormScene} />
<BuyStack.Screen
name="rampBankRoutingDetails"
component={RampBankRoutingDetailsScene}
/>
<BuyStack.Screen
name="rampConfirmation"
component={RampConfirmationScene}
/>
<BuyStack.Screen name="rampPending" component={RampPendingScene} />
</BuyStack.Navigator>
)
}
const EdgeSellTabScreen: React.FC = () => {
return (
<SellStack.Navigator
initialRouteName="pluginListSell"
screenOptions={defaultScreenOptions}
>
<SellStack.Screen
name="pluginListSell"
component={RampCreateSellScene}
options={firstSceneScreenOptions}
/>
<BuyStack.Screen
name="rampSelectOption"
component={RampSelectOptionScene}
/>
<SellStack.Screen
name="pluginListSellOld"
component={SellScene}
options={firstSceneScreenOptions}
/>
<SellStack.Screen
name="pluginViewSell"
component={GuiPluginViewScene}
options={{
headerLeft: () => <PluginBackButton />
}}
/>
<SellStack.Screen
name="guiPluginAddressForm"
component={AddressFormScene}
options={{
headerRight: () => null
}}
/>
<SellStack.Screen
name="guiPluginConfirmation"
component={ConfirmationScene}
options={{
headerLeft: () => null,
headerRight: () => null
}}
/>
<SellStack.Screen
name="guiPluginContactForm"
component={ContactFormScene}
options={{
headerRight: () => null
}}
/>
<SellStack.Screen
name="kycForm"
component={RampKycFormScene}
options={{
headerRight: () => null
}}
/>
<SellStack.Screen
name="guiPluginEnterAmount"
component={FiatPluginEnterAmountScene}
options={{
headerRight: () => null
}}
/>
<SellStack.Screen
name="guiPluginInfoDisplay"
component={InfoDisplayScene}
options={{
headerRight: () => null
}}
/>
<SellStack.Screen
name="guiPluginSepaForm"
component={SepaFormScene}
options={{
headerRight: () => null
}}
/>
<SellStack.Screen
name="guiPluginWebView"
component={FiatPluginWebViewComponent}
/>
<SellStack.Screen
name="rewardsCardDashboard"
component={RewardsCardDashboardScene}
/>
<SellStack.Screen
name="rewardsCardWelcome"
component={RewardsCardWelcomeScene}
/>
<SellStack.Screen name="rampBankForm" component={RampBankFormScene} />
<SellStack.Screen
name="rampBankRoutingDetails"
component={RampBankRoutingDetailsScene}
/>
<SellStack.Screen
name="rampConfirmation"
component={RampConfirmationScene}
/>
<SellStack.Screen name="rampPending" component={RampPendingScene} />
</SellStack.Navigator>
)
}
const EdgeSwapTabScreen: React.FC = () => {
return (
<SwapStack.Navigator
initialRouteName="swapCreate"
screenOptions={defaultScreenOptions}
>
<SwapStack.Screen
name="swapCreate"
component={SwapCreateScene}
options={{
...firstSceneScreenOptions,
title: lstrings.title_exchange
}}
/>
<SwapStack.Screen
name="swapConfirmation"
component={SwapConfirmationScene}
/>
<SwapStack.Screen
name="swapProcessing"
component={SwapProcessingScene}
options={{
headerLeft: () => null,
headerRight: () => null
}}
/>
</SwapStack.Navigator>
)
}
const EdgeTabs: React.FC = () => {
const { defaultScreen } = getDeviceSettings()
const initialRouteName = defaultScreen === 'assets' ? 'walletsTab' : 'home'
return (
<Tabs.Navigator
initialRouteName={initialRouteName}
tabBar={props => <MenuTabs {...props} />}
screenOptions={{
headerShown: false
}}
>
<Tabs.Screen
name="home"
component={HomeScene}
options={{ ...defaultScreenOptions, ...firstSceneScreenOptions }}
/>
<Tabs.Screen name="walletsTab" component={EdgeWalletsTabScreen} />
<Tabs.Screen name="buyTab" component={EdgeBuyTabScreen} />
<Tabs.Screen name="sellTab" component={EdgeSellTabScreen} />
<Tabs.Screen name="swapTab" component={EdgeSwapTabScreen} />
<Tabs.Screen name="extraTab" component={ExtraTabScene} />
<Tabs.Screen name="devTab" component={DevTestScene} />
</Tabs.Navigator>
)
}
// -------------------------------------------------------------------------
// Main `edgeAppStack`
// The tabs live inside this stack, as well as most app scenes.
// -------------------------------------------------------------------------
const EdgeAppStack: React.FC = () => {
const countryCode = useSelector(state => state.ui.countryCode)
return (
<AppStack.Navigator
initialRouteName="edgeTabs"
screenOptions={defaultScreenOptions}
>
<AppStack.Screen
name="edgeTabs"
component={EdgeTabs}
options={{
headerShown: false
}}
/>
<AppStack.Screen
name="changeMiningFee2"
component={ChangeMiningFeeScene}
options={{
headerRight: () => <HeaderTextButton type="help" />
}}
/>
<AppStack.Screen
name="changePassword"
component={ChangePasswordScene}
options={{
title: lstrings.title_change_password,
headerRight: () => null
}}
/>
<AppStack.Screen
name="changePin"
component={ChangePinScene}
options={{
title: lstrings.title_change_pin,
headerRight: () => null
}}
/>
<AppStack.Screen
name="changeUsername"
component={ChangeUsernameScene}
options={{
title: lstrings.title_change_username,
headerRight: () => null
}}
/>
<AppStack.Screen
name="duressPin"
component={DuressPinScene}
options={{
title: lstrings.title_duress_mode,
headerRight: () => null
}}
/>
<AppStack.Screen name="coinRanking" component={CoinRankingScene} />
<AppStack.Screen
name="coinRankingDetails"
component={CoinRankingDetailsScene}
/>
<AppStack.Screen name="confirmScene" component={ConfirmScene} />
<AppStack.Screen
name="createWalletAccountSelect"
component={CreateWalletAccountSelectScene}
options={{
title: lstrings.create_wallet_account_activate,
headerRight: () => <HeaderTextButton type="help" />
}}
/>
<AppStack.Screen
name="createWalletAccountSetup"
component={CreateWalletAccountSetupScene}
options={{
title: lstrings.create_wallet_create_account,
headerRight: () => <HeaderTextButton type="help" />
}}
/>
<AppStack.Screen
name="createWalletCompletion"
component={CreateWalletCompletionScene}
options={{
headerLeft: () => null,
headerRight: () => null
}}
/>
<AppStack.Screen
name="createWalletImport"
component={CreateWalletImportScene}
options={{
headerRight: () => null
}}
/>
<AppStack.Screen
name="createWalletSelectCrypto"
component={CreateWalletSelectCryptoScene}
/>
<AppStack.Screen
name="createWalletSelectCryptoNewAccount"
component={CreateWalletSelectCryptoScene}
options={{
headerRight: () => null,
headerLeft: () => null
}}
/>
<AppStack.Screen
name="createWalletEditName"
component={CreateWalletSelectFiatScene}
/>
<AppStack.Screen
name="currencyNotificationSettings"
component={CurrencyNotificationScene}
options={{
headerTitle: props => <CurrencySettingsTitle />,
headerRight: () => null
}}
/>
<AppStack.Screen
name="assetSettings"
component={AssetSettingsScene}
options={{
title: lstrings.settings_asset_settings,
headerRight: () => null
}}
/>
<AppStack.Screen
name="privacySettings"
component={PrivacySettingsScene}
options={{
title: lstrings.settings_privacy_settings,
headerRight: () => null
}}
/>
<AppStack.Screen
name="currencySettings"
component={CurrencySettingsScene}
options={{
headerTitle: props => <CurrencySettingsTitle />,
headerRight: () => null
}}
/>
<AppStack.Screen
name="defaultFiatSetting"
component={DefaultFiatSettingScene}
options={{
headerRight: () => null
}}
/>
<AppStack.Screen name="edgeLogin" component={EdgeLoginScene} />
<AppStack.Screen
name="editToken"
component={EditTokenScene}
options={{
headerRight: () => null
}}
/>
<AppStack.Screen
name="swapSettings"
component={SwapSettingsScene}
options={{
title: lstrings.settings_exchange_settings,
headerRight: () => null
}}
/>
<AppStack.Screen
name="swapSuccess"
component={SwapSuccessScene}
options={{
headerLeft: () => null
}}
/>
<AppStack.Screen
name="extraTab"
component={ExtraTabScene}
options={{
headerLeft: () => <HeaderTextButton type="help" />
}}
/>
<AppStack.Screen
name="earnScene"
component={EarnScene}
options={{
title: getUkCompliantString(countryCode, 'stake_earn_button_label')
}}
/>
<AppStack.Screen
name="fioAddressDetails"
component={FioAddressDetailsScene}
/>
<AppStack.Screen name="fioAddressList" component={FioAddressListScene} />
<AppStack.Screen
name="fioAddressRegister"
component={FioAddressRegisterScene}
/>
<AppStack.Screen
name="fioAddressRegisterSelectWallet"
component={FioAddressRegisterSelectWalletScene}
options={{
headerRight: () => null
}}
/>
<AppStack.Screen
name="fioAddressRegisterSuccess"
component={FioAddressRegisteredScene}
options={{
headerTitle: () => (
<ParamHeaderTitle<'fioAddressRegisterSuccess'>
fromParams={params => params.fioName}
/>
),
headerLeft: () => null
}}
/>
<AppStack.Screen
name="fioAddressSettings"
component={FioAddressSettingsScene}
/>
<AppStack.Screen
name="fioConnectToWalletsConfirm"
component={FioConnectWalletConfirmScene}
/>
<AppStack.Screen
name="fioDomainConfirm"
component={FioNameConfirmScene}
options={{
headerRight: () => null
}}
/>
<AppStack.Screen
name="fioDomainRegister"
component={FioDomainRegisterScene}
/>
<AppStack.Screen
name="fioDomainRegisterSelectWallet"
component={FioDomainRegisterSelectWalletScene}
options={{
title: lstrings.title_register_fio_domain,
headerRight: () => null
}}
/>
<AppStack.Screen
name="fioDomainSettings"
component={FioDomainSettingsScene}
/>
<AppStack.Screen
name="fioNameConfirm"
component={FioNameConfirmScene}
options={{
headerRight: () => null
}}
/>
<AppStack.Screen
name="fioRequestConfirmation"
component={FioRequestConfirmationScene}
/>
<AppStack.Screen name="fioRequestList" component={FioRequestListScene} />
<AppStack.Screen
name="fioSentRequestDetails"
component={FioSentRequestDetailsScene}
options={{
headerRight: () => null
}}
/>
<AppStack.Screen
name="fioStakingChange"
component={FioStakingChangeScene}
/>
<AppStack.Screen
name="fioStakingOverview"
component={FioStakingOverviewScene}
/>
<AppStack.Screen
name="giftCardAccountInfo"
component={GiftCardAccountInfoScene}
options={{
headerTitle: () => (
<HeaderTitle title={lstrings.gift_card_account_info_title} />
)
}}
/>
<AppStack.Screen name="giftCardList" component={GiftCardListScene} />
<AppStack.Screen name="giftCardMarket" component={GiftCardMarketScene} />
<AppStack.Screen
name="giftCardPurchase"
component={GiftCardPurchaseScene}
options={{
headerTitle: () => (
<ParamHeaderTitle<'giftCardPurchase'>
fromParams={params => cleanBrandName(params.brand.brandName)}
/>
)
}}
/>
<AppStack.Screen name="loanClose" component={LoanCloseScene} />
<AppStack.Screen name="loanCreate" component={LoanCreateScene} />
<AppStack.Screen
name="loanCreateConfirmation"
component={LoanCreateConfirmationScene}
/>
<AppStack.Screen name="loanDashboard" component={LoanDashboardScene} />
<AppStack.Screen name="loanDetails" component={LoanDetailsScene} />
<AppStack.Screen name="loanManage" component={LoanManageScene} />
<AppStack.Screen name="loanStatus" component={LoanStatusScene} />
<AppStack.Screen
name="manageTokens"
component={ManageTokensScene}
options={{
headerRight: () => null
}}
/>
<AppStack.Screen
name="sweepPrivateKeyProcessing"
component={SweepPrivateKeyProcessingScene}
/>
<AppStack.Screen
name="sweepPrivateKeySelectCrypto"
component={SweepPrivateKeySelectCryptoScene}
/>
<AppStack.Screen
name="sweepPrivateKeyCalculateFee"