Skip to content

Commit

Permalink
Merge pull request #32887 from Expensify/marcaaron-fixScreenWrapper
Browse files Browse the repository at this point in the history
[CP Staging] Enable KB Avoiding View + remove padding bottom

(cherry picked from commit f28ac76)
  • Loading branch information
marcaaron authored and OSBotify committed Dec 12, 2023
1 parent fdf2288 commit fe1cb18
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/pages/iou/request/step/IOURequestStepAmount.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ function IOURequestStepAmount({
onBackButtonPress={navigateBack}
testID={IOURequestStepAmount.displayName}
shouldShowWrapper={Boolean(backTo)}
includeSafeAreaPaddingBottom
>
<MoneyRequestAmountForm
isEditing={Boolean(backTo)}
Expand Down
1 change: 1 addition & 0 deletions src/pages/iou/request/step/IOURequestStepParticipants.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ function IOURequestStepParticipants({
shouldShowWrapper
testID={IOURequestStepParticipants.displayName}
onEntryTransitionEnd={() => optionsSelectorRef.current && optionsSelectorRef.current.focus()}
includeSafeAreaPaddingBottom
>
<MoneyRequestParticipantsSelector
ref={(el) => (optionsSelectorRef.current = el)}
Expand Down
11 changes: 7 additions & 4 deletions src/pages/iou/request/step/StepScreenWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,17 @@ const propTypes = {

/** An ID used for unit testing */
testID: PropTypes.string.isRequired,

/** Whether or not to include safe area padding */
includeSafeAreaPaddingBottom: PropTypes.bool,
};

const defaultProps = {
onEntryTransitionEnd: () => {},
includeSafeAreaPaddingBottom: false,
};

function StepScreenWrapper({testID, headerTitle, onBackButtonPress, onEntryTransitionEnd, children, shouldShowWrapper}) {
function StepScreenWrapper({testID, headerTitle, onBackButtonPress, onEntryTransitionEnd, children, shouldShowWrapper, includeSafeAreaPaddingBottom}) {
const styles = useThemeStyles();

if (!shouldShowWrapper) {
Expand All @@ -40,14 +44,13 @@ function StepScreenWrapper({testID, headerTitle, onBackButtonPress, onEntryTrans

return (
<ScreenWrapper
includeSafeAreaPaddingBottom={false}
shouldEnableKeyboardAvoidingView={false}
includeSafeAreaPaddingBottom={includeSafeAreaPaddingBottom}
onEntryTransitionEnd={onEntryTransitionEnd}
testID={testID}
shouldEnableMaxHeight={DeviceCapabilities.canUseTouchScreen()}
>
{({insets, safeAreaPaddingBottomStyle, didScreenTransitionEnd}) => (
<View style={[styles.flex1, safeAreaPaddingBottomStyle]}>
<View style={[styles.flex1]}>
<HeaderWithBackButton
title={headerTitle}
onBackButtonPress={onBackButtonPress}
Expand Down

0 comments on commit fe1cb18

Please sign in to comment.