@@ -4,9 +4,6 @@ import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react';
4
4
import { Keyboard } from 'react-native' ;
5
5
import { useOnyx } from 'react-native-onyx' ;
6
6
import Button from '@components/Button' ;
7
- import ImportedStateIndicator from '@components/ImportedStateIndicator' ;
8
- import KeyboardAvoidingView from '@components/KeyboardAvoidingView' ;
9
- import OfflineIndicator from '@components/OfflineIndicator' ;
10
7
import { useOptionsList } from '@components/OptionListContextProvider' ;
11
8
import { PressableWithFeedback } from '@components/Pressable' ;
12
9
import ReferralProgramCTA from '@components/ReferralProgramCTA' ;
@@ -20,9 +17,7 @@ import useDebouncedState from '@hooks/useDebouncedState';
20
17
import useDismissedReferralBanners from '@hooks/useDismissedReferralBanners' ;
21
18
import useLocalize from '@hooks/useLocalize' ;
22
19
import useNetwork from '@hooks/useNetwork' ;
23
- import useResponsiveLayout from '@hooks/useResponsiveLayout' ;
24
20
import useSafeAreaInsets from '@hooks/useSafeAreaInsets' ;
25
- import useSafeAreaPaddings from '@hooks/useSafeAreaPaddings' ;
26
21
import useScreenWrapperTranstionStatus from '@hooks/useScreenWrapperTransitionStatus' ;
27
22
import useThemeStyles from '@hooks/useThemeStyles' ;
28
23
import { navigateToAndOpenReport , searchInServer , setGroupDraft } from '@libs/actions/Report' ;
@@ -144,11 +139,9 @@ function NewChatPage() {
144
139
const { isOffline} = useNetwork ( ) ;
145
140
// We need to use isSmallScreenWidth instead of shouldUseNarrowLayout to show offline indicator on small screen only
146
141
// eslint-disable-next-line rulesdir/prefer-shouldUseNarrowLayout-instead-of-isSmallScreenWidth
147
- const { isSmallScreenWidth} = useResponsiveLayout ( ) ;
148
142
const styles = useThemeStyles ( ) ;
149
143
const personalData = useCurrentUserPersonalDetails ( ) ;
150
144
const { top} = useSafeAreaInsets ( ) ;
151
- const { insets, safeAreaPaddingBottomStyle} = useSafeAreaPaddings ( ) ;
152
145
const [ isSearchingForReports ] = useOnyx ( ONYXKEYS . IS_SEARCHING_FOR_REPORTS , { initWithStoredValues : false } ) ;
153
146
const selectionListRef = useRef < SelectionListHandle > ( null ) ;
154
147
@@ -339,50 +332,35 @@ function NewChatPage() {
339
332
340
333
return (
341
334
< ScreenWrapper
342
- shouldEnableKeyboardAvoidingView = { false }
343
- includeSafeAreaPaddingBottom
344
- shouldShowOfflineIndicator = { false }
335
+ enableEdgeToEdgeBottomSafeAreaPadding
345
336
includePaddingTop = { false }
346
337
shouldEnablePickerAvoiding = { false }
347
- testID = { NewChatPage . displayName }
338
+ keyboardVerticalOffset = { variables . contentHeaderHeight + top + variables . tabSelectorButtonHeight + variables . tabSelectorButtonPadding }
348
339
// Disable the focus trap of this page to activate the parent focus trap in `NewChatSelectorPage`.
349
340
focusTrapSettings = { { active : false } }
341
+ testID = { NewChatPage . displayName }
350
342
>
351
- < KeyboardAvoidingView
352
- style = { styles . flex1 }
353
- behavior = "padding"
354
- // Offset is needed as KeyboardAvoidingView in nested inside of TabNavigator instead of wrapping whole screen.
355
- // This is because when wrapping whole screen the screen was freezing when changing Tabs.
356
- keyboardVerticalOffset = { variables . contentHeaderHeight + top + variables . tabSelectorButtonHeight + variables . tabSelectorButtonPadding }
357
- >
358
- < SelectionList < Option & ListItem >
359
- ref = { selectionListRef }
360
- ListItem = { UserListItem }
361
- sections = { areOptionsInitialized ? sections : CONST . EMPTY_ARRAY }
362
- textInputValue = { searchTerm }
363
- textInputHint = { isOffline ? `${ translate ( 'common.youAppearToBeOffline' ) } ${ translate ( 'search.resultsAreLimited' ) } ` : '' }
364
- onChangeText = { setSearchTerm }
365
- textInputLabel = { translate ( 'selectionList.nameEmailOrPhoneNumber' ) }
366
- headerMessage = { headerMessage }
367
- onSelectRow = { selectOption }
368
- shouldSingleExecuteRowSelect
369
- onConfirm = { ( e , option ) => ( selectedOptions . length > 0 ? createGroup ( ) : selectOption ( option ) ) }
370
- rightHandSideComponent = { itemRightSideComponent }
371
- footerContent = { footerContent }
372
- showLoadingPlaceholder = { ! areOptionsInitialized }
373
- shouldPreventDefaultFocusOnSelectRow = { ! canUseTouchScreen ( ) }
374
- isLoadingNewOptions = { ! ! isSearchingForReports }
375
- initiallyFocusedOptionKey = { firstKeyForList }
376
- shouldTextInputInterceptSwipe
377
- confirmButtonStyles = { insets . bottom ? [ safeAreaPaddingBottomStyle , styles . mb5 ] : undefined }
378
- />
379
- { isSmallScreenWidth && (
380
- < >
381
- < OfflineIndicator />
382
- < ImportedStateIndicator />
383
- </ >
384
- ) }
385
- </ KeyboardAvoidingView >
343
+ < SelectionList < Option & ListItem >
344
+ ref = { selectionListRef }
345
+ ListItem = { UserListItem }
346
+ sections = { areOptionsInitialized ? sections : CONST . EMPTY_ARRAY }
347
+ textInputValue = { searchTerm }
348
+ textInputHint = { isOffline ? `${ translate ( 'common.youAppearToBeOffline' ) } ${ translate ( 'search.resultsAreLimited' ) } ` : '' }
349
+ onChangeText = { setSearchTerm }
350
+ textInputLabel = { translate ( 'selectionList.nameEmailOrPhoneNumber' ) }
351
+ headerMessage = { headerMessage }
352
+ onSelectRow = { selectOption }
353
+ shouldSingleExecuteRowSelect
354
+ onConfirm = { ( e , option ) => ( selectedOptions . length > 0 ? createGroup ( ) : selectOption ( option ) ) }
355
+ rightHandSideComponent = { itemRightSideComponent }
356
+ footerContent = { footerContent }
357
+ showLoadingPlaceholder = { ! areOptionsInitialized }
358
+ shouldPreventDefaultFocusOnSelectRow = { ! canUseTouchScreen ( ) }
359
+ isLoadingNewOptions = { ! ! isSearchingForReports }
360
+ initiallyFocusedOptionKey = { firstKeyForList }
361
+ shouldTextInputInterceptSwipe
362
+ addBottomSafeAreaPadding
363
+ />
386
364
</ ScreenWrapper >
387
365
) ;
388
366
}
0 commit comments