Skip to content

Commit

Permalink
fix an issue with min height of screen when Offline Indicator is shown
Browse files Browse the repository at this point in the history
  • Loading branch information
sarious committed Nov 4, 2023
1 parent 846a4b7 commit 6956000
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/components/ScreenWrapper/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function ScreenWrapper({

return (
<View
style={styles.flex1}
style={[styles.flex1, {minHeight}]}
// eslint-disable-next-line react/jsx-props-no-spreading
{...(isDevelopment ? panResponder.panHandlers : {})}
testID={testID}
Expand All @@ -129,7 +129,7 @@ function ScreenWrapper({
{...keyboardDissmissPanResponder.panHandlers}
>
<KeyboardAvoidingView
style={[styles.w100, styles.h100, {maxHeight, minHeight}]}
style={[styles.w100, styles.h100, {maxHeight}]}
behavior={keyboardAvoidingViewBehavior}
enabled={shouldEnableKeyboardAvoidingView}
>
Expand Down
5 changes: 1 addition & 4 deletions src/hooks/useInitialWindowDimensions/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// eslint-disable-next-line no-restricted-imports
import {useEffect, useState} from 'react';
import {Dimensions} from 'react-native';
import {initialWindowMetrics} from 'react-native-safe-area-context';

/**
* A convenience hook that provides initial size (width and height).
Expand Down Expand Up @@ -50,10 +49,8 @@ export default function () {
};
}, []);

const bottomInset = initialWindowMetrics && initialWindowMetrics.insets && initialWindowMetrics.insets.bottom ? initialWindowMetrics.insets.bottom : 0;

return {
initialWidth: dimensions.initialWidth,
initialHeight: dimensions.initialHeight - bottomInset,
initialHeight: dimensions.initialHeight,
};
}
1 change: 1 addition & 0 deletions src/pages/EditRequestAmountPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ function EditRequestAmountPage({defaultAmount, defaultCurrency, onNavigateToCurr
return (
<ScreenWrapper
includeSafeAreaPaddingBottom={false}
shouldEnableKeyboardAvoidingView={false}
shouldEnableMaxHeight
shouldEnableMinHeight={DeviceCapabilities.canUseTouchScreen()}
testID={EditRequestAmountPage.displayName}
Expand Down

0 comments on commit 6956000

Please sign in to comment.