Fix compact sheet bottom spacing

This commit is contained in:
Mohamed Boudra
2026-06-04 09:28:05 +07:00
parent f3b7dac768
commit 3e3e944cf4
5 changed files with 112 additions and 5 deletions
@@ -0,0 +1,30 @@
export interface CompactSheetSafeAreaPaddingInput {
isCompact: boolean;
hasFooter: boolean;
baseContentPadding: number;
baseFooterPadding: number;
safeAreaBottom: number;
}
export interface CompactSheetSafeAreaPadding {
contentPaddingBottom?: number;
footerPaddingBottom?: number;
}
export function getCompactSheetSafeAreaPadding({
isCompact,
hasFooter,
baseContentPadding,
baseFooterPadding,
safeAreaBottom,
}: CompactSheetSafeAreaPaddingInput): CompactSheetSafeAreaPadding {
if (!isCompact || safeAreaBottom <= 0) {
return {};
}
if (hasFooter) {
return { footerPaddingBottom: baseFooterPadding + safeAreaBottom };
}
return { contentPaddingBottom: baseContentPadding + safeAreaBottom };
}