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 d319c32
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions packages/bottom-tabs/src/types.tsx
Original file line number Diff line number Diff line change
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
3 changes: 2 additions & 1 deletion packages/bottom-tabs/src/views/BottomTabBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ export function BottomTabBar({
tabBarHideOnKeyboard = false,
tabBarVisibilityAnimationConfig,
tabBarStyle,
tabBarContentStyle,
tabBarBackground,
tabBarActiveTintColor,
tabBarInactiveTintColor,
Expand Down Expand Up @@ -332,7 +333,7 @@ export function BottomTabBar({
</View>
<View
accessibilityRole="tablist"
style={tabBarIsHorizontal ? styles.bottomContent : styles.sideContent}
style={[tabBarIsHorizontal ? styles.bottomContent : styles.sideContent, tabBarContentStyle]}

Check failure on line 336 in packages/bottom-tabs/src/views/BottomTabBar.tsx

View workflow job for this annotation

GitHub Actions / lint

Replace `tabBarIsHorizontal·?·styles.bottomContent·:·styles.sideContent,·tabBarContentStyle` with `⏎··········tabBarIsHorizontal·?·styles.bottomContent·:·styles.sideContent,⏎··········tabBarContentStyle,⏎········`
>
{routes.map((route, index) => {
const focused = index === state.index;
Expand Down

0 comments on commit d319c32

Please sign in to comment.