Skip to content

Commit

Permalink
feat: add ability to override bottom tab sideContent styles
Browse files Browse the repository at this point in the history
  • Loading branch information
evoactivity committed Apr 5, 2024
1 parent d90ed76 commit bddbdb0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions packages/bottom-tabs/src/types.tsx
Expand Up @@ -227,6 +227,11 @@ export type BottomTabNavigationOptions = HeaderOptions & {
*/
tabBarStyle?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;

/**
* Style object for the tab bar content container.
*/
tabBarContentStyle?: StyleProp<ViewStyle>;

/**
* Function which returns a React Element to use as background for the tab bar.
* You could render an image, a gradient, blur view etc.
Expand Down
6 changes: 5 additions & 1 deletion packages/bottom-tabs/src/views/BottomTabBar.tsx
Expand Up @@ -155,6 +155,7 @@ export function BottomTabBar({
tabBarHideOnKeyboard = false,
tabBarVisibilityAnimationConfig,
tabBarStyle,
tabBarContentStyle,
tabBarBackground,
tabBarActiveTintColor,
tabBarInactiveTintColor,
Expand Down Expand Up @@ -332,7 +333,10 @@ export function BottomTabBar({
</View>
<View
accessibilityRole="tablist"
style={tabBarIsHorizontal ? styles.bottomContent : styles.sideContent}
style={[
tabBarIsHorizontal ? styles.bottomContent : styles.sideContent,
tabBarContentStyle,
]}
>
{routes.map((route, index) => {
const focused = index === state.index;
Expand Down

0 comments on commit bddbdb0

Please sign in to comment.