Skip to content

Commit

Permalink
feat: added safe area view margin/padding option
Browse files Browse the repository at this point in the history
  • Loading branch information
BenJeau committed Jan 24, 2022
1 parent 8df7897 commit 7be591e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/AnimatedTabBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export function AnimatedTabBar<T extends PresetEnum>(
onTabLongPress,
style: overrideStyle,
safeAreaInsets: overrideSafeAreaInsets,
safeAreaBottomPaddingOrMargin = "padding",
...rest
} = props;

Expand Down Expand Up @@ -136,7 +137,7 @@ export function AnimatedTabBar<T extends PresetEnum>(
() => ({
// @ts-ignore
...overrideStyle,
paddingBottom: safeBottomArea,
...(safeAreaBottomPaddingOrMargin === "margin" ? {paddingBottom: safeBottomArea} : {marginBottom: safeBottomArea}),
}),
[overrideStyle, safeBottomArea]
);
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ export type AnimatedTabBarProps<T extends PresetEnum = 'bubble'> = {
onTabPress?: any;
onTabLongPress?: any;
safeAreaInsets?: Insets;
safeAreaBottomPaddingOrMargin?: "padding" | "margin"
} & Omit<TabBarConfigurableProps, 'onLongPress'> &
ExtractPresetConfig<T>;

Expand Down

0 comments on commit 7be591e

Please sign in to comment.