@whatmore-repo/whatmore-reactnative-sdk 1.0.26 → 1.0.27
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@whatmore-repo/whatmore-reactnative-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.27",
|
|
4
4
|
"description": "",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "index.js",
|
|
@@ -14,8 +14,7 @@
|
|
|
14
14
|
"currency-symbol-map": "^5.1.0",
|
|
15
15
|
"react-hooks-global-state": "^2.1.0",
|
|
16
16
|
"react-native-animatable": "^1.3.3",
|
|
17
|
-
"react-native-intersection-observer": "^0.0.9"
|
|
18
|
-
"react-native-snap-carousel": "^3.9.1"
|
|
17
|
+
"react-native-intersection-observer": "^0.0.9"
|
|
19
18
|
},
|
|
20
19
|
"devDependencies": {
|
|
21
20
|
"@babel/core": "^7.20.0"
|
|
@@ -34,7 +34,8 @@ export default function WhatmoreRootComponent(props) {
|
|
|
34
34
|
var brandId = props.shopId;
|
|
35
35
|
const [data, setData] = useState();
|
|
36
36
|
const [error, setError] = useState();
|
|
37
|
-
const [
|
|
37
|
+
const isInstaReelView = ["27358003275", "STR60LW4WMA"];
|
|
38
|
+
const [isModalOpen, setIsModalOpen] = useState(!isInstaReelView.includes(brandId));
|
|
38
39
|
const [initialEventIndex, setInitialEventIndex] = useState(0)
|
|
39
40
|
|
|
40
41
|
var eventStatuses = "live,upcoming";
|
|
@@ -88,8 +89,8 @@ export default function WhatmoreRootComponent(props) {
|
|
|
88
89
|
|
|
89
90
|
return (
|
|
90
91
|
<>
|
|
91
|
-
{brandId
|
|
92
|
-
{(isModalOpen
|
|
92
|
+
{isInstaReelView.includes(brandId) && <EventTileWithProduct isModalOpen={isModalOpen} setIsModalOpen={setIsModalOpen} events={data} setInitialEventIndex={setInitialEventIndex} />}
|
|
93
|
+
{(isModalOpen) && <EventClickComponent isModalOpen={isModalOpen} setIsModalOpen={setIsModalOpen} events={data} initialEventIndex={initialEventIndex} onAction={props.onAction} /> }
|
|
93
94
|
</>
|
|
94
95
|
);
|
|
95
96
|
}
|
|
@@ -4,6 +4,7 @@ import Video from 'react-native-video';
|
|
|
4
4
|
import { useState, useRef } from 'react';
|
|
5
5
|
import ChevronRightIcon from '../../icons/icon-components/ChevronRight';
|
|
6
6
|
import ChevronLeftIcon from '../../icons/icon-components/ChevronLeft';
|
|
7
|
+
import { getGlobalState } from '../../globals/useAppState_APP';
|
|
7
8
|
|
|
8
9
|
export default function EventTileWithProduct(props) {
|
|
9
10
|
const [activeIndex, setActiveIndex] = useState(1);
|
|
@@ -18,12 +19,6 @@ export default function EventTileWithProduct(props) {
|
|
|
18
19
|
width: '100%',
|
|
19
20
|
height: 250,
|
|
20
21
|
},
|
|
21
|
-
cardContainer: {
|
|
22
|
-
width: ITEM_WIDTH,
|
|
23
|
-
height: CARD_HEIGHT,
|
|
24
|
-
marginHorizontal: 8,
|
|
25
|
-
top: 20,
|
|
26
|
-
},
|
|
27
22
|
arrowContainerRight: {
|
|
28
23
|
position: 'absolute',
|
|
29
24
|
top: 90,
|
|
@@ -85,7 +80,6 @@ export default function EventTileWithProduct(props) {
|
|
|
85
80
|
const renderItem = ({ item, index }) => {
|
|
86
81
|
return (
|
|
87
82
|
<TouchableOpacity onPress={() => handleClick(index)} key={index}>
|
|
88
|
-
<Animated.View style={[styles.cardContainer]}>
|
|
89
83
|
<Video
|
|
90
84
|
ref={videoRef}
|
|
91
85
|
source={{ uri: item?.thumbnail_image }}
|
|
@@ -98,20 +92,20 @@ export default function EventTileWithProduct(props) {
|
|
|
98
92
|
|
|
99
93
|
style={{
|
|
100
94
|
aspectRatio: 0.5625,
|
|
101
|
-
width: "100%",
|
|
102
|
-
height: '100%',
|
|
103
95
|
borderRadius: 10,
|
|
104
96
|
transform: [{ scale: 1.1 }],
|
|
97
|
+
width: ITEM_WIDTH,
|
|
98
|
+
height: CARD_HEIGHT,
|
|
99
|
+
marginHorizontal: 8,
|
|
100
|
+
top: 20,
|
|
105
101
|
// elevation: 1
|
|
106
|
-
|
|
107
102
|
}}
|
|
108
103
|
/>
|
|
109
|
-
</Animated.View>
|
|
110
104
|
</TouchableOpacity>
|
|
111
105
|
);
|
|
112
106
|
};
|
|
113
107
|
const flatListRef = useRef(null);
|
|
114
|
-
|
|
108
|
+
const brandDomainContext = getGlobalState('brandDomainContext')
|
|
115
109
|
return (
|
|
116
110
|
<SafeAreaView style={styles.container}>
|
|
117
111
|
<Animated.FlatList
|
|
@@ -121,7 +115,7 @@ export default function EventTileWithProduct(props) {
|
|
|
121
115
|
renderItem={renderItem}
|
|
122
116
|
contentInsetAdjustmentBehavior="never"
|
|
123
117
|
decelerationRate="fast"
|
|
124
|
-
scrollEnabled={
|
|
118
|
+
scrollEnabled={brandDomainContext != "appmaker"}
|
|
125
119
|
automaticallyAdjustContentInsets={false}
|
|
126
120
|
showsHorizontalScrollIndicator={false}
|
|
127
121
|
scrollEventThrottle={16}
|
|
@@ -142,4 +136,8 @@ export default function EventTileWithProduct(props) {
|
|
|
142
136
|
// const index = Math.round((offsetX + ITEM_WIDTH)/ ITEM_WIDTH);
|
|
143
137
|
// setRenderedEvents(prev => prev + 1)
|
|
144
138
|
// setActiveIndex(index);
|
|
145
|
-
// };
|
|
139
|
+
// };
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
// "react-native-video": "github:freeboub/react-native-video#chore/fixAppBoot"
|