Skip to content

Commit 7be591e

Browse files
committed
feat: added safe area view margin/padding option
1 parent 8df7897 commit 7be591e

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/AnimatedTabBar.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export function AnimatedTabBar<T extends PresetEnum>(
3434
onTabLongPress,
3535
style: overrideStyle,
3636
safeAreaInsets: overrideSafeAreaInsets,
37+
safeAreaBottomPaddingOrMargin = "padding",
3738
...rest
3839
} = props;
3940

@@ -136,7 +137,7 @@ export function AnimatedTabBar<T extends PresetEnum>(
136137
() => ({
137138
// @ts-ignore
138139
...overrideStyle,
139-
paddingBottom: safeBottomArea,
140+
...(safeAreaBottomPaddingOrMargin === "margin" ? {paddingBottom: safeBottomArea} : {marginBottom: safeBottomArea}),
140141
}),
141142
[overrideStyle, safeBottomArea]
142143
);

src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ export type AnimatedTabBarProps<T extends PresetEnum = 'bubble'> = {
140140
onTabPress?: any;
141141
onTabLongPress?: any;
142142
safeAreaInsets?: Insets;
143+
safeAreaBottomPaddingOrMargin?: "padding" | "margin"
143144
} & Omit<TabBarConfigurableProps, 'onLongPress'> &
144145
ExtractPresetConfig<T>;
145146

0 commit comments

Comments
 (0)