@applicaster/zapp-react-native-ui-components 13.0.0-alpha.3003916059 → 13.0.0-alpha.3013095924
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/Components/AudioPlayer/AudioPlayerLayout.tsx +7 -6
- package/Components/ModalComponent/BottomSheetModalContent.tsx +22 -26
- package/Components/River/ComponentsMap/ComponentsMap.tsx +3 -11
- package/Components/River/RiverItem.tsx +2 -6
- package/Components/River/__tests__/__snapshots__/componentsMap.test.js.snap +1 -7
- package/Components/VideoModal/ModalAnimation/ModalAnimationContext.tsx +0 -1
- package/package.json +5 -5
|
@@ -32,7 +32,7 @@ export function AudioPlayerLayout({ artwork, config, children, style }: Props) {
|
|
|
32
32
|
|
|
33
33
|
const { isRTL, backgroundColor, backgroundImage } = config;
|
|
34
34
|
|
|
35
|
-
const
|
|
35
|
+
const backgroundImg = { uri: backgroundImage };
|
|
36
36
|
|
|
37
37
|
const backgroundColorStyle = backgroundImage
|
|
38
38
|
? "transparent"
|
|
@@ -103,8 +103,9 @@ export function AudioPlayerLayout({ artwork, config, children, style }: Props) {
|
|
|
103
103
|
justifyContent: "center",
|
|
104
104
|
},
|
|
105
105
|
android_tv: {
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
position: "absolute",
|
|
107
|
+
width: 1920,
|
|
108
|
+
height: 1080,
|
|
108
109
|
alignItems: "center",
|
|
109
110
|
justifyContent: "center",
|
|
110
111
|
},
|
|
@@ -145,9 +146,9 @@ export function AudioPlayerLayout({ artwork, config, children, style }: Props) {
|
|
|
145
146
|
},
|
|
146
147
|
});
|
|
147
148
|
|
|
148
|
-
const audioPlayerLayoutTV =
|
|
149
|
+
const audioPlayerLayoutTV = backgroundImg?.uri ? (
|
|
149
150
|
<ImageBackground
|
|
150
|
-
source={
|
|
151
|
+
source={backgroundImg}
|
|
151
152
|
style={backgroundImgStyles}
|
|
152
153
|
resizeMode="cover"
|
|
153
154
|
>
|
|
@@ -177,7 +178,7 @@ export function AudioPlayerLayout({ artwork, config, children, style }: Props) {
|
|
|
177
178
|
]}
|
|
178
179
|
>
|
|
179
180
|
<ImageBackground
|
|
180
|
-
source={
|
|
181
|
+
source={backgroundImg}
|
|
181
182
|
style={backgroundImgStyles}
|
|
182
183
|
resizeMode="cover"
|
|
183
184
|
>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useMemo, useRef } from "react";
|
|
2
|
-
import { View, ScrollView } from "react-native";
|
|
2
|
+
import { View, ScrollView, Platform } from "react-native";
|
|
3
3
|
import { Button } from "./Button";
|
|
4
4
|
import { ItemIconProps } from "./Button/ItemIcon";
|
|
5
5
|
import { ItemProps } from "./Button/Item";
|
|
@@ -9,7 +9,7 @@ import { useTheme } from "@applicaster/zapp-react-native-utils/theme";
|
|
|
9
9
|
|
|
10
10
|
import type { PluginConfiguration } from "./";
|
|
11
11
|
|
|
12
|
-
import { ModalHeader
|
|
12
|
+
import { ModalHeader } from "./Header";
|
|
13
13
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
14
14
|
|
|
15
15
|
type ModalComponentProps = {
|
|
@@ -22,7 +22,6 @@ type ModalComponentProps = {
|
|
|
22
22
|
title?: string;
|
|
23
23
|
maxHeight?: number;
|
|
24
24
|
dismiss: () => void;
|
|
25
|
-
headerComponent?: React.ComponentType;
|
|
26
25
|
buttonComponent?: React.ComponentType;
|
|
27
26
|
iconProps?: ItemIconProps | ((theme: PluginConfiguration) => ItemIconProps);
|
|
28
27
|
itemProps?:
|
|
@@ -49,11 +48,9 @@ export function BottomSheetModalContent(props: ModalComponentProps) {
|
|
|
49
48
|
dismiss,
|
|
50
49
|
summary,
|
|
51
50
|
title,
|
|
52
|
-
headerComponent: ModalHeader = DefaultModalHeader,
|
|
53
51
|
buttonComponent: ButtonComponent = Button,
|
|
54
|
-
getSelectedItemIcon = (
|
|
55
|
-
modal_bottom_sheet_item_selected_icon,
|
|
56
|
-
}: BaseThemePropertiesMobile) => modal_bottom_sheet_item_selected_icon,
|
|
52
|
+
getSelectedItemIcon = (theme) =>
|
|
53
|
+
theme.modal_bottom_sheet_item_selected_icon,
|
|
57
54
|
getDefaultItemIcon = () => null,
|
|
58
55
|
iconPlacement,
|
|
59
56
|
} = props;
|
|
@@ -106,27 +103,26 @@ export function BottomSheetModalContent(props: ModalComponentProps) {
|
|
|
106
103
|
/>
|
|
107
104
|
<ScrollView
|
|
108
105
|
contentContainerStyle={{
|
|
109
|
-
paddingBottom:
|
|
106
|
+
paddingBottom:
|
|
107
|
+
paddingBottom + (Platform.OS === "ios" ? bottomInset : 0),
|
|
110
108
|
}}
|
|
111
109
|
>
|
|
112
|
-
{items.map((item, index) =>
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
) : null
|
|
129
|
-
)}
|
|
110
|
+
{items.map((item, index) => (
|
|
111
|
+
<ButtonComponent
|
|
112
|
+
key={index}
|
|
113
|
+
configuration={theme}
|
|
114
|
+
selectedItem={current_selection}
|
|
115
|
+
item={item}
|
|
116
|
+
onPress={handlePress}
|
|
117
|
+
label={theme[item?.label] ?? item?.label}
|
|
118
|
+
iconBaseProps={iconBaseProps}
|
|
119
|
+
itemBaseProps={itemBaseProps}
|
|
120
|
+
labelBaseProps={labelBaseProps}
|
|
121
|
+
selectedItemIcon={getSelectedItemIcon(theme)}
|
|
122
|
+
defaultItemIcon={getDefaultItemIcon(theme)}
|
|
123
|
+
iconPlacement={iconPlacement}
|
|
124
|
+
/>
|
|
125
|
+
))}
|
|
130
126
|
</ScrollView>
|
|
131
127
|
</View>
|
|
132
128
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import * as R from "ramda";
|
|
3
|
-
import { View, StyleSheet, FlatList } from "react-native";
|
|
3
|
+
import { View, StyleSheet, Platform, 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,10 +24,6 @@ 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
|
-
|
|
31
27
|
type Props = {
|
|
32
28
|
feed: ZappFeed;
|
|
33
29
|
groupId?: string;
|
|
@@ -277,12 +273,12 @@ function ComponentsMapComponent(props: Props) {
|
|
|
277
273
|
}}
|
|
278
274
|
// Fix for WebView rerender crashes on Android API 28+
|
|
279
275
|
// https://github.com/react-native-webview/react-native-webview/issues/1915#issuecomment-964035468
|
|
280
|
-
overScrollMode={
|
|
276
|
+
overScrollMode={Platform.OS === "android" ? "never" : "auto"}
|
|
281
277
|
scrollIndicatorInsets={scrollIndicatorInsets}
|
|
282
278
|
extraData={feed}
|
|
283
279
|
stickyHeaderIndices={stickyHeaderIndices}
|
|
284
280
|
onLayout={handleOnLayout}
|
|
285
|
-
removeClippedSubviews
|
|
281
|
+
removeClippedSubviews
|
|
286
282
|
initialNumToRender={3}
|
|
287
283
|
maxToRenderPerBatch={10}
|
|
288
284
|
windowSize={12}
|
|
@@ -303,10 +299,6 @@ function ComponentsMapComponent(props: Props) {
|
|
|
303
299
|
onMomentumScrollEnd={_onMomentumScrollEnd}
|
|
304
300
|
onScrollEndDrag={_onScrollEndDrag}
|
|
305
301
|
scrollEventThrottle={16}
|
|
306
|
-
maintainVisibleContentPosition={{
|
|
307
|
-
minIndexForVisible: 0,
|
|
308
|
-
autoscrollToTopThreshold: 10,
|
|
309
|
-
}}
|
|
310
302
|
{...scrollViewExtraProps}
|
|
311
303
|
/>
|
|
312
304
|
</ViewportTracker>
|
|
@@ -48,20 +48,16 @@ const useLoadingState = (
|
|
|
48
48
|
loadingState: RiverItemType["loadingState"]
|
|
49
49
|
) => {
|
|
50
50
|
const [readyToBeDisplayed, setReadyToBeDisplayed] = React.useState(
|
|
51
|
-
loadingState.getValue().index + 1
|
|
51
|
+
loadingState.getValue().index + 1 === currentIndex
|
|
52
52
|
);
|
|
53
53
|
|
|
54
54
|
useEffect(() => {
|
|
55
55
|
const subscription = loadingState.subscribe(({ index }) => {
|
|
56
|
-
if (index + 1
|
|
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
|
-
|
|
65
61
|
return () => {
|
|
66
62
|
subscription.unsubscribe();
|
|
67
63
|
};
|
|
@@ -135,12 +135,6 @@ 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
|
-
}
|
|
144
138
|
maxToRenderPerBatch={10}
|
|
145
139
|
onContentSizeChange={[Function]}
|
|
146
140
|
onLayout={[Function]}
|
|
@@ -151,7 +145,7 @@ exports[`componentsMap renders renders components map correctly 1`] = `
|
|
|
151
145
|
onScrollEndDrag={[Function]}
|
|
152
146
|
overScrollMode="auto"
|
|
153
147
|
refreshControl={null}
|
|
154
|
-
removeClippedSubviews={
|
|
148
|
+
removeClippedSubviews={true}
|
|
155
149
|
renderItem={[Function]}
|
|
156
150
|
scrollEventThrottle={16}
|
|
157
151
|
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-alpha.
|
|
3
|
+
"version": "13.0.0-alpha.3013095924",
|
|
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-alpha.
|
|
35
|
-
"@applicaster/zapp-react-native-bridge": "13.0.0-alpha.
|
|
36
|
-
"@applicaster/zapp-react-native-redux": "13.0.0-alpha.
|
|
37
|
-
"@applicaster/zapp-react-native-utils": "13.0.0-alpha.
|
|
34
|
+
"@applicaster/applicaster-types": "13.0.0-alpha.3013095924",
|
|
35
|
+
"@applicaster/zapp-react-native-bridge": "13.0.0-alpha.3013095924",
|
|
36
|
+
"@applicaster/zapp-react-native-redux": "13.0.0-alpha.3013095924",
|
|
37
|
+
"@applicaster/zapp-react-native-utils": "13.0.0-alpha.3013095924",
|
|
38
38
|
"promise": "^8.3.0",
|
|
39
39
|
"react-router-native": "^5.1.2",
|
|
40
40
|
"url": "^0.11.0",
|