@whatmore-repo/whatmore-reactnative-sdk 1.0.27 → 1.0.28
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/index.js
CHANGED
|
@@ -24,7 +24,7 @@ export function WhatmoreBase(props){
|
|
|
24
24
|
// );
|
|
25
25
|
|
|
26
26
|
return (
|
|
27
|
-
<WhatmoreRootComponent shopId={props.shopId} onAction={props.onAction} />
|
|
27
|
+
<WhatmoreRootComponent shopId={props.shopId} onAction={props.onAction} customStyles={props.customStyles} />
|
|
28
28
|
);
|
|
29
29
|
}
|
|
30
30
|
|
package/package.json
CHANGED
|
@@ -89,7 +89,7 @@ export default function WhatmoreRootComponent(props) {
|
|
|
89
89
|
|
|
90
90
|
return (
|
|
91
91
|
<>
|
|
92
|
-
{isInstaReelView.includes(brandId) && <EventTileWithProduct isModalOpen={isModalOpen} setIsModalOpen={setIsModalOpen} events={data} setInitialEventIndex={setInitialEventIndex} />}
|
|
92
|
+
{isInstaReelView.includes(brandId) && <EventTileWithProduct customStyles={props.customStyles} isModalOpen={isModalOpen} setIsModalOpen={setIsModalOpen} events={data} setInitialEventIndex={setInitialEventIndex} />}
|
|
93
93
|
{(isModalOpen) && <EventClickComponent isModalOpen={isModalOpen} setIsModalOpen={setIsModalOpen} events={data} initialEventIndex={initialEventIndex} onAction={props.onAction} /> }
|
|
94
94
|
</>
|
|
95
95
|
);
|
|
@@ -10,18 +10,20 @@ export default function EventTileWithProduct(props) {
|
|
|
10
10
|
const [activeIndex, setActiveIndex] = useState(1);
|
|
11
11
|
const [renderedEvents, setRenderedEvents] = useState(5)
|
|
12
12
|
const { width } = Dimensions.get('window');
|
|
13
|
+
const customStyles = props.customStyles;
|
|
13
14
|
const ITEM_WIDTH = width * 0.33;
|
|
14
|
-
const CARD_HEIGHT =
|
|
15
|
+
const CARD_HEIGHT = 40*(customStyles?.videoTileSize ?? 5);
|
|
15
16
|
|
|
16
17
|
const styles = StyleSheet.create({
|
|
17
18
|
container: {
|
|
18
19
|
position: 'relative',
|
|
19
20
|
width: '100%',
|
|
20
|
-
height:
|
|
21
|
+
height: CARD_HEIGHT + 50,
|
|
21
22
|
},
|
|
22
23
|
arrowContainerRight: {
|
|
23
24
|
position: 'absolute',
|
|
24
|
-
top:
|
|
25
|
+
top: '50%',
|
|
26
|
+
transform: [{ translateY: -30 }],
|
|
25
27
|
right: 0,
|
|
26
28
|
width: 28,
|
|
27
29
|
height: 28,
|
|
@@ -29,7 +31,8 @@ export default function EventTileWithProduct(props) {
|
|
|
29
31
|
},
|
|
30
32
|
arrowContainerLeft: {
|
|
31
33
|
position: 'absolute',
|
|
32
|
-
top:
|
|
34
|
+
top: '50%',
|
|
35
|
+
transform: [{ translateY: -30 }],
|
|
33
36
|
width: 28,
|
|
34
37
|
height: 28,
|
|
35
38
|
marginHorizontal: 5,
|
|
@@ -40,7 +43,7 @@ export default function EventTileWithProduct(props) {
|
|
|
40
43
|
setInitialEventIndex(index);
|
|
41
44
|
setIsModalOpen(true);
|
|
42
45
|
};
|
|
43
|
-
|
|
46
|
+
|
|
44
47
|
const { events, isModalOpen, setInitialEventIndex, setIsModalOpen } = props;
|
|
45
48
|
// const [pausedVideos, setPausedVideos] = useState({});
|
|
46
49
|
// const handleVideoLoad = (index) => {
|
|
@@ -96,7 +99,7 @@ export default function EventTileWithProduct(props) {
|
|
|
96
99
|
transform: [{ scale: 1.1 }],
|
|
97
100
|
width: ITEM_WIDTH,
|
|
98
101
|
height: CARD_HEIGHT,
|
|
99
|
-
marginHorizontal:
|
|
102
|
+
marginHorizontal: 5*(customStyles?.videoTileSpacing ?? 3),
|
|
100
103
|
top: 20,
|
|
101
104
|
// elevation: 1
|
|
102
105
|
}}
|
|
@@ -110,7 +113,6 @@ export default function EventTileWithProduct(props) {
|
|
|
110
113
|
<SafeAreaView style={styles.container}>
|
|
111
114
|
<Animated.FlatList
|
|
112
115
|
horizontal
|
|
113
|
-
style={{paddingLeft: 10}}
|
|
114
116
|
data={events.slice(0,renderedEvents)}
|
|
115
117
|
renderItem={renderItem}
|
|
116
118
|
contentInsetAdjustmentBehavior="never"
|
|
@@ -124,7 +126,7 @@ export default function EventTileWithProduct(props) {
|
|
|
124
126
|
<TouchableOpacity style={styles.arrowContainerLeft} onPress={scrollLeft}>
|
|
125
127
|
<ChevronLeftIcon />
|
|
126
128
|
</TouchableOpacity>
|
|
127
|
-
|
|
129
|
+
<TouchableOpacity style={styles.arrowContainerRight} onPress={scrollRight}>
|
|
128
130
|
<ChevronRightIcon />
|
|
129
131
|
</TouchableOpacity>
|
|
130
132
|
</SafeAreaView>
|