@@ -40,12 +40,12 @@ const ANIMATION_DURATION = 300;
40
40
41
41
type SearchPageHeaderInputProps = {
42
42
queryJSON : SearchQueryJSON ;
43
- searchRouterListVisible ?: boolean ;
43
+ searchAutocompleteListVisible ?: boolean ;
44
44
onSearchRouterFocus ?: ( ) => void ;
45
45
inputRightComponent : React . ReactNode ;
46
46
} ;
47
47
48
- function SearchPageHeaderInput ( { queryJSON, searchRouterListVisible , onSearchRouterFocus, inputRightComponent} : SearchPageHeaderInputProps ) {
48
+ function SearchPageHeaderInput ( { queryJSON, searchAutocompleteListVisible , onSearchRouterFocus, inputRightComponent} : SearchPageHeaderInputProps ) {
49
49
const styles = useThemeStyles ( ) ;
50
50
const { shouldUseNarrowLayout : displayNarrowHeader } = useResponsiveLayout ( ) ;
51
51
const personalDetails = usePersonalDetails ( ) ;
@@ -61,7 +61,7 @@ function SearchPageHeaderInput({queryJSON, searchRouterListVisible, onSearchRout
61
61
62
62
// The actual input text that the user sees
63
63
const [ textInputValue , setTextInputValue ] = useState ( isDefaultQuery ? '' : queryText ) ;
64
- // The input text that was last used for autocomplete; needed for the SearchRouterList when browsing list via arrow keys
64
+ // The input text that was last used for autocomplete; needed for the SearchAutocompleteList when browsing list via arrow keys
65
65
const [ autocompleteQueryValue , setAutocompleteQueryValue ] = useState ( isDefaultQuery ? '' : queryText ) ;
66
66
const [ selection , setSelection ] = useState ( { start : textInputValue . length , end : textInputValue . length } ) ;
67
67
@@ -74,13 +74,13 @@ function SearchPageHeaderInput({queryJSON, searchRouterListVisible, onSearchRout
74
74
75
75
// useEffect for blurring TextInput when we cancel SearchRouter interaction on narrow layout
76
76
useEffect ( ( ) => {
77
- if ( ! displayNarrowHeader || ! ! searchRouterListVisible || ! textInputRef . current || ! textInputRef . current . isFocused ( ) ) {
77
+ if ( ! displayNarrowHeader || ! ! searchAutocompleteListVisible || ! textInputRef . current || ! textInputRef . current . isFocused ( ) ) {
78
78
return ;
79
79
}
80
80
textInputRef . current . blur ( ) ;
81
81
// eslint-disable-next-line react-compiler/react-compiler
82
82
// eslint-disable-next-line react-hooks/exhaustive-deps
83
- } , [ searchRouterListVisible ] ) ;
83
+ } , [ searchAutocompleteListVisible ] ) ;
84
84
85
85
useEffect ( ( ) => {
86
86
if ( displayNarrowHeader || ! isFocused || ! textInputRef . current ) {
@@ -203,8 +203,8 @@ function SearchPageHeaderInput({queryJSON, searchRouterListVisible, onSearchRout
203
203
: undefined ;
204
204
205
205
const animatedPadding = useDerivedValue ( ( ) => {
206
- return withTiming ( searchRouterListVisible ? 0 : 52 , { duration : ANIMATION_DURATION } ) ;
207
- } , [ searchRouterListVisible ] ) ;
206
+ return withTiming ( searchAutocompleteListVisible ? 0 : 52 , { duration : ANIMATION_DURATION } ) ;
207
+ } , [ searchAutocompleteListVisible ] ) ;
208
208
const inputWrapperStyleTest = useAnimatedStyle ( ( ) => {
209
209
return {
210
210
marginRight : animatedPadding . value ,
@@ -232,8 +232,8 @@ function SearchPageHeaderInput({queryJSON, searchRouterListVisible, onSearchRout
232
232
listRef . current ?. updateAndScrollToFocusedIndex ( 0 ) ;
233
233
onSearchRouterFocus ?.( ) ;
234
234
} }
235
- wrapperStyle = { [ styles . searchRouterInputResults , styles . br2 ] }
236
- wrapperFocusedStyle = { styles . searchRouterInputResultsFocused }
235
+ wrapperStyle = { [ styles . searchAutocompleteInputResults , styles . br2 ] }
236
+ wrapperFocusedStyle = { styles . searchAutocompleteInputResultsFocused }
237
237
rightComponent = { inputRightComponent }
238
238
autocompleteListRef = { listRef }
239
239
ref = { textInputRef }
@@ -244,7 +244,7 @@ function SearchPageHeaderInput({queryJSON, searchRouterListVisible, onSearchRout
244
244
< SearchTypeMenuPopover queryJSON = { queryJSON } />
245
245
</ View >
246
246
</ View >
247
- < View style = { [ styles . flex1 , ! searchRouterListVisible && styles . dNone ] } >
247
+ < View style = { [ styles . flex1 , ! searchAutocompleteListVisible && styles . dNone ] } >
248
248
< SearchAutocompleteList
249
249
autocompleteQueryValue = { autocompleteQueryValue }
250
250
searchQueryItem = { searchQueryItem }
@@ -298,8 +298,8 @@ function SearchPageHeaderInput({queryJSON, searchRouterListVisible, onSearchRout
298
298
autoFocus = { false }
299
299
onFocus = { showAutocompleteList }
300
300
onBlur = { hideAutocompleteList }
301
- wrapperStyle = { [ styles . searchRouterInputResults , styles . br2 ] }
302
- wrapperFocusedStyle = { styles . searchRouterInputResultsFocused }
301
+ wrapperStyle = { [ styles . searchAutocompleteInputResults , styles . br2 ] }
302
+ wrapperFocusedStyle = { styles . searchAutocompleteInputResultsFocused }
303
303
outerWrapperStyle = { [ inputWrapperActiveStyle , styles . pb2 ] }
304
304
rightComponent = { inputRightComponent }
305
305
autocompleteListRef = { listRef }
0 commit comments