@react-navigation/bottom-tabs 7.20.0 → 7.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/module/unstable/Deferred.js +3 -10
- package/lib/module/unstable/Deferred.js.map +1 -1
- package/lib/module/unstable/NativeBottomTabView.native.js +288 -196
- package/lib/module/unstable/NativeBottomTabView.native.js.map +1 -1
- package/lib/module/views/BottomTabBar.js +111 -64
- package/lib/module/views/BottomTabBar.js.map +1 -1
- package/lib/module/views/BottomTabItem.js +2 -0
- package/lib/module/views/BottomTabItem.js.map +1 -1
- package/lib/module/views/BottomTabView.js +78 -57
- package/lib/module/views/BottomTabView.js.map +1 -1
- package/lib/module/views/TabBarIcon.js +6 -2
- package/lib/module/views/TabBarIcon.js.map +1 -1
- package/lib/typescript/src/types.d.ts +4 -0
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/unstable/Deferred.d.ts.map +1 -1
- package/lib/typescript/src/unstable/NativeBottomTabView.native.d.ts.map +1 -1
- package/lib/typescript/src/unstable/types.d.ts +124 -4
- package/lib/typescript/src/unstable/types.d.ts.map +1 -1
- package/lib/typescript/src/views/BottomTabBar.d.ts.map +1 -1
- package/lib/typescript/src/views/BottomTabItem.d.ts +5 -1
- package/lib/typescript/src/views/BottomTabItem.d.ts.map +1 -1
- package/lib/typescript/src/views/BottomTabView.d.ts.map +1 -1
- package/lib/typescript/src/views/TabBarIcon.d.ts +2 -1
- package/lib/typescript/src/views/TabBarIcon.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/types.tsx +5 -0
- package/src/unstable/Deferred.tsx +3 -11
- package/src/unstable/NativeBottomTabView.native.tsx +356 -218
- package/src/unstable/types.tsx +133 -4
- package/src/views/BottomTabBar.tsx +153 -82
- package/src/views/BottomTabItem.tsx +6 -0
- package/src/views/BottomTabView.tsx +100 -66
- package/src/views/TabBarIcon.tsx +9 -2
package/src/views/TabBarIcon.tsx
CHANGED
|
@@ -13,6 +13,7 @@ type Props = {
|
|
|
13
13
|
route: Route<string>;
|
|
14
14
|
variant: 'uikit' | 'material';
|
|
15
15
|
size: 'compact' | 'regular';
|
|
16
|
+
iconSize?: number;
|
|
16
17
|
badge?: string | number;
|
|
17
18
|
badgeStyle?: StyleProp<TextStyle>;
|
|
18
19
|
activeOpacity: number;
|
|
@@ -44,6 +45,7 @@ export function TabBarIcon({
|
|
|
44
45
|
route: _,
|
|
45
46
|
variant,
|
|
46
47
|
size,
|
|
48
|
+
iconSize: iconSizeOverride,
|
|
47
49
|
badge,
|
|
48
50
|
badgeStyle,
|
|
49
51
|
activeOpacity,
|
|
@@ -55,11 +57,12 @@ export function TabBarIcon({
|
|
|
55
57
|
style,
|
|
56
58
|
}: Props) {
|
|
57
59
|
const iconSize =
|
|
58
|
-
|
|
60
|
+
iconSizeOverride ??
|
|
61
|
+
(variant === 'material'
|
|
59
62
|
? ICON_SIZE_MATERIAL
|
|
60
63
|
: size === 'compact'
|
|
61
64
|
? ICON_SIZE_ROUND_COMPACT
|
|
62
|
-
: ICON_SIZE_ROUND;
|
|
65
|
+
: ICON_SIZE_ROUND);
|
|
63
66
|
|
|
64
67
|
// We render the icon twice at the same position on top of each other:
|
|
65
68
|
// active and inactive one, so we can fade between them.
|
|
@@ -71,6 +74,10 @@ export function TabBarIcon({
|
|
|
71
74
|
: size === 'compact'
|
|
72
75
|
? styles.wrapperUikitCompact
|
|
73
76
|
: styles.wrapperUikit,
|
|
77
|
+
iconSizeOverride != null && {
|
|
78
|
+
width: iconSizeOverride,
|
|
79
|
+
height: iconSizeOverride,
|
|
80
|
+
},
|
|
74
81
|
style,
|
|
75
82
|
]}
|
|
76
83
|
>
|