@whatmore-repo/whatmore-reactnative-sdk 1.0.28 → 1.0.29

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.28",
3
+ "version": "1.0.29",
4
4
  "description": "",
5
5
  "private": false,
6
6
  "main": "index.js",
@@ -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
  }
@@ -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