@applicaster/zapp-react-native-ui-components 13.0.0-rc.119 → 13.0.0-rc.120

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.
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import * as R from "ramda";
3
- import { View, StyleSheet, Platform, FlatList } from "react-native";
3
+ import { View, StyleSheet, FlatList } from "react-native";
4
4
  import { useTheme } from "@applicaster/zapp-react-native-utils/theme";
5
5
  import { RiverItem } from "../RiverItem";
6
6
  import { RiverFooter } from "../RiverFooter";
@@ -24,6 +24,10 @@ import { withComponentsMapProvider } from "@applicaster/zapp-react-native-ui-com
24
24
  import { useScreenContextV2 } from "@applicaster/zapp-react-native-utils/reactHooks/screen/useScreenContext";
25
25
  import { useShallow } from "zustand/react/shallow";
26
26
 
27
+ import { isAndroidPlatform } from "@applicaster/zapp-react-native-utils/reactUtils";
28
+
29
+ const isAndroid = isAndroidPlatform();
30
+
27
31
  type Props = {
28
32
  feed: ZappFeed;
29
33
  groupId?: string;
@@ -273,12 +277,12 @@ function ComponentsMapComponent(props: Props) {
273
277
  }}
274
278
  // Fix for WebView rerender crashes on Android API 28+
275
279
  // https://github.com/react-native-webview/react-native-webview/issues/1915#issuecomment-964035468
276
- overScrollMode={Platform.OS === "android" ? "never" : "auto"}
280
+ overScrollMode={isAndroid ? "never" : "auto"}
277
281
  scrollIndicatorInsets={scrollIndicatorInsets}
278
282
  extraData={feed}
279
283
  stickyHeaderIndices={stickyHeaderIndices}
280
284
  onLayout={handleOnLayout}
281
- removeClippedSubviews
285
+ removeClippedSubviews={isAndroid}
282
286
  initialNumToRender={3}
283
287
  maxToRenderPerBatch={10}
284
288
  windowSize={12}
@@ -299,6 +303,10 @@ function ComponentsMapComponent(props: Props) {
299
303
  onMomentumScrollEnd={_onMomentumScrollEnd}
300
304
  onScrollEndDrag={_onScrollEndDrag}
301
305
  scrollEventThrottle={16}
306
+ maintainVisibleContentPosition={{
307
+ minIndexForVisible: 0,
308
+ autoscrollToTopThreshold: 10,
309
+ }}
302
310
  {...scrollViewExtraProps}
303
311
  />
304
312
  </ViewportTracker>
@@ -48,16 +48,20 @@ const useLoadingState = (
48
48
  loadingState: RiverItemType["loadingState"]
49
49
  ) => {
50
50
  const [readyToBeDisplayed, setReadyToBeDisplayed] = React.useState(
51
- loadingState.getValue().index + 1 === currentIndex
51
+ loadingState.getValue().index + 1 >= currentIndex
52
52
  );
53
53
 
54
54
  useEffect(() => {
55
55
  const subscription = loadingState.subscribe(({ index }) => {
56
- if (index + 1 === currentIndex) {
56
+ if (index + 1 >= currentIndex) {
57
57
  setReadyToBeDisplayed(true);
58
58
  }
59
59
  });
60
60
 
61
+ if (loadingState.getValue().index + 1 >= currentIndex) {
62
+ setReadyToBeDisplayed(true);
63
+ }
64
+
61
65
  return () => {
62
66
  subscription.unsubscribe();
63
67
  };
@@ -135,6 +135,12 @@ exports[`componentsMap renders renders components map correctly 1`] = `
135
135
  getItemCount={[Function]}
136
136
  initialNumToRender={3}
137
137
  keyExtractor={[Function]}
138
+ maintainVisibleContentPosition={
139
+ {
140
+ "autoscrollToTopThreshold": 10,
141
+ "minIndexForVisible": 0,
142
+ }
143
+ }
138
144
  maxToRenderPerBatch={10}
139
145
  onContentSizeChange={[Function]}
140
146
  onLayout={[Function]}
@@ -145,7 +151,7 @@ exports[`componentsMap renders renders components map correctly 1`] = `
145
151
  onScrollEndDrag={[Function]}
146
152
  overScrollMode="auto"
147
153
  refreshControl={null}
148
- removeClippedSubviews={true}
154
+ removeClippedSubviews={false}
149
155
  renderItem={[Function]}
150
156
  scrollEventThrottle={16}
151
157
  scrollIndicatorInsets={
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-ui-components",
3
- "version": "13.0.0-rc.119",
3
+ "version": "13.0.0-rc.120",
4
4
  "description": "Applicaster Zapp React Native ui components for the Quick Brick App",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -31,10 +31,10 @@
31
31
  "redux-mock-store": "^1.5.3"
32
32
  },
33
33
  "dependencies": {
34
- "@applicaster/applicaster-types": "13.0.0-rc.119",
35
- "@applicaster/zapp-react-native-bridge": "13.0.0-rc.119",
36
- "@applicaster/zapp-react-native-redux": "13.0.0-rc.119",
37
- "@applicaster/zapp-react-native-utils": "13.0.0-rc.119",
34
+ "@applicaster/applicaster-types": "13.0.0-rc.120",
35
+ "@applicaster/zapp-react-native-bridge": "13.0.0-rc.120",
36
+ "@applicaster/zapp-react-native-redux": "13.0.0-rc.120",
37
+ "@applicaster/zapp-react-native-utils": "13.0.0-rc.120",
38
38
  "promise": "^8.3.0",
39
39
  "react-router-native": "^5.1.2",
40
40
  "url": "^0.11.0",