Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
5d2cb3b
feat: add flag to WorkspacePageWithSections component
chrispader Feb 22, 2025
4d4dc8c
feat: enable edge-to-edge in WorkspaceInitialPage
chrispader Feb 22, 2025
968ec7d
feat: enable edge-to-edge in WorkspaceProfilePage
chrispader Feb 22, 2025
26d8033
fix: simplify logical statement
chrispader Feb 22, 2025
b114b0d
feat: improve `WorkspaceProfileDescriptionPage`
chrispader Feb 22, 2025
6104c9d
Merge branch '@chrispader/add-flags-for-disabling-bottom-safe-area-sp…
chrispader Feb 22, 2025
fcb1680
fix: migrate more screens
chrispader Feb 22, 2025
2088067
Merge branch '@chrispader/add-flags-for-disabling-bottom-safe-area-sp…
chrispader Feb 22, 2025
0f9874c
Merge branch '@chrispader/add-flags-for-disabling-bottom-safe-area-sp…
chrispader Feb 22, 2025
b4b4fa0
Update WorkspaceInvitePage.tsx
chrispader Feb 22, 2025
845e61f
fix: uncomment shouldBlendOpacity
chrispader Feb 22, 2025
aa717af
Merge branch '@chrispader/add-flags-for-disabling-bottom-safe-area-sp…
chrispader Feb 22, 2025
d27fe13
fix: enable on mWeb and disable on web
chrispader Feb 22, 2025
494a998
feat: migrate more workspace screens
chrispader Feb 22, 2025
15f25ff
fix: improve CategorySelectorModal
chrispader Feb 22, 2025
431c12f
Merge branch '@chrispader/add-flags-for-disabling-bottom-safe-area-sp…
chrispader Feb 22, 2025
c661c5d
fix: remove unused props from CategoryPicker
chrispader Feb 23, 2025
7bb3d3d
Merge branch '@chrispader/add-flags-for-disabling-bottom-safe-area-sp…
chrispader Feb 23, 2025
a7aefea
fix: rename old ScreenWrapper props
chrispader Feb 23, 2025
d896e3a
feat: migrate more workspace screens
chrispader Feb 23, 2025
c66145d
Merge branch '@chrispader/add-flags-for-disabling-bottom-safe-area-sp…
chrispader Feb 23, 2025
08ae4ee
feat: migrate categories, invoices, rules, tags
chrispader Feb 23, 2025
e025fd0
Merge branch '@chrispader/add-flags-for-disabling-bottom-safe-area-sp…
chrispader Feb 23, 2025
adecd13
fix: remaining workspace pages
chrispader Feb 23, 2025
0cdada2
refactor: migrate more workspace screens
chrispader Feb 23, 2025
a2bcb50
Merge branch '@chrispader/add-flags-for-disabling-bottom-safe-area-sp…
chrispader Feb 23, 2025
052ce04
fix: more workspace migrations
chrispader Feb 24, 2025
78d384b
Merge branch '@chrispader/add-flags-for-disabling-bottom-safe-area-sp…
chrispader Feb 24, 2025
2593783
Merge branch '@chrispader/add-flags-for-disabling-bottom-safe-area-sp…
chrispader Feb 24, 2025
d17bd67
fix: monthly offset page
chrispader Feb 24, 2025
365e010
refactor: more workspace pages
chrispader Feb 25, 2025
b336c18
Merge branch '@chrispader/add-flags-for-disabling-bottom-safe-area-sp…
chrispader Feb 25, 2025
9e13956
fix: remove padding changes and bottom docked footer content
chrispader Feb 25, 2025
c7c0503
Merge branch '@chrispader/add-flags-for-disabling-bottom-safe-area-sp…
chrispader Feb 25, 2025
b64295e
Merge branch '@chrispader/add-flags-for-disabling-bottom-safe-area-sp…
chrispader Feb 25, 2025
3cc59ff
fix: remove sticky footer content
chrispader Feb 26, 2025
4f5297f
Merge branch '@chrispader/add-flags-for-disabling-bottom-safe-area-sp…
chrispader Feb 26, 2025
b453f97
fix: more screens
chrispader Feb 26, 2025
ceeeaf6
fix: ScreenWrapper keyboard offset by default
chrispader Feb 26, 2025
37e8059
Merge branch '@chrispader/add-flags-for-disabling-bottom-safe-area-sp…
chrispader Feb 26, 2025
3c06a59
feat: migrate remaining workspace screens
chrispader Feb 26, 2025
785b278
Update WorkspaceInitialPage.tsx
chrispader Feb 26, 2025
688b6fe
fix: minor issues
chrispader Feb 26, 2025
c0bf666
fix: remaining workspace issues
chrispader Feb 26, 2025
68ffb79
fix: use `useBottomSafeAreaPaddingStyle` hook in `CardSelectionStep`
chrispader Feb 26, 2025
7543e54
fix: more fixes
chrispader Feb 26, 2025
2068d44
Merge branch '@chrispader/add-flags-for-disabling-bottom-safe-area-sp…
chrispader Feb 26, 2025
f785d2d
fix: eslint errors
chrispader Feb 26, 2025
ab844ae
Merge branch '@chrispader/add-flags-for-disabling-bottom-safe-area-sp…
chrispader Feb 26, 2025
df52b8b
Merge branch '@chrispader/add-flags-for-disabling-bottom-safe-area-sp…
chrispader Mar 3, 2025
e3f47f5
Merge branch '@chrispader/add-flags-for-disabling-bottom-safe-area-sp…
chrispader Mar 6, 2025
e6f97e7
fix: WorkspaceMembersPage
chrispader Mar 6, 2025
20cd8eb
Merge branch '@chrispader/add-flags-for-disabling-bottom-safe-area-sp…
chrispader Mar 6, 2025
43eaa0d
Merge branch '@chrispader/add-flags-for-disabling-bottom-safe-area-sp…
chrispader Mar 12, 2025
4b68f71
Merge branch '@chrispader/add-flags-for-disabling-bottom-safe-area-sp…
chrispader Mar 12, 2025
bb19663
Merge branch 'main' into @chrispader/fix-bottom-safe-area-handling-in…
chrispader Mar 14, 2025
2a9b81f
Merge branch 'main' into @chrispader/fix-bottom-safe-area-handling-in…
chrispader Mar 15, 2025
0a91b7a
Merge branch '@chrispader/form-wrapper-legacy-bottom-safe-area-handli…
chrispader Mar 20, 2025
f400d6f
Merge branch 'main' into @chrispader/fix-bottom-safe-area-handling-in…
chrispader Mar 24, 2025
0e4a2fa
fix: don't apply bottom safe area padding twice in `ConnectionLayout`
chrispader Mar 24, 2025
f66ae06
Merge branch 'main' into @chrispader/fix-bottom-safe-area-handling-in…
chrispader Mar 25, 2025
c57a3bf
Merge branch 'main' into pr/57281
chrispader Apr 8, 2025
3d952bf
Merge branch 'main' into pr/57281
chrispader Apr 10, 2025
060eb77
fix: add edge-to-edge to CurrencyPicker modal
chrispader Apr 10, 2025
f5a75e1
fix: apply padding top in modals with edge-to-edge
chrispader Apr 10, 2025
d1736e9
fix: enable edge-to-edge in address selection page
chrispader Apr 10, 2025
2e9d464
fix: netsuite issues
chrispader Apr 10, 2025
f9538c4
fix: sage issues
chrispader Apr 10, 2025
89f1287
fix: xero issues
chrispader Apr 10, 2025
ea7f122
Update NetSuiteExportExpensesPayableAccountSelectPage.tsx
chrispader Apr 10, 2025
785a0fd
fix: minor issues
chrispader Apr 10, 2025
cf62501
fix: remove unused import
chrispader Apr 10, 2025
8edb70f
Update NetSuiteExportExpensesVendorSelectPage.tsx
chrispader Apr 11, 2025
50405cc
fix: default edge to edge mode value
chrispader Apr 11, 2025
72c38a8
refactor: simplify FormWrapper SubmitButton code and fix bottom safe …
chrispader Apr 11, 2025
3cd7566
fix: custom list and item flows
chrispader Apr 11, 2025
128537c
refactor: make all ConnectionLayout and SelectionScreen edge-to-edge …
chrispader Apr 11, 2025
8406b69
Update NetSuiteCustomListSelectorModal.tsx
chrispader Apr 11, 2025
1095824
fix: linting errors
chrispader Apr 11, 2025
805ab0d
Merge branch 'main' into pr/57281
chrispader Apr 11, 2025
386737d
Update src/components/Form/FormWrapper.tsx
chrispader Apr 11, 2025
9ce4753
fix: lint error
chrispader Apr 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/components/AddressForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ function AddressForm({
onSubmit={onSubmit}
submitButtonText={submitButtonText}
enabledWhenOffline
addBottomSafeAreaPadding
>
<View>
<InputWrapper
Expand Down
9 changes: 6 additions & 3 deletions src/components/AmountPicker/AmountSelectorModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,22 @@ function AmountSelectorModal({value, description = '', onValueSelected, isVisibl
onModalHide={onClose}
hideModalContentWhileAnimating
useNativeDriver
enableEdgeToEdgeBottomSafeAreaPadding
>
<ScreenWrapper
enableEdgeToEdgeBottomSafeAreaPadding
includePaddingTop={false}
includeSafeAreaPaddingBottom={false}
testID={AmountSelectorModal.displayName}
shouldEnableMaxHeight
style={[styles.pb0]}
>
<HeaderWithBackButton
title={description}
onBackButtonPress={onClose}
/>
<ScrollView contentContainerStyle={[styles.flexGrow1, styles.mb5]}>
<ScrollView
contentContainerStyle={[styles.flexGrow1, styles.mb5]}
addBottomSafeAreaPadding
>
<View style={styles.flex1}>
<AmountForm
// eslint-disable-next-line react/jsx-props-no-spreading
Expand Down
11 changes: 10 additions & 1 deletion src/components/CategoryPicker.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React, {useMemo} from 'react';
import type {StyleProp, ViewStyle} from 'react-native';
import {useOnyx} from 'react-native-onyx';
import useDebouncedState from '@hooks/useDebouncedState';
import useLocalize from '@hooks/useLocalize';
import useNetwork from '@hooks/useNetwork';
import * as CategoryOptionsListUtils from '@libs/CategoryOptionListUtils';

Check failure on line 7 in src/components/CategoryPicker.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Namespace imports from @libs are not allowed. Use named imports instead. Example: import { method } from "@libs/module"
import type {Category} from '@libs/CategoryOptionListUtils';
import * as OptionsListUtils from '@libs/OptionsListUtils';

Check failure on line 9 in src/components/CategoryPicker.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Namespace imports from @libs are not allowed. Use named imports instead. Example: import { method } from "@libs/module"
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import {isEmptyObject} from '@src/types/utils/EmptyObject';
Expand All @@ -17,9 +18,15 @@
policyID: string | undefined;
selectedCategory?: string;
onSubmit: (item: ListItem) => void;
contentContainerStyle?: StyleProp<ViewStyle>;

/**
* If enabled, the content will have a bottom padding equal to account for the safe bottom area inset.
*/
addBottomSafeAreaPadding?: boolean;
};

function CategoryPicker({selectedCategory, policyID, onSubmit}: CategoryPickerProps) {
function CategoryPicker({selectedCategory, policyID, onSubmit, addBottomSafeAreaPadding = false, contentContainerStyle}: CategoryPickerProps) {
const [policyCategories] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${policyID}`);
const [policyCategoriesDraft] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES_DRAFT}${policyID}`);
const [policyRecentlyUsedCategories] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_RECENTLY_USED_CATEGORIES}${policyID}`);
Expand Down Expand Up @@ -76,6 +83,8 @@
ListItem={RadioListItem}
initiallyFocusedOptionKey={selectedOptionKey ?? undefined}
isRowMultilineSupported
addBottomSafeAreaPadding={addBottomSafeAreaPadding}
contentContainerStyle={contentContainerStyle}
/>
);
}
Expand Down
5 changes: 4 additions & 1 deletion src/components/CategorySelector/CategorySelectorModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@ function CategorySelectorModal({policyID, isVisible, currentCategory, onCategory
onModalHide={onClose}
hideModalContentWhileAnimating
useNativeDriver
enableEdgeToEdgeBottomSafeAreaPadding
>
<ScreenWrapper
style={[styles.pb0]}
includePaddingTop={false}
includeSafeAreaPaddingBottom
enableEdgeToEdgeBottomSafeAreaPadding
shouldEnableKeyboardAvoidingView={false}
testID={CategorySelectorModal.displayName}
>
Expand All @@ -55,6 +56,8 @@ function CategorySelectorModal({policyID, isVisible, currentCategory, onCategory
policyID={policyID}
selectedCategory={currentCategory}
onSubmit={onCategorySelected}
contentContainerStyle={styles.pb5}
addBottomSafeAreaPadding
/>
</ScreenWrapper>
</Modal>
Expand Down
8 changes: 7 additions & 1 deletion src/components/ConnectionLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ function ConnectionLayout({
shouldBeBlocked={!!shouldBeBlocked || shouldBlockByConnection}
>
<ScreenWrapper
enableEdgeToEdgeBottomSafeAreaPadding
includeSafeAreaPaddingBottom={!!shouldIncludeSafeAreaPaddingBottom}
shouldEnableMaxHeight
testID={displayName}
Expand All @@ -143,7 +144,12 @@ function ConnectionLayout({
onBackButtonPress={onBackButtonPress}
/>
{shouldUseScrollView ? (
<ScrollView contentContainerStyle={contentContainerStyle}>{renderSelectionContent}</ScrollView>
<ScrollView
contentContainerStyle={contentContainerStyle}
addBottomSafeAreaPadding
>
{renderSelectionContent}
</ScrollView>
) : (
<View style={contentContainerStyle}>{renderSelectionContent}</View>
)}
Expand Down
5 changes: 3 additions & 2 deletions src/components/CurrencyPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ function CurrencyPicker({label, value, errorText, headerContent, excludeCurrenci
onBackdropPress={Navigation.dismissModal}
shouldUseModalPaddingStyle={false}
shouldHandleNavigationBack
enableEdgeToEdgeBottomSafeAreaPadding
>
<ScreenWrapper
style={[styles.pb0]}
includePaddingTop
includeSafeAreaPaddingBottom
testID={CurrencyPicker.displayName}
shouldEnableMaxHeight
enableEdgeToEdgeBottomSafeAreaPadding
>
<HeaderWithBackButton
title={label}
Expand All @@ -97,6 +97,7 @@ function CurrencyPicker({label, value, errorText, headerContent, excludeCurrenci
onSelect={updateInput}
searchInputLabel={translate('common.search')}
excludedCurrencies={excludeCurrencies}
addBottomSafeAreaPadding
/>
</BlockingComponent>
</ScreenWrapper>
Expand Down
45 changes: 27 additions & 18 deletions src/components/Form/FormWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import FormAlertWithSubmitButton from '@components/FormAlertWithSubmitButton';
import FormElement from '@components/FormElement';
import ScrollView from '@components/ScrollView';
import ScrollViewWithContext from '@components/ScrollViewWithContext';
import useBottomSafeSafeAreaPaddingStyle from '@hooks/useBottomSafeSafeAreaPaddingStyle';
import useSafeAreaPaddings from '@hooks/useSafeAreaPaddings';
import useThemeStyles from '@hooks/useThemeStyles';
import {getLatestErrorMessage} from '@libs/ErrorUtils';
Expand Down Expand Up @@ -48,6 +49,12 @@ type FormWrapperProps = ChildrenProps &

/** Whether the submit button should stick to the bottom of the screen. */
shouldSubmitButtonStickToBottom?: boolean;

/**
* Whether the button should have a background layer in the color of theme.appBG.
* This is needed for buttons that allow content to display under them.
*/
shouldSubmitButtonBlendOpacity?: boolean;
};

function FormWrapper({
Expand All @@ -74,6 +81,7 @@ function FormWrapper({
addBottomSafeAreaPadding,
addOfflineIndicatorBottomSafeAreaPadding: addOfflineIndicatorBottomSafeAreaPaddingProp,
shouldSubmitButtonStickToBottom: shouldSubmitButtonStickToBottomProp,
shouldSubmitButtonBlendOpacity = false,
}: FormWrapperProps) {
const styles = useThemeStyles();
const formRef = useRef<RNScrollView>(null);
Expand Down Expand Up @@ -115,18 +123,28 @@ function FormWrapper({
}, [errors, formState?.errorFields, inputRefs]);

// If either of `addBottomSafeAreaPadding` or `shouldSubmitButtonStickToBottom` is explicitly set,
// we expect that the user wants to use the new edge-to-edge bottom safe area padding handling.
// we expect that the user wants to use the new edge-to-edge mode.
// In this case, we want to get and apply the padding unconditionnally.
const enableEdgeToEdgeBottomSafeAreaPadding = addBottomSafeAreaPadding !== undefined || shouldSubmitButtonStickToBottomProp !== undefined;
const isUsingEdgeToEdgeMode = addBottomSafeAreaPadding !== undefined || shouldSubmitButtonStickToBottomProp !== undefined;
const shouldSubmitButtonStickToBottom = shouldSubmitButtonStickToBottomProp ?? false;
const {paddingBottom} = useSafeAreaPaddings(enableEdgeToEdgeBottomSafeAreaPadding);
const {paddingBottom} = useSafeAreaPaddings(isUsingEdgeToEdgeMode);

// Same as above, if `addBottomSafeAreaPadding` is explicitly set true, we default to the new edge-to-edge bottom safe area padding handling.
// If the paddingBottom is 0, it has already been applied to a parent component and we don't want to apply the padding again.
const isLegacyBottomSafeAreaPaddingAlreadyApplied = paddingBottom === 0;
const shouldApplyBottomSafeAreaPadding = addBottomSafeAreaPadding ?? !isLegacyBottomSafeAreaPaddingAlreadyApplied;
const addOfflineIndicatorBottomSafeAreaPadding = addOfflineIndicatorBottomSafeAreaPaddingProp ?? addBottomSafeAreaPadding === true;

// We need to add bottom safe area padding to the submit button when we don't use a scroll view or
// when the submit button is sticking to the bottom.
const addSubmitButtonBottomSafeAreaPadding = addBottomSafeAreaPadding && (!shouldUseScrollView || shouldSubmitButtonStickToBottom);
const submitButtonStylesWithBottomSafeAreaPadding = useBottomSafeSafeAreaPaddingStyle({
addBottomSafeAreaPadding: addSubmitButtonBottomSafeAreaPadding,
styleProperty: shouldSubmitButtonStickToBottom ? 'bottom' : 'paddingBottom',
additionalPaddingBottom: shouldSubmitButtonStickToBottom ? styles.pb5.paddingBottom : 0,
style: submitButtonStyles,
});

const SubmitButton = useMemo(
() =>
isSubmitButtonVisible && (
Expand All @@ -142,23 +160,15 @@ function FormWrapper({
containerStyles={[
styles.mh0,
styles.mt5,
submitFlexEnabled ? styles.flex1 : {},
submitButtonStyles,
shouldSubmitButtonStickToBottom
? [
styles.stickToBottom,
{
bottom: styles.pb5.paddingBottom + paddingBottom,
},
style,
]
: {},
submitFlexEnabled && styles.flex1,
submitButtonStylesWithBottomSafeAreaPadding,
shouldSubmitButtonStickToBottom && [styles.stickToBottom, style],
]}
enabledWhenOffline={enabledWhenOffline}
isSubmitActionDangerous={isSubmitActionDangerous}
disablePressOnEnter={disablePressOnEnter}
enterKeyEventListenerPriority={1}
shouldBlendOpacity={shouldSubmitButtonStickToBottom}
shouldBlendOpacity={shouldSubmitButtonBlendOpacity}
/>
),
[
Expand All @@ -175,16 +185,15 @@ function FormWrapper({
isSubmitDisabled,
onFixTheErrorsLinkPressed,
onSubmit,
paddingBottom,
shouldHideFixErrorsAlert,
shouldSubmitButtonBlendOpacity,
shouldSubmitButtonStickToBottom,
style,
styles.flex1,
styles.mh0,
styles.mt5,
styles.pb5.paddingBottom,
styles.stickToBottom,
submitButtonStyles,
submitButtonStylesWithBottomSafeAreaPadding,
submitButtonText,
submitFlexEnabled,
],
Expand Down
6 changes: 5 additions & 1 deletion src/components/FormAlertWithSubmitButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ type FormAlertWithSubmitButtonProps = {
* This is needed for buttons that allow content to display under them.
*/
shouldBlendOpacity?: boolean;

/** Whether to add a bottom padding to the button */
addButtonBottomPadding?: boolean;
};

function FormAlertWithSubmitButton({
Expand All @@ -90,9 +93,10 @@ function FormAlertWithSubmitButton({
errorMessageStyle,
enterKeyEventListenerPriority = 0,
shouldBlendOpacity = false,
addButtonBottomPadding = true,
}: FormAlertWithSubmitButtonProps) {
const styles = useThemeStyles();
const style = [!footerContent ? {} : styles.mb3, buttonStyles];
const style = [footerContent && addButtonBottomPadding ? styles.mb3 : {}, buttonStyles];

// Disable pressOnEnter for Android Native to avoid issues with the Samsung keyboard,
// where pressing Enter saves the form instead of adding a new line in multiline input.
Expand Down
2 changes: 1 addition & 1 deletion src/components/ImportSpreadsheetColumns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function ImportSpreadsheetColumns({spreadsheetColumns, columnNames, columnRoles,
})}
</View>
</ScrollView>
<FixedFooter>
<FixedFooter addBottomSafeAreaPadding>
<OfflineWithFeedback
shouldDisplayErrorAbove
errors={errors}
Expand Down
17 changes: 17 additions & 0 deletions src/components/InteractiveStepWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,19 @@ type InteractiveStepWrapperProps = {

// Offline indicator style
offlineIndicatorStyle?: StyleProp<ViewStyle>;

/**
* Whether the KeyboardAvoidingView should compensate for the bottom safe area padding.
* The KeyboardAvoidingView will use a negative keyboardVerticalOffset.
*/
shouldKeyboardOffsetBottomSafeAreaPadding?: boolean;

/**
* Temporary flag to disable safe area bottom spacing in the ScreenWrapper and to allow edge-to-edge content
* The ScreenWrapper should not always apply bottom safe area padding, instead it should be applied to the scrollable/bottom-docked content directly.
* This flag can be removed, once all components/screens have switched to edge-to-edge safe area handling.
*/
enableEdgeToEdgeBottomSafeAreaPadding?: boolean;
};

function InteractiveStepWrapper(
Expand All @@ -55,6 +68,8 @@ function InteractiveStepWrapper(
shouldShowOfflineIndicator,
shouldEnablePickerAvoiding = false,
offlineIndicatorStyle,
shouldKeyboardOffsetBottomSafeAreaPadding,
enableEdgeToEdgeBottomSafeAreaPadding,
}: InteractiveStepWrapperProps,
ref: React.ForwardedRef<View>,
) {
Expand All @@ -65,10 +80,12 @@ function InteractiveStepWrapper(
ref={ref}
testID={wrapperID}
includeSafeAreaPaddingBottom
enableEdgeToEdgeBottomSafeAreaPadding={enableEdgeToEdgeBottomSafeAreaPadding}
shouldEnablePickerAvoiding={shouldEnablePickerAvoiding}
shouldEnableMaxHeight={shouldEnableMaxHeight}
shouldShowOfflineIndicator={shouldShowOfflineIndicator}
offlineIndicatorStyle={offlineIndicatorStyle}
shouldKeyboardOffsetBottomSafeAreaPadding={shouldKeyboardOffsetBottomSafeAreaPadding}
>
<HeaderWithBackButton
title={headerTitle}
Expand Down
8 changes: 5 additions & 3 deletions src/components/Modal/BaseModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,13 @@ function BaseModal(
swipeThreshold = 150,
swipeDirection,
shouldPreventScrollOnFocus = false,
enableEdgeToEdgeBottomSafeAreaPadding = false,
enableEdgeToEdgeBottomSafeAreaPadding,
shouldApplySidePanelOffset = type === CONST.MODAL.MODAL_TYPE.RIGHT_DOCKED,
}: BaseModalProps,
ref: React.ForwardedRef<View>,
) {
// When the `enableEdgeToEdgeBottomSafeAreaPadding` prop is explicitly set, we enable edge-to-edge mode.
const isUsingEdgeToEdgeMode = enableEdgeToEdgeBottomSafeAreaPadding !== undefined;
const theme = useTheme();
const styles = useThemeStyles();
const StyleUtils = useStyleUtils();
Expand Down Expand Up @@ -216,7 +218,7 @@ function BaseModal(
shouldAddBottomSafeAreaMargin,
shouldAddTopSafeAreaMargin,
// enableEdgeToEdgeBottomSafeAreaPadding is used as a temporary solution to disable safe area bottom spacing on modals, to allow edge-to-edge content
shouldAddBottomSafeAreaPadding: !enableEdgeToEdgeBottomSafeAreaPadding && (!avoidKeyboard || !keyboardStateContextValue.isKeyboardActive) && shouldAddBottomSafeAreaPadding,
shouldAddBottomSafeAreaPadding: !isUsingEdgeToEdgeMode && (!avoidKeyboard || !keyboardStateContextValue.isKeyboardActive) && shouldAddBottomSafeAreaPadding,
shouldAddTopSafeAreaPadding,
modalContainerStyle,
insets,
Expand All @@ -225,8 +227,8 @@ function BaseModal(
}, [
StyleUtils,
avoidKeyboard,
enableEdgeToEdgeBottomSafeAreaPadding,
insets,
isUsingEdgeToEdgeMode,
keyboardStateContextValue.isKeyboardActive,
modalContainerStyle,
shouldAddBottomSafeAreaMargin,
Expand Down
Loading