@@ -9,10 +9,6 @@ import {
99 TextVariant ,
1010 TextColor ,
1111 FontWeight ,
12- Icon ,
13- IconName ,
14- IconColor ,
15- IconSize ,
1612} from '@metamask/design-system-react-native' ;
1713import { selectNetworkConfigurationsByCaipChainId } from '../../../../../selectors/networkController' ;
1814import {
@@ -36,6 +32,7 @@ import { getNetworkImageSource } from '../../../../../util/networks';
3632import { NETWORK_TO_SHORT_NETWORK_NAME_MAP } from '../../../../../constants/bridge' ;
3733import type { ProcessedNetwork } from '../../../../hooks/useNetworksByNamespace/useNetworksByNamespace' ;
3834import type { CaipChainId } from '@metamask/utils' ;
35+ import { FilterButton } from '../../../Trending/components/FilterBar/FilterBar' ;
3936
4037const TOKEN_CHUNK_SIZE = 12 ;
4138
@@ -45,46 +42,6 @@ interface BridgeTrendingTokensSectionProps {
4542 isNearBottom ?: boolean ;
4643}
4744
48- const FilterButton = ( {
49- testID,
50- onPress,
51- text,
52- twClassName : btnClass ,
53- } : {
54- testID : string ;
55- onPress : ( ) => void ;
56- text : string ;
57- twClassName ?: string ;
58- } ) => {
59- const tw = useTailwind ( ) ;
60- return (
61- < Pressable
62- testID = { testID }
63- onPress = { onPress }
64- style = { ( { pressed } ) =>
65- tw . style (
66- 'flex-row items-center justify-center gap-1 py-2 px-3 rounded-lg bg-background-muted' ,
67- btnClass ,
68- pressed && 'opacity-20' ,
69- )
70- }
71- >
72- < Text
73- variant = { TextVariant . BodySm }
74- fontWeight = { FontWeight . Medium }
75- color = { TextColor . TextDefault }
76- >
77- { text }
78- </ Text >
79- < Icon
80- name = { IconName . ArrowDown }
81- color = { IconColor . IconAlternative }
82- size = { IconSize . Xs }
83- />
84- </ Pressable >
85- ) ;
86- } ;
87-
8845const BridgeTrendingTokensSection = ( {
8946 isNearBottom,
9047} : BridgeTrendingTokensSectionProps ) => {
@@ -201,19 +158,19 @@ const BridgeTrendingTokensSection = ({
201158 < FilterButton
202159 testID = { BridgeViewSelectorsIDs . TRENDING_PRICE_FILTER }
203160 onPress = { ( ) => setActiveBottomSheet ( 'price_change' ) }
204- text = { priceChangeButtonText }
161+ label = { priceChangeButtonText }
205162 twClassName = "flex-1"
206163 />
207164 < FilterButton
208165 testID = { BridgeViewSelectorsIDs . TRENDING_NETWORK_FILTER }
209166 onPress = { ( ) => setActiveBottomSheet ( 'network' ) }
210- text = { selectedNetworkName }
167+ label = { selectedNetworkName }
211168 twClassName = "flex-1"
212169 />
213170 < FilterButton
214171 testID = { BridgeViewSelectorsIDs . TRENDING_TIME_FILTER }
215172 onPress = { ( ) => setActiveBottomSheet ( 'time' ) }
216- text = { selectedTimeOption }
173+ label = { selectedTimeOption }
217174 twClassName = "w-[72px] shrink-0"
218175 />
219176 </ Box >
0 commit comments