@whatmore-repo/whatmore-reactnative-sdk 1.0.28 → 1.0.30
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
|
@@ -13,7 +13,7 @@ function handleClick(product, props){
|
|
|
13
13
|
})
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
export async function navigateToProductPage(product, brandDomainContext, whatmoreShopId, props) {
|
|
16
|
+
export async function navigateToProductPage(product, brandDomainContext, whatmoreShopId, props, navigation) {
|
|
17
17
|
const _ACTIVATE_MOCK_ = getGlobalState("activateMock");
|
|
18
18
|
if (_ACTIVATE_MOCK_) {
|
|
19
19
|
return Promise.resolve(true);
|
|
@@ -26,6 +26,14 @@ export async function navigateToProductPage(product, brandDomainContext, whatmor
|
|
|
26
26
|
if(isAppMaker(brandDomainContext)){
|
|
27
27
|
return handleClick(product, props);
|
|
28
28
|
}
|
|
29
|
-
|
|
29
|
+
else {
|
|
30
|
+
const parts = product?.product_link?.split('/');
|
|
31
|
+
const sku = parts?.[parts?.length - 1];
|
|
32
|
+
navigation.navigate(
|
|
33
|
+
'ProductDetail',
|
|
34
|
+
{url: sku}
|
|
35
|
+
)
|
|
36
|
+
props.setIsModalOpen(false);
|
|
37
|
+
}
|
|
30
38
|
return Promise.resolve(false);
|
|
31
39
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import AppVideoPlayer from './video-player/AppVideoPlayer.js'
|
|
2
|
+
import { Modal, View } from "react-native";
|
|
4
3
|
import Swiper from 'react-native-swiper'
|
|
5
|
-
import { InView } from 'react-native-intersection-observer'
|
|
6
4
|
import EventShoppingView from './EventShoppingView.js';
|
|
7
5
|
import { setGlobalState } from '../globals/useAppState_APP.js';
|
|
8
6
|
|
|
@@ -18,6 +16,7 @@ export default function EventsVerticalSwipeView(props) {
|
|
|
18
16
|
animationType="slide"
|
|
19
17
|
transparent={false}
|
|
20
18
|
visible={props.isModalOpen}
|
|
19
|
+
onRequestClose={()=>props.setIsModalOpen(false)}
|
|
21
20
|
>
|
|
22
21
|
<Swiper
|
|
23
22
|
style={{}}
|
|
@@ -34,8 +34,7 @@ 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
|
|
38
|
-
const [isModalOpen, setIsModalOpen] = useState(!isInstaReelView.includes(brandId));
|
|
37
|
+
const [isModalOpen, setIsModalOpen] = useState(false);
|
|
39
38
|
const [initialEventIndex, setInitialEventIndex] = useState(0)
|
|
40
39
|
|
|
41
40
|
var eventStatuses = "live,upcoming";
|
|
@@ -89,7 +88,7 @@ export default function WhatmoreRootComponent(props) {
|
|
|
89
88
|
|
|
90
89
|
return (
|
|
91
90
|
<>
|
|
92
|
-
{
|
|
91
|
+
{<EventTileWithProduct customStyles={props.customStyles} isModalOpen={isModalOpen} setIsModalOpen={setIsModalOpen} events={data} setInitialEventIndex={setInitialEventIndex} />}
|
|
93
92
|
{(isModalOpen) && <EventClickComponent isModalOpen={isModalOpen} setIsModalOpen={setIsModalOpen} events={data} initialEventIndex={initialEventIndex} onAction={props.onAction} /> }
|
|
94
93
|
</>
|
|
95
94
|
);
|
|
@@ -8,8 +8,10 @@ import useAddToCartStates from '../../hooks/useAddToCartStates.js';
|
|
|
8
8
|
import * as Animatable from 'react-native-animatable';
|
|
9
9
|
import ShopNow from '../cta-buttons/ShopNowButton.jsx';
|
|
10
10
|
import { navigateToProductPage } from '../../api/navigation-commands/NavigationCommands.js';
|
|
11
|
+
import { useNavigation } from '@react-navigation/native';
|
|
11
12
|
|
|
12
13
|
export default function ProductTileV1(props) {
|
|
14
|
+
const navigation = useNavigation();
|
|
13
15
|
const event = props.event;
|
|
14
16
|
const product = props.product;
|
|
15
17
|
const [tileTapAnimate, setTileTapAnimate] = useState(false);
|
|
@@ -31,7 +33,7 @@ export default function ProductTileV1(props) {
|
|
|
31
33
|
<TouchableWithoutFeedback
|
|
32
34
|
onPress={() => {
|
|
33
35
|
setTileTapAnimate(true);
|
|
34
|
-
navigateToProductPage(product, brandDomainContext, whatmoreShopId, props);
|
|
36
|
+
navigateToProductPage(product, brandDomainContext, whatmoreShopId, props, navigation);
|
|
35
37
|
}}
|
|
36
38
|
>
|
|
37
39
|
<Animatable.View
|