Skip to content

Commit df9d367

Browse files
committed
fix: animation in bottom sheet
1 parent 6e4785c commit df9d367

File tree

3 files changed

+3
-21
lines changed

3 files changed

+3
-21
lines changed

src/components/BottomNavigation/BottomNavigation.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,6 @@ export type Props<Route extends BaseRoute> = {
179179
* Get badge for the tab, uses `route.badge` by default.
180180
*/
181181
getBadge?: (props: { route: Route }) => boolean | number | string | undefined;
182-
/**
183-
* Get color for the tab, uses `route.color` by default.
184-
*/
185-
getColor?: (props: { route: Route }) => string | undefined;
186182
/**
187183
* Get label text for the tab, uses `route.title` by default. Use `renderLabel` to replace label component.
188184
*/
@@ -327,7 +323,6 @@ const BottomNavigation = <Route extends BaseRoute>({
327323
renderTouchable,
328324
getLabelText,
329325
getBadge,
330-
getColor,
331326
getAccessibilityLabel,
332327
getTestID,
333328
activeColor,
@@ -406,7 +401,7 @@ const BottomNavigation = <Route extends BaseRoute>({
406401
...navigationState.routes.map((_, i) =>
407402
Animated.timing(tabsPositionAnims[i], {
408403
toValue: i === index ? 0 : i >= index ? 1 : -1,
409-
duration: shifting ? 150 * scale : 0,
404+
duration: 150 * scale,
410405
useNativeDriver: true,
411406
easing: sceneAnimationEasing,
412407
})
@@ -426,7 +421,6 @@ const BottomNavigation = <Route extends BaseRoute>({
426421
});
427422
},
428423
[
429-
shifting,
430424
navigationState.routes,
431425
offsetsAnims,
432426
scale,
@@ -579,7 +573,6 @@ const BottomNavigation = <Route extends BaseRoute>({
579573
renderTouchable={renderTouchable}
580574
getLabelText={getLabelText}
581575
getBadge={getBadge}
582-
getColor={getColor}
583576
getAccessibilityLabel={getAccessibilityLabel}
584577
getTestID={getTestID}
585578
activeColor={activeColor}

src/components/BottomNavigation/BottomNavigationBar.tsx

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ type BaseRoute = {
3737
focusedIcon?: IconSource;
3838
unfocusedIcon?: IconSource;
3939
badge?: string | number | boolean;
40-
/**
41-
* @deprecated In v5.x works only with theme version 2.
42-
*/
43-
color?: string;
4440
accessibilityLabel?: string;
4541
testID?: string;
4642
lazy?: boolean;
@@ -94,7 +90,6 @@ export type Props<Route extends BaseRoute> = {
9490
* - `title`: title of the route to use as the tab label
9591
* - `focusedIcon`: icon to use as the focused tab icon, can be a string, an image source or a react component @renamed Renamed from 'icon' to 'focusedIcon' in v5.x
9692
* - `unfocusedIcon`: icon to use as the unfocused tab icon, can be a string, an image source or a react component @supported Available in v5.x with theme version 3
97-
* - `color`: color to use as background color for shifting bottom navigation @deprecatedProperty In v5.x works only with theme version 2.
9893
* - `badge`: badge to show on the tab icon, can be `true` to show a dot, `string` or `number` to show text.
9994
* - `accessibilityLabel`: accessibility label for the tab button
10095
* - `testID`: test id for the tab button
@@ -146,10 +141,6 @@ export type Props<Route extends BaseRoute> = {
146141
* Get badge for the tab, uses `route.badge` by default.
147142
*/
148143
getBadge?: (props: { route: Route }) => boolean | number | string | undefined;
149-
/**
150-
* Get color for the tab, uses `route.color` by default.
151-
*/
152-
getColor?: (props: { route: Route }) => string | undefined;
153144
/**
154145
* Get label text for the tab, uses `route.title` by default. Use `renderLabel` to replace label component.
155146
*/
@@ -416,13 +407,13 @@ const BottomNavigationBar = <Route extends BaseRoute>({
416407
Animated.parallel([
417408
Animated.timing(rippleAnim, {
418409
toValue: 1,
419-
duration: shifting ? 400 * scale : 0,
410+
duration: 400 * scale,
420411
useNativeDriver: true,
421412
}),
422413
...navigationState.routes.map((_, i) =>
423414
Animated.timing(tabsAnims[i], {
424415
toValue: i === index ? 1 : 0,
425-
duration: shifting ? 150 * scale : 0,
416+
duration: 150 * scale,
426417
useNativeDriver: true,
427418
easing: animationEasing,
428419
})
@@ -438,7 +429,6 @@ const BottomNavigationBar = <Route extends BaseRoute>({
438429
},
439430
[
440431
rippleAnim,
441-
shifting,
442432
scale,
443433
navigationState.routes,
444434
tabsAnims,

src/react-navigation/views/MaterialBottomTabView.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ export default function MaterialBottomTabView({
9999
? options.title
100100
: (route as Route<string>).name;
101101
}}
102-
getColor={({ route }) => descriptors[route.key].options.tabBarColor}
103102
getBadge={({ route }) => descriptors[route.key].options.tabBarBadge}
104103
getAccessibilityLabel={({ route }) =>
105104
descriptors[route.key].options.tabBarAccessibilityLabel

0 commit comments

Comments
 (0)