@whatmore-repo/whatmore-reactnative-sdk 1.0.35 → 1.0.37

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.35",
3
+ "version": "1.0.37",
4
4
  "description": "",
5
5
  "private": false,
6
6
  "main": "index.js",
@@ -4,6 +4,7 @@ import { getGlobalState, setGlobalState, useGlobalState } from '../globals/useAp
4
4
  import AppMuteUnmuteIcon from './commons/AppMuteUnmuteIcon.js';
5
5
  import ProductTileV1 from './product-tiles/ProductTileV1.js';
6
6
  import CrossIcon from '../icons/icon-components/CloseIcon.jsx';
7
+ import Swiper from 'react-native-swiper'
7
8
 
8
9
  export default function EventShoppingOverlay(props) {
9
10
  var event = props.event;
@@ -33,7 +34,6 @@ export default function EventShoppingOverlay(props) {
33
34
  <View
34
35
  style={{
35
36
  width: '100%',
36
- height: 'auto',
37
37
  flex: 1,
38
38
  flexDirection: 'column',
39
39
  justifyContent: 'space-between', alignItems: 'center', backgroundColor: 'transparent'
@@ -42,35 +42,32 @@ export default function EventShoppingOverlay(props) {
42
42
  <TouchableOpacity
43
43
  style={{
44
44
  width: '100%',
45
- height: 'auto',
46
- flex: 1,
47
- flexDirection: 'row',
48
- justifyContent: 'center', alignItems: 'center', backgroundColor: 'transparent'
45
+ flex: 1
49
46
  }}
50
47
  onPress={() => {
51
48
  setGlobalState("isAppMuted", getGlobalState("isAppMuted") ? false : true);
52
49
  }}
53
50
  >
54
51
  </TouchableOpacity>
55
- <View
56
- // add style here to make it horizontally scrollable
52
+ <View
57
53
  style={{
58
- width: '100%', height: 'auto',
59
- flexDirection: 'row', justifyContent: 'space-around', alignItems: 'center',
60
- paddingLeft: 10, paddingRight: 10, paddingBottom: 10
54
+ height: 180,
55
+ paddingLeft: 10,
56
+ paddingRight: 10,
57
+ paddingBottom: 10
61
58
  }}
62
- >
63
- {
64
- event.products.map((product, index) => {
65
- return (
66
- index == 0 && <ProductTileV1 setIsModalOpen={props.setIsModalOpen} key={index} onAction={props.onAction} event={event} product={product} />
67
- );
68
- })
69
- }
59
+ >
60
+ <Swiper
61
+ scrollViewProps={{
62
+ scrollEventThrottle: 1
63
+ }}
64
+ autoplay={true} autoplayTimeout={4} index={0} horizontal={true} loop={false} showsPagination={false} >
65
+ {event.products.map((product, index) => (
66
+ <ProductTileV1 setIsModalOpen={props.setIsModalOpen} key={index} onAction={props.onAction} event={event} product={product} />
67
+ ))}
68
+ </Swiper>
70
69
  </View>
71
70
  </View>
72
-
73
-
74
71
  </View>
75
72
  );
76
73
 
@@ -59,13 +59,13 @@ export default function ProductTileV1(props) {
59
59
  duration={100} iterationCount={1}
60
60
  easing="ease-out"
61
61
  style={{
62
- width: '90%', // Adjust width as needed, e.g., '80%'
62
+ width: '85%', // Adjust width as needed, e.g., '80%'
63
63
  alignSelf: 'center',
64
64
  height: 'auto',
65
65
  flexDirection: 'column', justifyContent: 'flex-start', alignItems: 'center',
66
66
  borderRadius: 5, overflow: 'hidden',
67
67
  shadowColor: 'black', shadowOpacity: 1, shadowOffset: {width: 0, height: 0},
68
- shadowRadius: 20, elevation: 10
68
+ shadowRadius: 20, elevation: 2
69
69
  }}
70
70
  >
71
71
  <View
@@ -133,7 +133,7 @@ export default function ProductTileV1(props) {
133
133
 
134
134
  <View style={{ flexDirection: 'row', width: '100%', justifyContent: 'center', alignItems: 'center'}}>
135
135
  <ShopNow
136
- height={PRODUCT_TILE_TOTAL_HEIGHT * 0.3}
136
+ height={PRODUCT_TILE_TOTAL_HEIGHT * 0.28}
137
137
  fontSize={BASE_FONT_SIZE}
138
138
  fontFamily={fontFamily}
139
139
  />
@@ -1,5 +1,6 @@
1
1
 
2
2
  import getSymbolFromCurrency from 'currency-symbol-map'
3
+ import { getGlobalState } from '../globals/useAppState_APP';
3
4
 
4
5
  function priceWithCommas(price){
5
6
  return price.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
@@ -23,6 +24,8 @@ export function getPriceStringWithCurrency(price, spaceString = "", currencyCode
23
24
  if(!price || typeof price == undefined){
24
25
  return "";
25
26
  }
27
+ const whatmoreShopId = getGlobalState('whatmoreShopId')
28
+ const finalCurrency = whatmoreShopId == "68234805419" ? "QAR": getSymbolFromCurrency(currencyCode ?? "INR")
26
29
 
27
- return getSymbolFromCurrency(currencyCode ?? "INR") + spaceString + priceWithCommas(roundedPrice(price));
30
+ return finalCurrency + spaceString + priceWithCommas(roundedPrice(price));
28
31
  }