@react-navigation/bottom-tabs 8.0.0-alpha.55 → 8.0.0-alpha.57

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.
@@ -15,6 +15,7 @@ export type TabBarIconProps = {
15
15
  route: Route<string>;
16
16
  variant: 'uikit' | 'material';
17
17
  size: 'compact' | 'regular';
18
+ iconSize?: number | undefined;
18
19
  badge?: string | number | undefined;
19
20
  badgeStyle?: StyleProp<TextStyle> | undefined;
20
21
  activeOpacity: number;
@@ -48,6 +49,7 @@ export function TabBarIcon({
48
49
  route: _,
49
50
  variant,
50
51
  size,
52
+ iconSize: iconSizeOverride,
51
53
  badge,
52
54
  badgeStyle,
53
55
  activeOpacity,
@@ -59,11 +61,12 @@ export function TabBarIcon({
59
61
  style,
60
62
  }: TabBarIconProps) {
61
63
  const iconSize =
62
- variant === 'material'
64
+ iconSizeOverride ??
65
+ (variant === 'material'
63
66
  ? ICON_SIZE_MATERIAL
64
67
  : size === 'compact'
65
68
  ? ICON_SIZE_SQUARE_COMPACT
66
- : ICON_SIZE_SQUARE;
69
+ : ICON_SIZE_SQUARE);
67
70
 
68
71
  // We render the icon twice at the same position on top of each other:
69
72
  // active and inactive one, so we can fade between them.
@@ -75,6 +78,10 @@ export function TabBarIcon({
75
78
  : size === 'compact'
76
79
  ? styles.wrapperUikitCompact
77
80
  : styles.wrapperUikit,
81
+ iconSizeOverride != null && {
82
+ width: iconSizeOverride,
83
+ height: iconSizeOverride,
84
+ },
78
85
  style,
79
86
  ]}
80
87
  >