ordering-ui-react-native 0.21.73 → 0.21.74-release

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.
Files changed (165) hide show
  1. package/package.json +6 -7
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/BusinessesListing/index.tsx +1 -1
  4. package/src/components/PaymentOptionsWebView/index.tsx +1 -0
  5. package/src/components/StripeMethodForm/index.tsx +6 -4
  6. package/src/components/VerifyPhone/styles.tsx +1 -2
  7. package/src/types/index.tsx +3 -1
  8. package/themes/business/index.tsx +4 -0
  9. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +9 -6
  10. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +1 -0
  11. package/themes/business/src/components/BusinessProductList/index.tsx +2 -1
  12. package/themes/business/src/components/Chat/index.tsx +3 -1
  13. package/themes/business/src/components/DriverMap/index.tsx +44 -27
  14. package/themes/business/src/components/GoogleMap/index.tsx +15 -8
  15. package/themes/business/src/components/Home/index.tsx +5 -1
  16. package/themes/business/src/components/LanguageSelector/index.tsx +2 -3
  17. package/themes/business/src/components/LanguageSelector/lang_country.json +515 -70
  18. package/themes/business/src/components/LogoutButton/index.tsx +1 -1
  19. package/themes/business/src/components/MapView/index.tsx +36 -17
  20. package/themes/business/src/components/NewOrderNotification/index.tsx +74 -24
  21. package/themes/business/src/components/OrderDetails/Business.tsx +65 -7
  22. package/themes/business/src/components/OrderDetails/Delivery.tsx +35 -20
  23. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +110 -40
  24. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +61 -35
  25. package/themes/business/src/components/OrderDetails/styles.tsx +39 -3
  26. package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +220 -0
  27. package/themes/business/src/components/OrderSummary/index.tsx +219 -71
  28. package/themes/business/src/components/OrdersListManager/index.tsx +9 -1
  29. package/themes/business/src/components/OrdersOption/index.tsx +250 -127
  30. package/themes/business/src/components/PhoneInputNumber/index.tsx +8 -5
  31. package/themes/business/src/components/PreviousMessages/index.tsx +12 -0
  32. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +28 -18
  33. package/themes/business/src/components/PreviousOrders/index.tsx +5 -3
  34. package/themes/business/src/components/PrinterEdition/index.tsx +363 -0
  35. package/themes/business/src/components/PrinterEdition/styles.tsx +61 -0
  36. package/themes/business/src/components/PrinterSettings/index.tsx +267 -0
  37. package/themes/business/src/components/PrinterSettings/styles.tsx +30 -0
  38. package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
  39. package/themes/business/src/components/ReviewCustomer/index.tsx +2 -0
  40. package/themes/business/src/components/Sessions/index.tsx +187 -0
  41. package/themes/business/src/components/Sessions/styles.tsx +20 -0
  42. package/themes/business/src/components/StoresList/index.tsx +2 -2
  43. package/themes/business/src/components/UserFormDetails/index.tsx +111 -107
  44. package/themes/business/src/components/UserProfileForm/index.tsx +105 -53
  45. package/themes/business/src/components/WebsocketStatus/index.tsx +4 -4
  46. package/themes/business/src/components/shared/OInput.tsx +2 -0
  47. package/themes/business/src/components/shared/OTextarea.tsx +8 -9
  48. package/themes/business/src/hooks/useLocation.tsx +5 -4
  49. package/themes/business/src/types/index.tsx +23 -4
  50. package/themes/business/src/utils/index.tsx +19 -1
  51. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  52. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  53. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  54. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  55. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  56. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  57. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  58. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  59. package/themes/original/index.tsx +13 -1
  60. package/themes/original/src/components/AddressDetails/index.tsx +20 -10
  61. package/themes/original/src/components/AddressForm/index.tsx +32 -17
  62. package/themes/original/src/components/AddressList/index.tsx +8 -7
  63. package/themes/original/src/components/AnalyticsSegment/index.tsx +6 -6
  64. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  65. package/themes/original/src/components/BusinessBasicInformation/index.tsx +6 -9
  66. package/themes/original/src/components/BusinessController/index.tsx +12 -7
  67. package/themes/original/src/components/BusinessItemAccordion/index.tsx +13 -5
  68. package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +2 -3
  69. package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +1 -3
  70. package/themes/original/src/components/BusinessListingSearch/index.tsx +1 -2
  71. package/themes/original/src/components/BusinessPreorder/index.tsx +20 -15
  72. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +5 -5
  73. package/themes/original/src/components/BusinessProductsList/index.tsx +3 -3
  74. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  75. package/themes/original/src/components/BusinessProductsListing/index.tsx +15 -4
  76. package/themes/original/src/components/BusinessTypeFilter/index.tsx +9 -8
  77. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +2 -1
  78. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +1 -1
  79. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
  80. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  81. package/themes/original/src/components/Cart/index.tsx +39 -12
  82. package/themes/original/src/components/CartContent/index.tsx +59 -44
  83. package/themes/original/src/components/Checkout/index.tsx +47 -26
  84. package/themes/original/src/components/CitiesControl/index.tsx +0 -3
  85. package/themes/original/src/components/CouponControl/index.tsx +1 -3
  86. package/themes/original/src/components/DriverTips/index.tsx +1 -3
  87. package/themes/original/src/components/Favorite/index.tsx +1 -5
  88. package/themes/original/src/components/FavoriteList/index.tsx +0 -1
  89. package/themes/original/src/components/ForgotPasswordForm/index.tsx +5 -7
  90. package/themes/original/src/components/GiftCard/GiftCardOrdersList/index.tsx +64 -0
  91. package/themes/original/src/components/GiftCard/GiftCardOrdersList/styles.tsx +8 -0
  92. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +15 -17
  93. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +3 -7
  94. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +24 -32
  95. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +7 -9
  96. package/themes/original/src/components/GiftCard/SingleGiftCard/index.tsx +101 -0
  97. package/themes/original/src/components/GiftCard/SingleGiftCard/styles.tsx +4 -0
  98. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +82 -0
  99. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/styles.tsx +9 -0
  100. package/themes/original/src/components/GoogleMap/index.tsx +39 -18
  101. package/themes/original/src/components/Help/index.tsx +2 -0
  102. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +1 -1
  103. package/themes/original/src/components/Home/index.tsx +2 -10
  104. package/themes/original/src/components/LoginForm/Otp/index.tsx +0 -3
  105. package/themes/original/src/components/LoginForm/index.tsx +4 -7
  106. package/themes/original/src/components/MessageListing/index.tsx +1 -0
  107. package/themes/original/src/components/Messages/index.tsx +8 -7
  108. package/themes/original/src/components/MomentOption/index.tsx +13 -2
  109. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +7 -3
  110. package/themes/original/src/components/MultiCheckout/index.tsx +123 -62
  111. package/themes/original/src/components/MultiCheckout/styles.tsx +17 -0
  112. package/themes/original/src/components/MultiOrdersDetails/index.tsx +20 -14
  113. package/themes/original/src/components/MyOrders/index.tsx +21 -26
  114. package/themes/original/src/components/NavBar/index.tsx +4 -2
  115. package/themes/original/src/components/NetworkError/index.tsx +0 -5
  116. package/themes/original/src/components/NotFoundSource/index.tsx +0 -3
  117. package/themes/original/src/components/OrderDetails/OrderEta.tsx +1 -1
  118. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +5 -7
  119. package/themes/original/src/components/OrderDetails/index.tsx +28 -12
  120. package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
  121. package/themes/original/src/components/OrderProgress/index.tsx +22 -3
  122. package/themes/original/src/components/OrderSummary/index.tsx +23 -5
  123. package/themes/original/src/components/OrderTypeSelector/index.tsx +7 -6
  124. package/themes/original/src/components/OrdersOption/index.tsx +2 -4
  125. package/themes/original/src/components/PaymentOptionStripe/index.tsx +0 -5
  126. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  127. package/themes/original/src/components/PaymentOptions/index.tsx +46 -5
  128. package/themes/original/src/components/PlaceSpot/index.tsx +1 -3
  129. package/themes/original/src/components/PreviousOrders/index.tsx +1 -2
  130. package/themes/original/src/components/ProductForm/ActionButton.tsx +16 -19
  131. package/themes/original/src/components/ProductForm/index.tsx +108 -105
  132. package/themes/original/src/components/ProductItemAccordion/index.tsx +55 -49
  133. package/themes/original/src/components/ProductItemAccordion/styles.tsx +3 -4
  134. package/themes/original/src/components/ProductOptionSubOption/index.tsx +8 -1
  135. package/themes/original/src/components/ProfessionalProfile/index.tsx +4 -5
  136. package/themes/original/src/components/Promotions/index.tsx +6 -9
  137. package/themes/original/src/components/ReviewDriver/index.tsx +1 -1
  138. package/themes/original/src/components/ReviewOrder/index.tsx +2 -2
  139. package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
  140. package/themes/original/src/components/ReviewTrigger/index.tsx +2 -2
  141. package/themes/original/src/components/ServiceForm/index.tsx +52 -54
  142. package/themes/original/src/components/Sessions/index.tsx +3 -3
  143. package/themes/original/src/components/SignupForm/index.tsx +86 -78
  144. package/themes/original/src/components/SingleOrderCard/index.tsx +1 -2
  145. package/themes/original/src/components/SingleProductCard/index.tsx +5 -6
  146. package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
  147. package/themes/original/src/components/StripeCardForm/index.tsx +0 -3
  148. package/themes/original/src/components/StripeCardsList/index.tsx +10 -35
  149. package/themes/original/src/components/StripeElementsForm/index.tsx +78 -59
  150. package/themes/original/src/components/StripeElementsForm/naked.tsx +48 -1
  151. package/themes/original/src/components/StripeRedirectForm/index.tsx +0 -3
  152. package/themes/original/src/components/TaxInformation/index.tsx +3 -2
  153. package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +10 -7
  154. package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +8 -3
  155. package/themes/original/src/components/UserFormDetails/index.tsx +83 -84
  156. package/themes/original/src/components/UserProfile/index.tsx +11 -2
  157. package/themes/original/src/components/Wallets/index.tsx +6 -3
  158. package/themes/original/src/components/WebsocketStatus/index.tsx +169 -0
  159. package/themes/original/src/components/WebsocketStatus/styles.tsx +28 -0
  160. package/themes/original/src/components/shared/OAlert.tsx +2 -1
  161. package/themes/original/src/components/shared/OButton.tsx +5 -4
  162. package/themes/original/src/components/shared/OInput.tsx +4 -8
  163. package/themes/original/src/types/index.tsx +5 -1
  164. package/themes/original/src/utils/index.tsx +12 -1
  165. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -65,6 +65,7 @@ const PaymentOptionsUI = (props: any) => {
65
65
  handlePaymentMethodClickCustom,
66
66
  handlePlaceOrder,
67
67
  merchantId,
68
+ urlscheme,
68
69
  setMethodPaySupported,
69
70
  placeByMethodPay,
70
71
  methodPaySupported,
@@ -74,7 +75,8 @@ const PaymentOptionsUI = (props: any) => {
74
75
  requiredFields,
75
76
  openUserModal,
76
77
  paymethodClicked,
77
- setPaymethodClicked
78
+ setPaymethodClicked,
79
+ androidAppId
78
80
  } = props
79
81
 
80
82
  const theme = useTheme();
@@ -324,7 +326,6 @@ const PaymentOptionsUI = (props: any) => {
324
326
  <OButton
325
327
  text={t('ADD_PAYMENT_CARD', 'Add New Payment Card')}
326
328
  bgColor={theme.colors.white}
327
- borderColor={theme.colors.primary}
328
329
  style={styles.btnAddStyle}
329
330
  textStyle={{ color: theme.colors.primary, fontSize: 12 }}
330
331
  imgRightSrc={null}
@@ -342,10 +343,11 @@ const PaymentOptionsUI = (props: any) => {
342
343
  setAddCardOpen={setAddCardOpen}
343
344
  addCardOpen={addCardOpen}
344
345
  isOpenMethod={isOpenMethod}
345
- handlePaymethodDataChange={handlePaymethodDataChange}
346
+ handleSource={handlePaymethodDataChange}
346
347
  clientSecret={props.clientSecret}
347
348
  businessId={props.businessId}
348
349
  onPaymentChange={onPaymentChange}
350
+ paySelected={props.paySelected}
349
351
  />
350
352
  </View>
351
353
  )}
@@ -360,10 +362,13 @@ const PaymentOptionsUI = (props: any) => {
360
362
  handleSource={handlePaymethodDataChange}
361
363
  onCancel={() => handlePaymethodClick(null)}
362
364
  merchantId={merchantId}
365
+ urlscheme={urlscheme}
366
+ androidAppId={androidAppId}
363
367
  setMethodPaySupported={setMethodPaySupported}
364
368
  methodPaySupported={methodPaySupported}
365
369
  placeByMethodPay={placeByMethodPay}
366
370
  setPlaceByMethodPay={setPlaceByMethodPay}
371
+ publicKeyAddCard={isOpenMethod?.paymethod?.credentials?.stripe?.publishable || isOpenMethod?.paymethod?.credentials?.publishable}
367
372
  />
368
373
  )}
