@@ -9,6 +9,7 @@ import SearchStatusBar from '@components/Search/SearchStatusBar';
9
9
import useActiveCentralPaneRoute from '@hooks/useActiveCentralPaneRoute' ;
10
10
import useLocalize from '@hooks/useLocalize' ;
11
11
import useResponsiveLayout from '@hooks/useResponsiveLayout' ;
12
+ import useStyleUtils from '@hooks/useStyleUtils' ;
12
13
import useThemeStyles from '@hooks/useThemeStyles' ;
13
14
import useWindowDimensions from '@hooks/useWindowDimensions' ;
14
15
import Navigation from '@libs/Navigation/Navigation' ;
@@ -32,10 +33,11 @@ function SearchPageBottomTab() {
32
33
const { windowHeight} = useWindowDimensions ( ) ;
33
34
const activeCentralPaneRoute = useActiveCentralPaneRoute ( ) ;
34
35
const styles = useThemeStyles ( ) ;
36
+ const StyleUtils = useStyleUtils ( ) ;
35
37
const [ selectionMode ] = useOnyx ( ONYXKEYS . MOBILE_SELECTION_MODE ) ;
36
38
37
39
const scrollOffset = useSharedValue ( 0 ) ;
38
- const topBarOffset = useSharedValue < number > ( variables . searchHeaderHeight ) ;
40
+ const topBarOffset = useSharedValue < number > ( StyleUtils . searchHeaderHeight ) ;
39
41
const topBarAnimatedStyle = useAnimatedStyle ( ( ) => ( {
40
42
top : topBarOffset . get ( ) ,
41
43
} ) ) ;
@@ -50,9 +52,9 @@ function SearchPageBottomTab() {
50
52
const isScrollingDown = currentOffset > scrollOffset . get ( ) ;
51
53
const distanceScrolled = currentOffset - scrollOffset . get ( ) ;
52
54
if ( isScrollingDown && contentOffset . y > TOO_CLOSE_TO_TOP_DISTANCE ) {
53
- topBarOffset . set ( clamp ( topBarOffset . get ( ) - distanceScrolled , variables . minimalTopBarOffset , variables . searchHeaderHeight ) ) ;
55
+ topBarOffset . set ( clamp ( topBarOffset . get ( ) - distanceScrolled , variables . minimalTopBarOffset , StyleUtils . searchHeaderHeight ) ) ;
54
56
} else if ( ! isScrollingDown && distanceScrolled < 0 && contentOffset . y + layoutMeasurement . height < contentSize . height - TOO_CLOSE_TO_BOTTOM_DISTANCE ) {
55
- topBarOffset . set ( withTiming ( variables . searchHeaderHeight , { duration : ANIMATION_DURATION_IN_MS } ) ) ;
57
+ topBarOffset . set ( withTiming ( StyleUtils . searchHeaderHeight , { duration : ANIMATION_DURATION_IN_MS } ) ) ;
56
58
}
57
59
scrollOffset . set ( currentOffset ) ;
58
60
} ,
@@ -63,9 +65,9 @@ function SearchPageBottomTab() {
63
65
if ( windowHeight <= h ) {
64
66
return ;
65
67
}
66
- topBarOffset . set ( withTiming ( variables . searchHeaderHeight , { duration : ANIMATION_DURATION_IN_MS } ) ) ;
68
+ topBarOffset . set ( withTiming ( StyleUtils . searchHeaderHeight , { duration : ANIMATION_DURATION_IN_MS } ) ) ;
67
69
} ,
68
- [ windowHeight , topBarOffset ] ,
70
+ [ windowHeight , topBarOffset , StyleUtils . searchHeaderHeight ] ,
69
71
) ;
70
72
71
73
const searchParams = activeCentralPaneRoute ?. params as AuthScreensParamList [ typeof SCREENS . SEARCH . CENTRAL_PANE ] ;
@@ -102,6 +104,7 @@ function SearchPageBottomTab() {
102
104
testID = { SearchPageBottomTab . displayName }
103
105
style = { styles . pv0 }
104
106
offlineIndicatorStyle = { styles . mtAuto }
107
+ headerGapStyles = { styles . searchHeaderGap }
105
108
>
106
109
{ ! selectionMode ?. isEnabled ? (
107
110
< >
@@ -122,7 +125,7 @@ function SearchPageBottomTab() {
122
125
< SearchStatusBar
123
126
queryJSON = { queryJSON }
124
127
onStatusChange = { ( ) => {
125
- topBarOffset . set ( withTiming ( variables . searchHeaderHeight , { duration : ANIMATION_DURATION_IN_MS } ) ) ;
128
+ topBarOffset . set ( withTiming ( StyleUtils . searchHeaderHeight , { duration : ANIMATION_DURATION_IN_MS } ) ) ;
126
129
} }
127
130
/>
128
131
</ Animated . View >
0 commit comments