@momo-kits/foundation 0.162.2-beta.19 → 0.162.2-beta.20
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/Layout/Screen.tsx +19 -1
- package/package.json +6 -6
package/Layout/Screen.tsx
CHANGED
|
@@ -166,6 +166,13 @@ export interface ScreenProps extends ViewProps {
|
|
|
166
166
|
trackingParams?: ScreenTrackingParams;
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
+
/**
|
|
170
|
+
* Scroll distance (px) over which the animated search header collapses from its
|
|
171
|
+
* expanded to its docked state — the input range consumed by `HeaderExtendHeader`
|
|
172
|
+
* and the settle threshold in `handleScrollEnd`.
|
|
173
|
+
*/
|
|
174
|
+
const SEARCH_HEADER_COLLAPSE_DISTANCE = 100;
|
|
175
|
+
|
|
169
176
|
const Screen = forwardRef(
|
|
170
177
|
(
|
|
171
178
|
{
|
|
@@ -195,7 +202,7 @@ const Screen = forwardRef(
|
|
|
195
202
|
ref: any,
|
|
196
203
|
) => {
|
|
197
204
|
const screenRef = useRef<View | ScrollView>(null);
|
|
198
|
-
const { width: widthDevice } = useWindowDimensions();
|
|
205
|
+
const { width: widthDevice, height: heightDevice } = useWindowDimensions();
|
|
199
206
|
const { theme } = useContext(ApplicationContext);
|
|
200
207
|
const screen: any = useContext(ScreenContext);
|
|
201
208
|
const insets = useSafeAreaInsets();
|
|
@@ -656,6 +663,17 @@ const Screen = forwardRef(
|
|
|
656
663
|
]}
|
|
657
664
|
contentContainerStyle={[
|
|
658
665
|
scrollable && !Footer && !isTab && { paddingBottom: bottomInset },
|
|
666
|
+
// The animated search header collapses as the body scrolls. When the
|
|
667
|
+
// body is short (e.g. no search history) the ScrollView is barely
|
|
668
|
+
// scrollable, so overscroll bounce feeds the scroll-driven animation
|
|
669
|
+
// and the input jitters on its way up to the header. A ScrollView
|
|
670
|
+
// frame can never exceed the window, so forcing the content to be at
|
|
671
|
+
// least one screen plus the collapse distance guarantees the animation
|
|
672
|
+
// always has room to complete smoothly, independent of body content.
|
|
673
|
+
scrollable &&
|
|
674
|
+
inputSearchProps && {
|
|
675
|
+
minHeight: heightDevice + SEARCH_HEADER_COLLAPSE_DISTANCE,
|
|
676
|
+
},
|
|
659
677
|
scrollViewProps?.contentContainerStyle,
|
|
660
678
|
]}
|
|
661
679
|
>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@momo-kits/foundation",
|
|
3
|
-
"version": "0.162.2-beta.
|
|
3
|
+
"version": "0.162.2-beta.20",
|
|
4
4
|
"description": "React Native Component Kits",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"scripts": {},
|
|
@@ -8,19 +8,19 @@
|
|
|
8
8
|
"@momo-kits/foundation"
|
|
9
9
|
],
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"react-native-fast-image": "git+https://oauth2:TGi6oBj-LdzsKpLXQSoH@gitlab.mservice.com.vn/momo-platform/public/react-native-fast-image.git#v8.11.0",
|
|
12
11
|
"@react-navigation/bottom-tabs": "7.4.2",
|
|
13
12
|
"@react-navigation/core": "7.12.1",
|
|
14
13
|
"@react-navigation/elements": "2.5.2",
|
|
15
14
|
"@react-navigation/native": "7.1.14",
|
|
16
15
|
"@react-navigation/routers": "7.4.1",
|
|
17
16
|
"@react-navigation/stack": "7.4.2",
|
|
17
|
+
"@shopify/flash-list": "2.1.0",
|
|
18
|
+
"lottie-react-native": "7.2.4",
|
|
19
|
+
"react-native-fast-image": "git+https://oauth2:TGi6oBj-LdzsKpLXQSoH@gitlab.mservice.com.vn/momo-platform/public/react-native-fast-image.git#v8.11.0",
|
|
18
20
|
"react-native-gesture-handler": "2.27.1",
|
|
19
21
|
"react-native-linear-gradient": "git+https://oauth2:TGi6oBj-LdzsKpLXQSoH@gitlab.mservice.com.vn/momo-platform/public/react-native-linear-gradient#v3.0.0",
|
|
20
22
|
"react-native-reanimated": "4.2.2",
|
|
21
|
-
"react-native-safe-area-context": "5.5.2"
|
|
22
|
-
"@shopify/flash-list": "2.1.0",
|
|
23
|
-
"lottie-react-native": "7.2.4"
|
|
23
|
+
"react-native-safe-area-context": "5.5.2"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"react-native": "*"
|
|
@@ -32,4 +32,4 @@
|
|
|
32
32
|
"registry": "https://registry.npmjs.org/"
|
|
33
33
|
},
|
|
34
34
|
"license": "MoMo"
|
|
35
|
-
}
|
|
35
|
+
}
|