@momo-kits/foundation 0.169.12-beta.4 → 0.169.12-beta.5
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.
|
@@ -9,7 +9,7 @@ import { type BottomTabNavigationOptions } from '@react-navigation/bottom-tabs';
|
|
|
9
9
|
import { type Route } from '@react-navigation/native';
|
|
10
10
|
import { Text } from '../../Text';
|
|
11
11
|
import { MiniAppContext } from '../../Context';
|
|
12
|
-
import { Colors } from '../../Consts';
|
|
12
|
+
import { Colors, Spacing } from '../../Consts';
|
|
13
13
|
import { LegacyTabBarIcon } from './LegacyTabBarIcon';
|
|
14
14
|
|
|
15
15
|
type LabelType = NonNullable<BottomTabNavigationOptions['tabBarLabel']>;
|
|
@@ -99,8 +99,8 @@ const styles = StyleSheet.create({
|
|
|
99
99
|
container: {
|
|
100
100
|
flex: 1,
|
|
101
101
|
alignItems: 'center',
|
|
102
|
-
// no vertical padding: icon + label stay centered in the 64 bar without the label's bottom cut
|
|
103
102
|
justifyContent: 'center',
|
|
103
|
+
paddingVertical: Spacing.S,
|
|
104
104
|
bottom: -2,
|
|
105
105
|
},
|
|
106
106
|
debugBaseLine: { borderWidth: 1, borderColor: Colors.green_06 },
|
|
@@ -197,7 +197,8 @@ const FloatingBottomTab: React.FC<BottomTabProps> = ({
|
|
|
197
197
|
*/
|
|
198
198
|
const BottomTab: React.FC<BottomTabProps> = props => {
|
|
199
199
|
const { isIPhoneDuo } = useScreenLayout();
|
|
200
|
-
|
|
200
|
+
// legacy unless told otherwise: the redesigned bar is not rolled out yet
|
|
201
|
+
if ((props.useLegacy ?? true) && !isIPhoneDuo) {
|
|
201
202
|
return <LegacyBottomTab {...props} />;
|
|
202
203
|
}
|
|
203
204
|
return <FloatingBottomTab {...props} />;
|
|
@@ -35,7 +35,8 @@ export type BottomTabProps = {
|
|
|
35
35
|
compressionBehavior?: 'toolbar' | 'tabBar';
|
|
36
36
|
/**
|
|
37
37
|
* Renders the pre-redesign docked phone bar instead of the floating one. Ignores
|
|
38
|
-
* `showDot`, `floatingButton.labelContent` and `compressionBehavior`; not on iPhone Duo.
|
|
38
|
+
* `showDot`, `floatingButton.labelContent` and `compressionBehavior`; not on iPhone Duo.
|
|
39
|
+
* Defaults to true until the redesign rolls out; pass false for the floating bar.
|
|
39
40
|
*/
|
|
40
41
|
useLegacy?: boolean;
|
|
41
42
|
};
|