369
374
 
@@ -406,6 +411,10 @@ const PaymentOptionsUI = (props: any) => {
406
411
  handleSource={handlePaymethodDataChange}
407
412
  onCancel={() => handlePaymethodClick(null)}
408
413
  merchantId={merchantId}
414
+ urlscheme={urlscheme}
415
+ androidAppId={androidAppId}
416
+ publicKeyAddCard={isOpenMethod?.paymethod?.credentials?.stripe?.publishable || isOpenMethod?.paymethod?.credentials?.publishable}
417
+ paySelected={props.paySelected}
409
418
  />
410
419
  </KeyboardAvoidingView>
411
420
  </OModal>
@@ -416,7 +425,6 @@ const PaymentOptionsUI = (props: any) => {
416
425
  <OButton
417
426
  text={t('ADD_PAYMENT_CARD', 'Add New Payment Card')}
418
427
  bgColor={theme.colors.white}
419
- borderColor={theme.colors.primary}
420
428
  style={styles.btnAddStyle}
421
429
  textStyle={{ color: theme.colors.primary, fontSize: 12 }}
422
430
  imgRightSrc={null}
@@ -425,11 +433,13 @@ const PaymentOptionsUI = (props: any) => {
425
433
  <StripeCardsList
426
434
  paymethod={isOpenMethod?.paymethod}
427
435
  businessId={props.businessId}
428
- publicKey={isOpenMethod?.paymethod?.credentials.publishable}
429
436
  payType={paymethodsList?.name}
430
437
  onSelectCard={handlePaymethodDataChange}
431
438
  onNavigationRedirect={onNavigationRedirect}
432
439
  onCancel={() => handlePaymethodClick(null)}
440
+ publicKey={isOpenMethod?.paymethod?.credentials.publishable}
441
+ publicKeyAddCard={isOpenMethod?.paymethod?.credentials?.stripe?.publishable || isOpenMethod?.paymethod?.credentials?.publishable}
442
+ paySelected={props.paySelected}
433
443
  />
434
444
  </View>
435
445
  )}
@@ -446,6 +456,7 @@ const PaymentOptionsUI = (props: any) => {
446
456
  enabled={Platform.OS === 'ios' ? true : false}
447
457
  >
448
458
  <StripeElementsForm
459
+ openCarts={props.openCarts}
449
460
  toSave
450
461
  businessId={props.businessId}
451
462
  publicKey={isOpenMethod?.paymethod?.credentials?.stripe?.publishable}
@@ -453,6 +464,36 @@ const PaymentOptionsUI = (props: any) => {
453
464
  accountId={isOpenMethod?.paymethod?.credentials?.user}
454
465
  onSelectCard={handlePaymethodDataChange}
455
466
  onCancel={() => setAddCardOpen({ ...addCardOpen, stripeConnect: false })}
467
+ publicKeyAddCard={isOpenMethod?.paymethod?.credentials?.stripe?.publishable || isOpenMethod?.paymethod?.credentials?.publishable}
468
+ />
469
+ </KeyboardAvoidingView>
470
+ </OModal>
471
+
472
+ {/* Stripe Add card */}
473
+ <OModal
474
+ entireModal
475
+ title={t('ADD_CREDIT_OR_DEBIT_CARD', 'Add credit or debit card')}
476
+ open={addCardOpen?.stripe}
477
+ onClose={() => setAddCardOpen({ ...addCardOpen, stripe: false })}
478
+ style={{ backgroundColor: 'red' }}
479
+ >
480
+ <KeyboardAvoidingView
481
+ behavior={Platform.OS == 'ios' ? 'padding' : 'height'}
482
+ keyboardVerticalOffset={Platform.OS == 'ios' ? 0 : 0}
483
+ enabled={Platform.OS === 'ios' ? true : false}
484
+ >
485
+ <StripeElementsForm
486
+ openCarts={props.openCarts}
487
+ toSave
488
+ businessId={props.businessId}
489
+ businessIds={props.businessIds}
490
+ publicKey={props.publicKey || isOpenMethod?.paymethod?.credentials?.publishable}
491
+ setCardsList={setCardList}
492
+ requirements={props.clientSecret}
493
+ handleSource={handlePaymethodDataChange}
494
+ onSelectCard={handlePaymethodDataChange}
495
+ onCancel={() => setAddCardOpen({ ...addCardOpen, stripe: false })}
496
+ publicKeyAddCard={isOpenMethod?.paymethod?.credentials?.stripe?.publishable || isOpenMethod?.paymethod?.credentials?.publishable}
456
497
  />
457
498
  </KeyboardAvoidingView>
458
499
  </OModal>
@@ -236,9 +236,7 @@ const PlaceSpotUI = (props: PlaceSpotParams) => {
236
236
  <View style={{ alignItems: 'flex-start' }}>
237
237
  <OButton
238
238
  onClick={() => onChangeSpot()}
239
- bgColor={theme.colors.primary}
240
- borderColor={theme.colors.primary}
241
- textStyle={{ color: 'white', fontSize: 12 }}
239
+ textStyle={{ fontSize: 12 }}
242
240
  imgRightSrc={null}
243
241
  text={t('UPDATE_SPOT_NUMBER', 'Update')}
244
242
  isDisabled={(!spotNumber && !Object.values(vehicle).every(e => e))}
@@ -27,7 +27,7 @@ export const PreviousOrders = (props: PreviousOrdersParams) => {
27
27
 
28
28
  const [, t] = useLanguage();
29
29
 
30
- const pastOrders = [1, 2, 5, 6, 10, 11, 12, 15, 16, 17]
30
+ const pastOrders = [1, 2, 5, 6, 10, 11, 12, 15, 16, 17]
31
31
 
32
32
  return (
33
33
  <View style={{ marginBottom: 30 }}>
@@ -49,7 +49,6 @@ export const PreviousOrders = (props: PreviousOrdersParams) => {
49
49
  onClick={loadMoreOrders}
50
50
  text={t('LOAD_MORE_ORDERS', 'Load more orders')}
51
51
  imgRightSrc={null}
52
- textStyle={{ color: theme.colors.white }}
53
52
  style={{ borderRadius: 7.6, shadowOpacity: 0, marginTop: 20 }}
54
53
  />
55
54
  </WrappButton>
@@ -5,7 +5,7 @@ import { TouchableOpacity, View } from 'react-native'
5
5
  import { OButton, OText } from '../shared';
6
6
  import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder';
7
7
 
8
- export const ActionButton = (props : any) => {
8
+ export const ActionButton = (props: any) => {
9
9
  const {
10
10
  navigation,
11
11
  isHaveWeight,
@@ -23,27 +23,29 @@ export const ActionButton = (props : any) => {
23
23
  handleUpdateGuest,
24
24
  actionStatus
25
25
  } = props
26
- const [,t] = useLanguage()
26
+ const [, t] = useLanguage()
27
27
  const [{ auth }] = useSession()
28
28
  const [orderState] = useOrder()
29
29
  const theme = useTheme()
30
- const [{ configs }] = useConfig()
30
+ const [{ configs }] = useConfig()
31
31
  const unaddressedTypes = configs?.unaddressed_order_types_allowed?.value.split('|').map((value: any) => Number(value)) || []
32
- const isAllowUnaddressOrderType = unaddressedTypes.includes(orderState?.options?.type)
33
-
32
+ const isAllowUnaddressOrderType = unaddressedTypes.includes(orderState?.options?.type)
34
33
  const saveErrors =
35
- orderState.loading ||
36
- maxProductQuantity === 0 ||
37
- Object.keys(errors)?.length > 0;
34
+ orderState.loading ||
35
+ maxProductQuantity === 0 ||
36
+ Object.keys(errors)?.length > 0;
37
+ const buttonColor = saveErrors || isSoldOut || maxProductQuantity <= 0 || (product?.minimum_per_order && ((productCart?.quantity + productAddedToCartLength) < product?.minimum_per_order)) || (product?.maximum_per_order && ((productCart?.quantity + productAddedToCartLength) > product?.maximum_per_order))
38
+
39
+
38
40
 
39
41
  return (
40
42
  <View
41
43
  style={{
42
44
  width: isHaveWeight ? '100%' : ((isSoldOut || maxProductQuantity <= 0) ? '60%' : '40%'),
43
45
  }}>
44
- {((productCart &&
46
+ {(productCart &&
45
47
  auth &&
46
- (orderState.options?.address_id || isAllowUnaddressOrderType)) || (isSoldOut || maxProductQuantity <= 0)) && (
48
+ ((orderState.options?.address_id || isAllowUnaddressOrderType) || (isSoldOut || maxProductQuantity <= 0))) && (
47
49
  <OButton
48
50
  onClick={() => handleSaveProduct()}
49
51
  imgRightSrc=""
@@ -55,15 +57,11 @@ export const ActionButton = (props : any) => {
55
57
  ? t('UPDATE', 'Update')
56
58
  : t('ADD', 'Add')
57
59
  }`}
58
- isDisabled={isSoldOut || maxProductQuantity <= 0 || (product?.minimum_per_order && ((productCart?.quantity + productAddedToCartLength) < product?.minimum_per_order)) || (product?.maximum_per_order && ((productCart?.quantity + productAddedToCartLength) > product?.maximum_per_order))}
60
+ isDisabled={buttonColor}
59
61
  textStyle={{
60
- color: saveErrors || isSoldOut || maxProductQuantity <= 0 ? theme.colors.primary : theme.colors.white,
61
62
  fontSize: orderState.loading || editMode ? 10 : 14
62
63
  }}
63
64
  style={{
64
- backgroundColor: saveErrors || isSoldOut || maxProductQuantity <= 0 || (product?.minimum_per_order && ((productCart?.quantity + productAddedToCartLength) < product?.minimum_per_order)) || (product?.maximum_per_order && ((productCart?.quantity + productAddedToCartLength) > product?.maximum_per_order)) ? theme.colors.lightGray : theme.colors.primary,
65
- borderColor: saveErrors || isSoldOut || maxProductQuantity <= 0 || (product?.minimum_per_order && ((productCart?.quantity + productAddedToCartLength) < product?.minimum_per_order)) || (product?.maximum_per_order && ((productCart?.quantity + productAddedToCartLength) > product?.maximum_per_order)) ? theme.colors.white : theme.colors.primary,
66
- opacity: saveErrors || isSoldOut || maxProductQuantity <= 0 ? 0.3 : 1,
67
65
  borderRadius: 7.6,
68
66
  height: 44,
69
67
  shadowOpacity: 0,
@@ -94,13 +92,12 @@ export const ActionButton = (props : any) => {
94
92
  : t('LOGIN_SIGNUP', 'Login / Sign Up')
95
93
  }
96
94
  imgRightSrc=""
97
- textStyle={{ color: theme.colors.primary, fontSize: 13, textAlign: 'center' }}
95
+ textStyle={{ fontSize: 13, textAlign: 'center' }}
98
96
  style={{
99
97
  height: 42,
100
- borderColor: theme.colors.primary,
101
- backgroundColor: theme.colors.white,
102
98
  paddingLeft: 0,
103
- paddingRight: 0
99
+ paddingRight: 0,
100
+ borderRadius: 7.6
104
101
  }}
105
102
  />
106
103
  )}
@@ -62,8 +62,6 @@ import { IOScrollView } from 'react-native-intersection-observer';
62
62
 
63
63
  const windowWidth = Dimensions.get('window').width;
64
64
 
65
-
66
-
67
65
  export const ProductOptionsUI = (props: any) => {
68
66
  const {
69
67
  navigation,
@@ -90,6 +88,7 @@ export const ProductOptionsUI = (props: any) => {
90
88
  const [events] = useEvent()
91
89
  const commentRef = useRef()
92
90
  const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
91
+ const hideProductDummyLogo = theme?.business_view?.components?.products?.components?.product?.components?.dummy?.hidden
93
92
 
94
93
  const styles = StyleSheet.create({
95
94
  mainContainer: {
@@ -441,7 +440,7 @@ export const ProductOptionsUI = (props: any) => {
441
440
  selOpt
442
441
  }
443
442
 
444
- const suboptionsLength = product.extras.reduce((acc : number, extras : any) => acc + extras?.options?.reduce((accSuboptions : number, options: any) => accSuboptions + options?.suboptions?.length, 0), 0)
443
+ const suboptionsLength = product?.extras?.reduce((acc : number, extras : any) => acc + extras?.options?.reduce((accSuboptions : number, options: any) => accSuboptions + options?.suboptions?.length, 0), 0)
445
444
 
446
445
  return (
447
446
  <SafeAreaView style={{ flex: 1 }}>
@@ -489,114 +488,118 @@ export const ProductOptionsUI = (props: any) => {
489
488
  </View>
490
489
  ) : (
491
490
  <>
492
- <Swiper
493
- loop={false}
494
- ref={swiperRef}
495
- showsButtons={true}
496
- style={styles.mainSwiper}
497
- showsPagination={false}
498
- onIndexChanged={(index : any) => handleChangeMainIndex(index)}
499
- prevButton={
500
- <View style={styles.swiperButton}>
501
- <IconAntDesign
502
- name="caretleft"
503
- color={theme.colors.white}
504
- size={13}
505
- // style={styles.starIcon}
506
- />
507
- </View>
508
- }
509
- nextButton={
510
- <View style={styles.swiperButton}>
511
- <IconAntDesign
512
- name="caretright"
513
- color={theme.colors.white}
514
- size={13}
515
- // style={styles.starIcon}
516
- />
517
- </View>
518
- }
519
- >
520
- {gallery && gallery?.length > 0 && gallery.map((img : any, i: number) => (
521
- <View
522
- style={styles.slide1}
523
- key={i}
524
- >
525
- {(String(img).includes('http') || typeof img === 'number') ? (
526
- <FastImage
527
- style={{ height: '100%', opacity: isSoldOut ? 0.5 : 1, aspectRatio: 16 / 9 }}
528
- source={typeof img !== 'number' ? {
529
- uri: optimizeImage(img, 'h_1024,c_limit'),
530
- priority: FastImage.priority.normal,
531
- } : img}
532
- />
533
- ) : (
534
- <>
535
- <YoutubePlayer
536
- height={'100%'}
537
- width={'100%'}
538
- play={playing}
539
- videoId={img}
540
- onChangeState={onStateChange}
491
+ {(product?.images || !hideProductDummyLogo) && (
492
+ <>
493
+ <Swiper
494
+ loop={false}
495
+ ref={swiperRef}
496
+ showsButtons={true}
497
+ style={styles.mainSwiper}
498
+ showsPagination={false}
499
+ onIndexChanged={(index : any) => handleChangeMainIndex(index)}
500
+ prevButton={
501
+ <View style={styles.swiperButton}>
502
+ <IconAntDesign
503
+ name="caretleft"
504
+ color={theme.colors.white}
505
+ size={13}
506
+ // style={styles.starIcon}
541
507
  />
542
- <Button title={playing ? "pause" : "play"} onPress={togglePlaying} />
543
- </>
544
- )}
545
- </View>
546
- ))}
547
- </Swiper>
548
- <ScrollView
549
- horizontal
550
- contentContainerStyle={{
551
- paddingHorizontal: 20,
552
- paddingVertical: 15
553
- }}
554
- >
555
- {gallery?.length > 1 && gallery.map((img: any, index: number) => (
556
- <TouchableOpacity
557
- key={index}
558
- onPress={() => handleClickThumb(index)}
559
- >
560
- <View
561
- style={{
562
- height: 56,
563
- borderRadius: 8,
564
- margin: 8,
565
- opacity: index === thumbsSwiper ? 1 : 0.8
566
- }}
567
- >
568
- {String(img).includes('http') ? (
569
- <OIcon
570
- url={img}
571
- style={{
572
- borderColor: theme.colors.lightGray,
573
- borderRadius: 8,
574
- minHeight: '100%',
575
- opacity: isSoldOut ? 0.5 : 1
576
- }}
577
- width={56}
578
- height={56}
579
- cover
508
+ </View>
509
+ }
510
+ nextButton={
511
+ <View style={styles.swiperButton}>
512
+ <IconAntDesign
513
+ name="caretright"
514
+ color={theme.colors.white}
515
+ size={13}
516
+ // style={styles.starIcon}
580
517
  />
581
- ) : (
582
- <OIcon
583
- url={'https://img.youtube.com/vi/' + img + '/0.jpg'}
518
+ </View>
519
+ }
520
+ >
521
+ {gallery && gallery?.length > 0 && gallery.map((img : any, i: number) => (
522
+ <View
523
+ style={styles.slide1}
524
+ key={i}
525
+ >
526
+ {(String(img).includes('http') || typeof img === 'number') ? (
527
+ <FastImage
528
+ style={{ height: '100%', opacity: isSoldOut ? 0.5 : 1, aspectRatio: 16 / 9 }}
529
+ source={typeof img !== 'number' ? {
530
+ uri: optimizeImage(img, 'h_1024,c_limit'),
531
+ priority: FastImage.priority.normal,
532
+ } : img}
533
+ />
534
+ ) : (
535
+ <>
536
+ <YoutubePlayer
537
+ height={'100%'}
538
+ width={'100%'}
539
+ play={playing}
540
+ videoId={img}
541
+ onChangeState={onStateChange}
542
+ />
543
+ <Button title={playing ? "pause" : "play"} onPress={togglePlaying} />
544
+ </>
545
+ )}
546
+ </View>
547
+ ))}
548
+ </Swiper>
549
+ <ScrollView
550
+ horizontal
551
+ contentContainerStyle={{
552
+ paddingHorizontal: 20,
553
+ paddingVertical: 15
554
+ }}
555
+ >
556
+ {gallery?.length > 1 && gallery.map((img: any, index: number) => (
557
+ <TouchableOpacity
558
+ key={index}
559
+ onPress={() => handleClickThumb(index)}
560
+ >
561
+ <View
584
562
  style={{
585
- borderColor: theme.colors.lightGray,
563
+ height: 56,
586
564
  borderRadius: 8,
587
- minHeight: '100%',
588
- opacity: isSoldOut ? 0.5 : 1
565
+ margin: 8,
566
+ opacity: index === thumbsSwiper ? 1 : 0.8
589
567
  }}
590
- width={56}
591
- height={56}
592
- cover
593
- />
594
- )}
595
- </View>
596
- </TouchableOpacity>
568
+ >
569
+ {String(img).includes('http') ? (
570
+ <OIcon
571
+ url={img}
572
+ style={{
573
+ borderColor: theme.colors.lightGray,
574
+ borderRadius: 8,
575
+ minHeight: '100%',
576
+ opacity: isSoldOut ? 0.5 : 1
577
+ }}
578
+ width={56}
579
+ height={56}
580
+ cover
581
+ />
582
+ ) : (
583
+ <OIcon
584
+ url={'https://img.youtube.com/vi/' + img + '/0.jpg'}
585
+ style={{
586
+ borderColor: theme.colors.lightGray,
587
+ borderRadius: 8,
588
+ minHeight: '100%',
589
+ opacity: isSoldOut ? 0.5 : 1
590
+ }}
591
+ width={56}
592
+ height={56}
593
+ cover
594
+ />
595
+ )}
596
+ </View>
597
+ </TouchableOpacity>
597
598
 
598
- ))}
599
- </ScrollView>
599
+ ))}
600
+ </ScrollView>
601
+ </>
602
+ )}
600
603
  </>
601
604
  )}
602
605
  </WrapHeader>