Skip to content

Commit 22989b6

Browse files
authored
fix: correct label color for v2 (#3711)
1 parent eb5ce8d commit 22989b6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/components/BottomNavigation/utils.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,10 @@ export const getLabelColor = ({
5959
return tintColor;
6060
}
6161

62-
if (focused) {
63-
return theme.colors.onSurface;
64-
}
65-
6662
if (theme.isV3) {
63+
if (focused) {
64+
return theme.colors.onSurface;
65+
}
6766
return theme.colors.onSurfaceVariant;
6867
}
6968

src/components/__tests__/BottomNavigation.test.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,7 @@ describe('getLabelColor', () => {
518518
${undefined} | ${true} | ${'#fff'} | ${true} | ${MD3Colors.neutral10}
519519
${undefined} | ${false} | ${'#fff'} | ${true} | ${MD3Colors.neutralVariant30}
520520
${undefined} | ${false} | ${'#fff'} | ${false} | ${'#fff'}
521+
${undefined} | ${true} | ${'#fff'} | ${false} | ${'#fff'}
521522
`(
522523
'returns $expected when tintColor: $tintColor, focused: $focused useV3: $useV3',
523524
({ tintColor, focused, defaultColor, useV3, expected }) => {

0 commit comments

Comments
 (0)