From 750123126894f64d44fc4a2490bf7d75fcaae041 Mon Sep 17 00:00:00 2001 From: Lev Shapiro Date: Sat, 21 Oct 2023 11:00:43 +0200 Subject: [PATCH 1/2] feat: add activeIndicatorStyle to BottomNavigation --- .../BottomNavigation/BottomNavigation.tsx | 3 +++ .../BottomNavigation/BottomNavigationBar.tsx | 13 ++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/components/BottomNavigation/BottomNavigation.tsx b/src/components/BottomNavigation/BottomNavigation.tsx index 8efbc25457..3ceeaaa5ca 100644 --- a/src/components/BottomNavigation/BottomNavigation.tsx +++ b/src/components/BottomNavigation/BottomNavigation.tsx @@ -251,6 +251,7 @@ export type Props = { */ labelMaxFontSizeMultiplier?: number; style?: StyleProp; + activeIndicatorStyle?: StyleProp; /** * @optional */ @@ -332,6 +333,7 @@ const BottomNavigation = ({ barStyle, labeled = true, style, + activeIndicatorStyle, sceneAnimationEnabled = false, sceneAnimationType = 'opacity', sceneAnimationEasing, @@ -579,6 +581,7 @@ const BottomNavigation = ({ inactiveColor={inactiveColor} keyboardHidesNavigationBar={keyboardHidesNavigationBar} style={barStyle} + activeIndicatorStyle={activeIndicatorStyle} labeled={labeled} animationEasing={sceneAnimationEasing} onTabPress={handleTabPress} diff --git a/src/components/BottomNavigation/BottomNavigationBar.tsx b/src/components/BottomNavigation/BottomNavigationBar.tsx index ef7ec26847..ab303fd634 100644 --- a/src/components/BottomNavigation/BottomNavigationBar.tsx +++ b/src/components/BottomNavigation/BottomNavigationBar.tsx @@ -15,11 +15,6 @@ import { import color from 'color'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; -import { - getActiveTintColor, - getInactiveTintColor, - getLabelColor, -} from './utils'; import { useInternalTheme } from '../../core/theming'; import overlay from '../../styles/overlay'; import { black, white } from '../../styles/themes/v2/colors'; @@ -33,6 +28,11 @@ import Icon, { IconSource } from '../Icon'; import Surface from '../Surface'; import TouchableRipple from '../TouchableRipple/TouchableRipple'; import Text from '../Typography/Text'; +import { + getActiveTintColor, + getInactiveTintColor, + getLabelColor, +} from './utils'; type BaseRoute = { key: string; @@ -198,6 +198,7 @@ export type Props = { */ labelMaxFontSizeMultiplier?: number; style?: Animated.WithAnimatedValue>; + activeIndicatorStyle?: StyleProp; /** * @optional */ @@ -366,6 +367,7 @@ const BottomNavigationBar = ({ inactiveColor, keyboardHidesNavigationBar = Platform.OS === 'android', style, + activeIndicatorStyle, labeled = true, animationEasing, onTabPress, @@ -787,6 +789,7 @@ const BottomNavigationBar = ({ ], backgroundColor: theme.colors.secondaryContainer, }, + activeIndicatorStyle, ]} /> )} From fdf8124c829e55125ba1092fc287436272b9942d Mon Sep 17 00:00:00 2001 From: Lev Shapiro Date: Sat, 21 Oct 2023 11:06:40 +0200 Subject: [PATCH 2/2] fix: import order --- .../BottomNavigation/BottomNavigationBar.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/BottomNavigation/BottomNavigationBar.tsx b/src/components/BottomNavigation/BottomNavigationBar.tsx index ab303fd634..456632c79a 100644 --- a/src/components/BottomNavigation/BottomNavigationBar.tsx +++ b/src/components/BottomNavigation/BottomNavigationBar.tsx @@ -15,6 +15,11 @@ import { import color from 'color'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; +import { + getActiveTintColor, + getInactiveTintColor, + getLabelColor, +} from './utils'; import { useInternalTheme } from '../../core/theming'; import overlay from '../../styles/overlay'; import { black, white } from '../../styles/themes/v2/colors'; @@ -28,11 +33,6 @@ import Icon, { IconSource } from '../Icon'; import Surface from '../Surface'; import TouchableRipple from '../TouchableRipple/TouchableRipple'; import Text from '../Typography/Text'; -import { - getActiveTintColor, - getInactiveTintColor, - getLabelColor, -} from './utils'; type BaseRoute = { key: string;