@momo-kits/foundation 0.167.1-duotest.1 → 0.167.1-duotest.2
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.
|
@@ -29,7 +29,11 @@ import { getOptions, getStackOptions, useAppState } from '../utils';
|
|
|
29
29
|
import BottomTabBar from './BottomTabBar';
|
|
30
30
|
import { DuoTabBar } from './DuoTabBar';
|
|
31
31
|
import { DuoBarCompressionProvider } from './DuoBarCompression';
|
|
32
|
-
import {
|
|
32
|
+
import {
|
|
33
|
+
ApplicationContext,
|
|
34
|
+
MiniAppContext,
|
|
35
|
+
ScreenContext,
|
|
36
|
+
} from '../../Context';
|
|
33
37
|
import { useScreenLayout } from '../../Layout';
|
|
34
38
|
import { getHeaderRowOptions } from '../../Layout/utils';
|
|
35
39
|
|
|
@@ -204,7 +208,14 @@ const BottomTab: React.FC<BottomTabProps> = ({
|
|
|
204
208
|
compressionBehavior,
|
|
205
209
|
}) => {
|
|
206
210
|
const { theme, navigator } = useContext(ApplicationContext);
|
|
211
|
+
const screen: any = useContext(ScreenContext);
|
|
207
212
|
const { isIPhoneDuo } = useScreenLayout();
|
|
213
|
+
// each tab lays itself out, the hosting stack screen must not add a header or insets
|
|
214
|
+
screen?.claimHeader?.();
|
|
215
|
+
useEffect(() => {
|
|
216
|
+
screen?.syncHeader?.();
|
|
217
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
218
|
+
}, []);
|
|
208
219
|
const dimensions = useWindowDimensions();
|
|
209
220
|
const insets = useSafeAreaInsets();
|
|
210
221
|
const initialIndex = tabs.findIndex(i => i.name === initialRouteName);
|
package/Application/utils.tsx
CHANGED
|
@@ -24,12 +24,7 @@ import type {
|
|
|
24
24
|
} from './types';
|
|
25
25
|
import { ApplicationContext } from '../Context';
|
|
26
26
|
import { Colors, Spacing } from '../Consts';
|
|
27
|
-
import {
|
|
28
|
-
Animated,
|
|
29
|
-
AppState,
|
|
30
|
-
NativeModules,
|
|
31
|
-
Platform,
|
|
32
|
-
} from 'react-native';
|
|
27
|
+
import { Animated, AppState, NativeModules, Platform } from 'react-native';
|
|
33
28
|
import { useHeaderHeight } from '@react-navigation/elements';
|
|
34
29
|
import type { SharedValue } from 'react-native-reanimated';
|
|
35
30
|
import {
|
|
@@ -619,7 +614,6 @@ const useHeaderScrollState = (
|
|
|
619
614
|
...quickReturnOptions,
|
|
620
615
|
headerTransparent: true,
|
|
621
616
|
headerTintColor: Colors.black_17,
|
|
622
|
-
headerShown: true,
|
|
623
617
|
headerBackground: () => (
|
|
624
618
|
<DuoGlassBackground animatedValue={scrollY} />
|
|
625
619
|
),
|
|
@@ -629,7 +623,6 @@ const useHeaderScrollState = (
|
|
|
629
623
|
header: undefined,
|
|
630
624
|
headerTransparent: false,
|
|
631
625
|
headerTintColor: Colors.black_17,
|
|
632
|
-
headerShown: true,
|
|
633
626
|
headerBackground: (props: any) => (
|
|
634
627
|
<HeaderBackground
|
|
635
628
|
{...props}
|
|
@@ -719,7 +712,6 @@ const useHeaderScrollState = (
|
|
|
719
712
|
return { scrollY, onScrollChange, setScrollOffset, background, contentStyle };
|
|
720
713
|
};
|
|
721
714
|
|
|
722
|
-
|
|
723
715
|
export {
|
|
724
716
|
getStackOptions,
|
|
725
717
|
getModalOptions,
|