@momo-kits/foundation 0.169.16-beta.11 → 0.169.16-beta.12
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.
|
@@ -23,9 +23,8 @@ import { BottomTabInsetContext } from './BottomTabInset';
|
|
|
23
23
|
import { DuoBarCompressionProvider } from './DuoBarCompression';
|
|
24
24
|
import LegacyBottomTab from './Legacy';
|
|
25
25
|
import TabScreen from './TabScreen';
|
|
26
|
-
import { ApplicationContext
|
|
26
|
+
import { ApplicationContext } from '../../Context';
|
|
27
27
|
import { useScreenLayout } from '../../Layout';
|
|
28
|
-
import { isLegacyBottomTabDesignSystem } from '../utils';
|
|
29
28
|
|
|
30
29
|
type SceneInterpolator = BottomTabNavigationOptions['sceneStyleInterpolator'];
|
|
31
30
|
|
|
@@ -193,14 +192,13 @@ const FloatingBottomTab: React.FC<BottomTabProps> = ({
|
|
|
193
192
|
};
|
|
194
193
|
|
|
195
194
|
/**
|
|
196
|
-
* App tab navigator. `useLegacy
|
|
197
|
-
*
|
|
195
|
+
* App tab navigator. `useLegacy` renders the pre-redesign docked bar on phones;
|
|
196
|
+
* iPhone Duo always uses the current rail or floating bar.
|
|
198
197
|
*/
|
|
199
198
|
const BottomTab: React.FC<BottomTabProps> = props => {
|
|
200
199
|
const { isIPhoneDuo } = useScreenLayout();
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
if (isLegacy && !isIPhoneDuo) {
|
|
200
|
+
// legacy unless told otherwise: the redesigned bar is not rolled out yet
|
|
201
|
+
if ((props.useLegacy ?? true) && !isIPhoneDuo) {
|
|
204
202
|
return <LegacyBottomTab {...props} />;
|
|
205
203
|
}
|
|
206
204
|
return <FloatingBottomTab {...props} />;
|
|
@@ -36,8 +36,7 @@ export type BottomTabProps = {
|
|
|
36
36
|
/**
|
|
37
37
|
* Renders the pre-redesign docked phone bar instead of the floating one. Ignores
|
|
38
38
|
* `showDot`, `floatingButton.labelContent` and `compressionBehavior`; not on iPhone Duo.
|
|
39
|
-
* Defaults to the
|
|
40
|
-
* false for the floating bar.
|
|
39
|
+
* Defaults to true until the redesign rolls out; pass false for the floating bar.
|
|
41
40
|
*/
|
|
42
41
|
useLegacy?: boolean;
|
|
43
42
|
};
|
package/Application/utils.ts
CHANGED
|
@@ -12,10 +12,6 @@ type AnimatedCompatValue = Animated.Value | SharedValue<number>;
|
|
|
12
12
|
|
|
13
13
|
type NavigationTreeState = NavigationState | PartialState<NavigationState>;
|
|
14
14
|
|
|
15
|
-
type DesignSystemContext = {
|
|
16
|
-
designSystemConfig?: { useLegacyBottomTab?: unknown };
|
|
17
|
-
};
|
|
18
|
-
|
|
19
15
|
/**
|
|
20
16
|
* True when `value` has a callable property `name`. Safe on null and primitives.
|
|
21
17
|
*/
|
|
@@ -81,18 +77,6 @@ const isWhiteListDesignSystem = (context: any): boolean => {
|
|
|
81
77
|
return context?.designSystemConfig?.isWhiteListDesignSystem === true;
|
|
82
78
|
};
|
|
83
79
|
|
|
84
|
-
/**
|
|
85
|
-
* True when the host config asks for the legacy docked BottomTab. Legacy unless
|
|
86
|
-
* the host sends a boolean `designSystemConfig.useLegacyBottomTab`.
|
|
87
|
-
*/
|
|
88
|
-
const isLegacyBottomTabDesignSystem = (context?: DesignSystemContext) => {
|
|
89
|
-
const useLegacyBottomTab = context?.designSystemConfig?.useLegacyBottomTab;
|
|
90
|
-
if (typeof useLegacyBottomTab !== 'boolean') {
|
|
91
|
-
return true;
|
|
92
|
-
}
|
|
93
|
-
return useLegacyBottomTab;
|
|
94
|
-
};
|
|
95
|
-
|
|
96
80
|
/**
|
|
97
81
|
* Shorter edge of a screen or window size.
|
|
98
82
|
*/
|
|
@@ -119,6 +103,5 @@ export {
|
|
|
119
103
|
setAutomationID,
|
|
120
104
|
getStackDepth,
|
|
121
105
|
isWhiteListDesignSystem,
|
|
122
|
-
isLegacyBottomTabDesignSystem,
|
|
123
106
|
isIPhoneDuo,
|
|
124
107
|
};
|