11import React , { useCallback , useEffect , useMemo , useState } from 'react' ;
2- import { InteractionManager , View } from 'react-native' ;
2+ import { Dimensions , InteractionManager , View } from 'react-native' ;
33import { useDebounce } from 'use-debounce' ;
44
55import * as lang from '@/languages' ;
@@ -8,11 +8,11 @@ import CurrencySelectionList from '@/components/CurrencySelectionList';
88import { useDiscoverScreenContext } from '@/components/Discover/DiscoverScreenContext' ;
99import { analytics } from '@/analytics' ;
1010import { PROFILES , useExperimentalFlag } from '@/config' ;
11- import { useAccountSettings , useSearchCurrencyList , usePrevious , useHardwareBackOnFocus } from '@/hooks' ;
11+ import { useAccountSettings , useSearchCurrencyList , usePrevious , useHardwareBackOnFocus , useDimensions } from '@/hooks' ;
1212import { useNavigation } from '@/navigation' ;
1313import Routes from '@/navigation/routesNames' ;
1414import { fetchSuggestions } from '@/handlers/ens' ;
15- import { ethereumUtils , safeAreaInsetValues } from '@/utils' ;
15+ import { ethereumUtils } from '@/utils' ;
1616import { getPoapAndOpenSheetWithQRHash , getPoapAndOpenSheetWithSecretWord } from '@/utils/poaps' ;
1717import { navigateToMintCollection } from '@/resources/reservoir/mints' ;
1818import { TAB_BAR_HEIGHT } from '@/navigation/SwipeNavigator' ;
@@ -24,6 +24,7 @@ import { useBackendNetworksStore } from '@/state/backendNetworks/backendNetworks
2424import { ChainId , Network } from '@/state/backendNetworks/types' ;
2525import { useTimeoutEffect } from '@/hooks/useTimeout' ;
2626import { useDiscoverSearchQueryStore , useDiscoverSearchStore } from '@/__swaps__/screens/Swap/resources/search/searchV2' ;
27+ import { useSafeAreaInsets } from 'react-native-safe-area-context' ;
2728
2829type EnsResult = {
2930 address : string ;
@@ -46,6 +47,7 @@ export default function DiscoverSearch() {
4647 const { navigate } = useNavigation ( ) ;
4748 const { accountAddress } = useAccountSettings ( ) ;
4849 const { colors } = useTheme ( ) ;
50+ const safeAreaInsets = useSafeAreaInsets ( ) ;
4951
5052 const [ isFetchingEns , setIsFetchingEns ] = useState ( false ) ;
5153 const { cancelSearch, searchInputRef, sectionListRef } = useDiscoverScreenContext ( ) ;
@@ -65,9 +67,8 @@ export default function DiscoverSearch() {
6567 const { swapCurrencyList, swapCurrencyListLoading } = useSearchCurrencyList ( ) ;
6668
6769 const profilesEnabled = useExperimentalFlag ( PROFILES ) ;
68- const marginBottom = TAB_BAR_HEIGHT ;
69- // safeAreaInsetValues.bottom + 16;
70- const TOP_OFFSET = safeAreaInsetValues . top + navbarHeight ;
70+ const MARGIN_BOTTOM = TAB_BAR_HEIGHT ;
71+ const TOP_OFFSET = safeAreaInsets . top + navbarHeight ;
7172
7273 const currencyList = useMemo ( ( ) => {
7374 // order:
@@ -258,7 +259,7 @@ export default function DiscoverSearch() {
258259 return (
259260 < View
260261 key = { currencyListDataKey }
261- style = { { height : deviceUtils . dimensions . height - TOP_OFFSET - marginBottom } }
262+ style = { { height : deviceUtils . dimensions . height - TOP_OFFSET - MARGIN_BOTTOM } }
262263 testID = "discover-search-list"
263264 >
264265 < CurrencySelectionList
0 commit comments