@@ -7,7 +7,6 @@ import {PickerAvoidingView} from 'react-native-picker-select';
7
7
import type { EdgeInsets } from 'react-native-safe-area-context' ;
8
8
import useEnvironment from '@hooks/useEnvironment' ;
9
9
import useInitialDimensions from '@hooks/useInitialWindowDimensions' ;
10
- import useNetwork from '@hooks/useNetwork' ;
11
10
import useResponsiveLayout from '@hooks/useResponsiveLayout' ;
12
11
import useStyledSafeAreaInsets from '@hooks/useStyledSafeAreaInsets' ;
13
12
import useTackInputFocus from '@hooks/useTackInputFocus' ;
@@ -158,7 +157,6 @@ function ScreenWrapper(
158
157
const { initialHeight} = useInitialDimensions ( ) ;
159
158
const styles = useThemeStyles ( ) ;
160
159
const { isDevelopment} = useEnvironment ( ) ;
161
- const { isOffline} = useNetwork ( ) ;
162
160
const [ didScreenTransitionEnd , setDidScreenTransitionEnd ] = useState ( false ) ;
163
161
const maxHeight = shouldEnableMaxHeight ? windowHeight : undefined ;
164
162
const minHeight = shouldEnableMinHeight && ! Browser . isSafari ( ) ? initialHeight : undefined ;
@@ -244,18 +242,17 @@ function ScreenWrapper(
244
242
}
245
243
246
244
// We always need the safe area padding bottom if we're showing the offline indicator since it is bottom-docked.
247
- const isSafeAreaBottomPaddingApplied = includeSafeAreaPaddingBottom || ( isOffline && shouldShowOfflineIndicator ) ;
248
- if ( isSafeAreaBottomPaddingApplied ) {
245
+ if ( includeSafeAreaPaddingBottom ) {
249
246
paddingStyle . paddingBottom = paddingBottom ;
250
247
}
251
- if ( isSafeAreaBottomPaddingApplied && ignoreInsetsConsumption ) {
248
+ if ( includeSafeAreaPaddingBottom && ignoreInsetsConsumption ) {
252
249
paddingStyle . paddingBottom = unmodifiedPaddings . bottom ;
253
250
}
254
251
255
252
const isAvoidingViewportScroll = useTackInputFocus ( isFocused && shouldEnableMaxHeight && shouldAvoidScrollOnVirtualViewport && Browser . isMobileWebKit ( ) ) ;
256
253
const contextValue = useMemo (
257
- ( ) => ( { didScreenTransitionEnd, isSafeAreaTopPaddingApplied, isSafeAreaBottomPaddingApplied} ) ,
258
- [ didScreenTransitionEnd , isSafeAreaBottomPaddingApplied , isSafeAreaTopPaddingApplied ] ,
254
+ ( ) => ( { didScreenTransitionEnd, isSafeAreaTopPaddingApplied, isSafeAreaBottomPaddingApplied : includeSafeAreaPaddingBottom } ) ,
255
+ [ didScreenTransitionEnd , includeSafeAreaPaddingBottom , isSafeAreaTopPaddingApplied ] ,
259
256
) ;
260
257
261
258
return (
@@ -297,7 +294,14 @@ function ScreenWrapper(
297
294
}
298
295
{ isSmallScreenWidth && shouldShowOfflineIndicator && (
299
296
< >
300
- < OfflineIndicator style = { offlineIndicatorStyle } />
297
+ < OfflineIndicator
298
+ style = { [ offlineIndicatorStyle ] }
299
+ containerStyles = {
300
+ includeSafeAreaPaddingBottom
301
+ ? [ styles . offlineIndicatorMobile ]
302
+ : [ styles . offlineIndicatorMobile , { paddingBottom : paddingBottom + styles . offlineIndicatorMobile . paddingBottom } ]
303
+ }
304
+ />
301
305
{ /* Since import state is tightly coupled to the offline state, it is safe to display it when showing offline indicator */ }
302
306
< ImportedStateIndicator />
303
307
</ >
0 commit comments