1
1
import { useRef } from "react"
2
+ import { useLocale } from "next-intl"
2
3
3
4
import { FilterOption } from "@/lib/types"
4
5
@@ -36,6 +37,7 @@ import { DEFAULT_LOCALE } from "@/lib/constants"
36
37
import { useTranslation } from "@/hooks/useTranslation"
37
38
38
39
export const useWalletFilters = ( ) : FilterOption [ ] => {
40
+ const locale = useLocale ( )
39
41
const { t } = useTranslation ( "page-wallets-find-wallet" )
40
42
const prevNetworkArray = useRef < string [ ] > ( [ ] )
41
43
return [
@@ -95,7 +97,7 @@ export const useWalletFilters = (): FilterOption[] => {
95
97
) => {
96
98
trackCustomEvent ( {
97
99
eventCategory : "WalletFilterSidebar" ,
98
- eventAction : `${ t ( "page-find-wallet-android" ) } ` ,
100
+ eventAction : `${ locale } - ${ t ( "page-find-wallet-android" ) } ` ,
99
101
eventName : `android ${ newInputState } ` ,
100
102
} )
101
103
updateFilterState (
@@ -136,7 +138,7 @@ export const useWalletFilters = (): FilterOption[] => {
136
138
) => {
137
139
trackCustomEvent ( {
138
140
eventCategory : "WalletFilterSidebar" ,
139
- eventAction : `${ t ( "page-find-wallet-iOS" ) } ` ,
141
+ eventAction : `${ locale } - ${ t ( "page-find-wallet-iOS" ) } ` ,
140
142
eventName : `iOS ${ newInputState } ` ,
141
143
} )
142
144
updateFilterState (
@@ -168,7 +170,7 @@ export const useWalletFilters = (): FilterOption[] => {
168
170
updateFilterState = { ( filterIndex , itemIndex , newInputState ) => {
169
171
trackCustomEvent ( {
170
172
eventCategory : "WalletFilterSidebar" ,
171
- eventAction : `${ t ( "page-find-wallet-desktop" ) } ` ,
173
+ eventAction : `${ locale } - ${ t ( "page-find-wallet-desktop" ) } ` ,
172
174
eventName : `desktop ${ newInputState } ` ,
173
175
} )
174
176
updateFilterState ( filterIndex , itemIndex , newInputState )
@@ -204,7 +206,7 @@ export const useWalletFilters = (): FilterOption[] => {
204
206
) => {
205
207
trackCustomEvent ( {
206
208
eventCategory : "WalletFilterSidebar" ,
207
- eventAction : `${ t ( "page-find-wallet-linux" ) } ` ,
209
+ eventAction : `${ locale } - ${ t ( "page-find-wallet-linux" ) } ` ,
208
210
eventName : `linux ${ newInputState } ` ,
209
211
} )
210
212
updateFilterState (
@@ -245,7 +247,7 @@ export const useWalletFilters = (): FilterOption[] => {
245
247
) => {
246
248
trackCustomEvent ( {
247
249
eventCategory : "WalletFilterSidebar" ,
248
- eventAction : `${ t ( "page-find-wallet-windows" ) } ` ,
250
+ eventAction : `${ locale } - ${ t ( "page-find-wallet-windows" ) } ` ,
249
251
eventName : `windows ${ newInputState } ` ,
250
252
} )
251
253
updateFilterState (
@@ -286,7 +288,7 @@ export const useWalletFilters = (): FilterOption[] => {
286
288
) => {
287
289
trackCustomEvent ( {
288
290
eventCategory : "WalletFilterSidebar" ,
289
- eventAction : `${ t ( "page-find-wallet-macOS" ) } ` ,
291
+ eventAction : `${ locale } - ${ t ( "page-find-wallet-macOS" ) } ` ,
290
292
eventName : `macOS ${ newInputState } ` ,
291
293
} )
292
294
updateFilterState (
@@ -318,7 +320,7 @@ export const useWalletFilters = (): FilterOption[] => {
318
320
updateFilterState = { ( filterIndex , itemIndex , newInputState ) => {
319
321
trackCustomEvent ( {
320
322
eventCategory : "WalletFilterSidebar" ,
321
- eventAction : `${ t ( "page-find-wallet-browser" ) } ` ,
323
+ eventAction : `${ locale } - ${ t ( "page-find-wallet-browser" ) } ` ,
322
324
eventName : `browser ${ newInputState } ` ,
323
325
} )
324
326
updateFilterState ( filterIndex , itemIndex , newInputState )
@@ -354,7 +356,7 @@ export const useWalletFilters = (): FilterOption[] => {
354
356
) => {
355
357
trackCustomEvent ( {
356
358
eventCategory : "WalletFilterSidebar" ,
357
- eventAction : `${ t ( "page-find-wallet-chromium" ) } ` ,
359
+ eventAction : `${ locale } - ${ t ( "page-find-wallet-chromium" ) } ` ,
358
360
eventName : `chromium ${ newInputState } ` ,
359
361
} )
360
362
updateFilterState (
@@ -395,7 +397,7 @@ export const useWalletFilters = (): FilterOption[] => {
395
397
) => {
396
398
trackCustomEvent ( {
397
399
eventCategory : "WalletFilterSidebar" ,
398
- eventAction : `${ t ( "page-find-wallet-firefox" ) } ` ,
400
+ eventAction : `${ locale } - ${ t ( "page-find-wallet-firefox" ) } ` ,
399
401
eventName : `firefox ${ newInputState } ` ,
400
402
} )
401
403
updateFilterState (
@@ -427,7 +429,7 @@ export const useWalletFilters = (): FilterOption[] => {
427
429
updateFilterState = { ( filterIndex , itemIndex , newInputState ) => {
428
430
trackCustomEvent ( {
429
431
eventCategory : "WalletFilterSidebar" ,
430
- eventAction : `${ t ( "page-find-wallet-hardware" ) } ` ,
432
+ eventAction : `${ locale } - ${ t ( "page-find-wallet-hardware" ) } ` ,
431
433
eventName : `hardware ${ newInputState } ` ,
432
434
} )
433
435
updateFilterState ( filterIndex , itemIndex , newInputState )
@@ -522,7 +524,7 @@ export const useWalletFilters = (): FilterOption[] => {
522
524
updateFilterState = { ( filterIndex , itemIndex , newInputState ) => {
523
525
trackCustomEvent ( {
524
526
eventCategory : "WalletFilterSidebar" ,
525
- eventAction : `${ t ( "page-find-wallet-buy-crypto" ) } ` ,
527
+ eventAction : `${ locale } - ${ t ( "page-find-wallet-buy-crypto" ) } ` ,
526
528
eventName : `buy_crypto ${ newInputState } ` ,
527
529
} )
528
530
updateFilterState ( filterIndex , itemIndex , newInputState )
@@ -549,7 +551,7 @@ export const useWalletFilters = (): FilterOption[] => {
549
551
updateFilterState = { ( filterIndex , itemIndex , newInputState ) => {
550
552
trackCustomEvent ( {
551
553
eventCategory : "WalletFilterSidebar" ,
552
- eventAction : `${ t ( "page-find-wallet-sell-for-fiat" ) } ` ,
554
+ eventAction : `${ locale } - ${ t ( "page-find-wallet-sell-for-fiat" ) } ` ,
553
555
eventName : `withdraw_crypto ${ newInputState } ` ,
554
556
} )
555
557
updateFilterState ( filterIndex , itemIndex , newInputState )
@@ -582,7 +584,7 @@ export const useWalletFilters = (): FilterOption[] => {
582
584
updateFilterState = { ( filterIndex , itemIndex , newInputState ) => {
583
585
trackCustomEvent ( {
584
586
eventCategory : "WalletFilterSidebar" ,
585
- eventAction : `${ t ( "page-find-wallet-connect-to-dapps" ) } ` ,
587
+ eventAction : `${ locale } - ${ t ( "page-find-wallet-connect-to-dapps" ) } ` ,
586
588
eventName : `connect_to_dapps ${ newInputState } ` ,
587
589
} )
588
590
updateFilterState ( filterIndex , itemIndex , newInputState )
@@ -609,7 +611,7 @@ export const useWalletFilters = (): FilterOption[] => {
609
611
updateFilterState = { ( filterIndex , itemIndex , newInputState ) => {
610
612
trackCustomEvent ( {
611
613
eventCategory : "WalletFilterSidebar" ,
612
- eventAction : `${ t ( "page-find-wallet-nft-support" ) } ` ,
614
+ eventAction : `${ locale } - ${ t ( "page-find-wallet-nft-support" ) } ` ,
613
615
eventName : `nft_support ${ newInputState } ` ,
614
616
} )
615
617
updateFilterState ( filterIndex , itemIndex , newInputState )
@@ -636,7 +638,7 @@ export const useWalletFilters = (): FilterOption[] => {
636
638
updateFilterState = { ( filterIndex , itemIndex , newInputState ) => {
637
639
trackCustomEvent ( {
638
640
eventCategory : "WalletFilterSidebar" ,
639
- eventAction : `${ t ( "page-find-wallet-staking" ) } ` ,
641
+ eventAction : `${ locale } - ${ t ( "page-find-wallet-staking" ) } ` ,
640
642
eventName : `staking ${ newInputState } ` ,
641
643
} )
642
644
updateFilterState ( filterIndex , itemIndex , newInputState )
@@ -663,7 +665,7 @@ export const useWalletFilters = (): FilterOption[] => {
663
665
updateFilterState = { ( filterIndex , itemIndex , newInputState ) => {
664
666
trackCustomEvent ( {
665
667
eventCategory : "WalletFilterSidebar" ,
666
- eventAction : `${ t ( "page-find-wallet-layer-2" ) } ` ,
668
+ eventAction : `${ locale } - ${ t ( "page-find-wallet-layer-2" ) } ` ,
667
669
eventName : `layer_2 ${ newInputState } ` ,
668
670
} )
669
671
updateFilterState ( filterIndex , itemIndex , newInputState )
@@ -690,7 +692,7 @@ export const useWalletFilters = (): FilterOption[] => {
690
692
updateFilterState = { ( filterIndex , itemIndex , newInputState ) => {
691
693
trackCustomEvent ( {
692
694
eventCategory : "WalletFilterSidebar" ,
693
- eventAction : `${ t ( "page-find-wallet-swaps" ) } ` ,
695
+ eventAction : `${ locale } - ${ t ( "page-find-wallet-swaps" ) } ` ,
694
696
eventName : `swaps ${ newInputState } ` ,
695
697
} )
696
698
updateFilterState ( filterIndex , itemIndex , newInputState )
@@ -717,7 +719,7 @@ export const useWalletFilters = (): FilterOption[] => {
717
719
updateFilterState = { ( filterIndex , itemIndex , newInputState ) => {
718
720
trackCustomEvent ( {
719
721
eventCategory : "WalletFilterSidebar" ,
720
- eventAction : `${ t ( "page-find-wallet-hardware-wallet-support" ) } ` ,
722
+ eventAction : `${ locale } - ${ t ( "page-find-wallet-hardware-wallet-support" ) } ` ,
721
723
eventName : `hardware_support ${ newInputState } ` ,
722
724
} )
723
725
updateFilterState ( filterIndex , itemIndex , newInputState )
@@ -744,7 +746,7 @@ export const useWalletFilters = (): FilterOption[] => {
744
746
updateFilterState = { ( filterIndex , itemIndex , newInputState ) => {
745
747
trackCustomEvent ( {
746
748
eventCategory : "WalletFilterSidebar" ,
747
- eventAction : `${ t ( "page-find-wallet-ens-support" ) } ` ,
749
+ eventAction : `${ locale } - ${ t ( "page-find-wallet-ens-support" ) } ` ,
748
750
eventName : `ens_support ${ newInputState } ` ,
749
751
} )
750
752
updateFilterState ( filterIndex , itemIndex , newInputState )
@@ -777,7 +779,7 @@ export const useWalletFilters = (): FilterOption[] => {
777
779
updateFilterState = { ( filterIndex , itemIndex , newInputState ) => {
778
780
trackCustomEvent ( {
779
781
eventCategory : "WalletFilterSidebar" ,
780
- eventAction : `${ t ( "page-find-wallet-open-source" ) } ` ,
782
+ eventAction : `${ locale } - ${ t ( "page-find-wallet-open-source" ) } ` ,
781
783
eventName : `open_source ${ newInputState } ` ,
782
784
} )
783
785
updateFilterState ( filterIndex , itemIndex , newInputState )
@@ -804,7 +806,7 @@ export const useWalletFilters = (): FilterOption[] => {
804
806
updateFilterState = { ( filterIndex , itemIndex , newInputState ) => {
805
807
trackCustomEvent ( {
806
808
eventCategory : "WalletFilterSidebar" ,
807
- eventAction : `${ t ( "page-find-wallet-non-custodial" ) } ` ,
809
+ eventAction : `${ locale } - ${ t ( "page-find-wallet-non-custodial" ) } ` ,
808
810
eventName : `non_custodial ${ newInputState } ` ,
809
811
} )
810
812
updateFilterState ( filterIndex , itemIndex , newInputState )
@@ -837,7 +839,7 @@ export const useWalletFilters = (): FilterOption[] => {
837
839
updateFilterState = { ( filterIndex , itemIndex , newInputState ) => {
838
840
trackCustomEvent ( {
839
841
eventCategory : "WalletFilterSidebar" ,
840
- eventAction : `${ t ( "page-find-wallet-multisig" ) } ` ,
842
+ eventAction : `${ locale } - ${ t ( "page-find-wallet-multisig" ) } ` ,
841
843
eventName : `multisig ${ newInputState } ` ,
842
844
} )
843
845
updateFilterState ( filterIndex , itemIndex , newInputState )
@@ -864,7 +866,7 @@ export const useWalletFilters = (): FilterOption[] => {
864
866
updateFilterState = { ( filterIndex , itemIndex , newInputState ) => {
865
867
trackCustomEvent ( {
866
868
eventCategory : "WalletFilterSidebar" ,
867
- eventAction : `${ t ( "page-find-wallet-social-recovery" ) } ` ,
869
+ eventAction : `${ locale } - ${ t ( "page-find-wallet-social-recovery" ) } ` ,
868
870
eventName : `social_recovery ${ newInputState } ` ,
869
871
} )
870
872
updateFilterState ( filterIndex , itemIndex , newInputState )
@@ -897,7 +899,7 @@ export const useWalletFilters = (): FilterOption[] => {
897
899
updateFilterState = { ( filterIndex , itemIndex , newInputState ) => {
898
900
trackCustomEvent ( {
899
901
eventCategory : "WalletFilterSidebar" ,
900
- eventAction : `${ t ( "page-find-wallet-rpc-importing" ) } ` ,
902
+ eventAction : `${ locale } - ${ t ( "page-find-wallet-rpc-importing" ) } ` ,
901
903
eventName : `rpc_importing ${ newInputState } ` ,
902
904
} )
903
905
updateFilterState ( filterIndex , itemIndex , newInputState )
@@ -924,7 +926,7 @@ export const useWalletFilters = (): FilterOption[] => {
924
926
updateFilterState = { ( filterIndex , itemIndex , newInputState ) => {
925
927
trackCustomEvent ( {
926
928
eventCategory : "WalletFilterSidebar" ,
927
- eventAction : `${ t ( "page-find-wallet-token-importing" ) } ` ,
929
+ eventAction : `${ locale } - ${ t ( "page-find-wallet-token-importing" ) } ` ,
928
930
eventName : `erc_20_support ${ newInputState } ` ,
929
931
} )
930
932
updateFilterState ( filterIndex , itemIndex , newInputState )
0 commit comments