@@ -11,7 +11,6 @@ import {
1111 ViewStyle ,
1212} from 'react-native' ;
1313
14- import color from 'color' ;
1514import { useSafeAreaInsets } from 'react-native-safe-area-context' ;
1615
1716import {
@@ -20,8 +19,6 @@ import {
2019 getLabelColor ,
2120} from './utils' ;
2221import { useInternalTheme } from '../../core/theming' ;
23- import overlay from '../../styles/overlay' ;
24- import { black , white } from '../../styles/themes/v2/colors' ;
2522import type { ThemeProp } from '../../types' ;
2623import useAnimatedValue from '../../utils/useAnimatedValue' ;
2724import useAnimatedValueArray from '../../utils/useAnimatedValueArray' ;
@@ -333,18 +330,17 @@ const BottomNavigationBar = <Route extends BaseRoute>({
333330 animationEasing,
334331 onTabPress,
335332 onTabLongPress,
336- shifting : shiftingProp ,
333+ shifting : shiftingProp = false ,
337334 safeAreaInsets,
338335 labelMaxFontSizeMultiplier = 1 ,
339- compact : compactProp ,
336+ compact = false ,
340337 testID = 'bottom-navigation-bar' ,
341338 theme : themeOverrides ,
342339} : Props < Route > ) => {
343340 const theme = useInternalTheme ( themeOverrides ) ;
344341 const { bottom, left, right } = useSafeAreaInsets ( ) ;
345342 const { scale } = theme . animation ;
346- const compact = compactProp ?? false ;
347- let shifting = shiftingProp ?? false ;
343+ let shifting = shiftingProp ;
348344
349345 if ( shifting && navigationState . routes . length < 2 ) {
350346 shifting = false ;
@@ -476,38 +472,22 @@ const BottomNavigationBar = <Route extends BaseRoute>({
476472 } ;
477473
478474 const { routes } = navigationState ;
479- const { colors, dark : isDarkTheme , mode } = theme ;
480475
481- const { backgroundColor : customBackground , elevation = 4 } =
482- ( StyleSheet . flatten ( style ) || { } ) as {
483- elevation ?: number ;
484- backgroundColor ?: ColorValue ;
485- } ;
486-
487- const approxBackgroundColor = customBackground
488- ? customBackground
489- : isDarkTheme && mode === 'adaptive'
490- ? overlay ( elevation , colors ?. surface )
491- : colors ?. primary ;
476+ const { backgroundColor : customBackground } = ( StyleSheet . flatten ( style ) ||
477+ { } ) as {
478+ elevation ?: number ;
479+ backgroundColor ?: ColorValue ;
480+ } ;
492481
493482 const backgroundColor = customBackground || theme . colors . elevation . level2 ;
494483
495- const isDark =
496- typeof approxBackgroundColor === 'string'
497- ? ! color ( approxBackgroundColor ) . isLight ( )
498- : true ;
499-
500- const textColor = isDark ? white : black ;
501-
502484 const activeTintColor = getActiveTintColor ( {
503485 activeColor,
504- defaultColor : textColor ,
505486 theme,
506487 } ) ;
507488
508489 const inactiveTintColor = getInactiveTintColor ( {
509490 inactiveColor,
510- defaultColor : textColor ,
511491 theme,
512492 } ) ;
513493
@@ -615,15 +595,13 @@ const BottomNavigationBar = <Route extends BaseRoute>({
615595 tintColor : activeTintColor ,
616596 hasColor : Boolean ( activeColor ) ,
617597 focused,
618- defaultColor : textColor ,
619598 theme,
620599 } ) ;
621600
622601 const inactiveLabelColor = getLabelColor ( {
623602 tintColor : inactiveTintColor ,
624603 hasColor : Boolean ( inactiveColor ) ,
625604 focused,
626- defaultColor : textColor ,
627605 theme,
628606 } ) ;
629607
0 commit comments