ordering-ui-react-native 0.16.88 → 0.16.89-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 (216) hide show
  1. package/package.json +5 -5
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/ActiveOrders/styles.tsx +8 -14
  4. package/src/components/BusinessInformation/index.tsx +19 -4
  5. package/src/components/BusinessInformation/styles.tsx +2 -2
  6. package/src/components/BusinessProductsList/index.tsx +1 -1
  7. package/src/components/BusinessesListing/index.tsx +1 -1
  8. package/src/components/OrderCreating/index.tsx +1 -21
  9. package/src/components/OrdersOption/index.tsx +54 -56
  10. package/src/components/PaymentOptionsWebView/index.tsx +119 -120
  11. package/src/components/SingleProductReview/index.tsx +7 -4
  12. package/src/components/VerifyPhone/styles.tsx +1 -2
  13. package/src/components/shared/OToast.tsx +4 -4
  14. package/src/utils/index.tsx +2 -1
  15. package/themes/business/index.tsx +2 -0
  16. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +265 -240
  17. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
  18. package/themes/business/src/components/BusinessController/index.tsx +2 -2
  19. package/themes/business/src/components/Chat/index.tsx +31 -31
  20. package/themes/business/src/components/DriverMap/index.tsx +22 -9
  21. package/themes/business/src/components/GoogleMap/index.tsx +58 -57
  22. package/themes/business/src/components/LoginForm/Otp/index.tsx +120 -0
  23. package/themes/business/src/components/LoginForm/Otp/styles.tsx +7 -0
  24. package/themes/business/src/components/LoginForm/index.tsx +239 -80
  25. package/themes/business/src/components/LoginForm/styles.tsx +10 -0
  26. package/themes/business/src/components/MapView/index.tsx +18 -7
  27. package/themes/business/src/components/MessagesOption/index.tsx +11 -1
  28. package/themes/business/src/components/NewOrderNotification/index.tsx +31 -41
  29. package/themes/business/src/components/OrderDetails/Delivery.tsx +4 -3
  30. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +96 -50
  31. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +59 -62
  32. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +195 -0
  33. package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
  34. package/themes/business/src/components/OrderMessage/index.tsx +18 -17
  35. package/themes/business/src/components/OrdersOption/index.tsx +79 -87
  36. package/themes/business/src/components/OrdersOption/styles.tsx +5 -1
  37. package/themes/business/src/components/OrdersOptionBusiness/index.tsx +15 -1
  38. package/themes/business/src/components/OrdersOptionCity/index.tsx +15 -1
  39. package/themes/business/src/components/OrdersOptionDate/index.tsx +19 -6
  40. package/themes/business/src/components/OrdersOptionDelivery/index.tsx +15 -1
  41. package/themes/business/src/components/OrdersOptionDriver/index.tsx +15 -1
  42. package/themes/business/src/components/OrdersOptionPaymethod/index.tsx +15 -1
  43. package/themes/business/src/components/OrdersOptionStatus/index.tsx +10 -1
  44. package/themes/business/src/components/PreviousMessages/index.tsx +17 -18
  45. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +250 -0
  46. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
  47. package/themes/business/src/components/PreviousOrders/index.tsx +447 -247
  48. package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
  49. package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
  50. package/themes/business/src/components/ReviewCustomer/index.tsx +54 -27
  51. package/themes/business/src/components/shared/ODropDown.tsx +42 -8
  52. package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
  53. package/themes/business/src/components/shared/OLink.tsx +33 -13
  54. package/themes/business/src/components/shared/OModal.tsx +16 -9
  55. package/themes/business/src/components/shared/OText.tsx +8 -2
  56. package/themes/business/src/types/index.tsx +35 -3
  57. package/themes/business/src/utils/index.tsx +53 -0
  58. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  59. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  60. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  61. package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
  62. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  63. package/themes/kiosk/src/components/LoginForm/Otp/index.tsx +92 -0
  64. package/themes/kiosk/src/components/LoginForm/Otp/styles.tsx +7 -0
  65. package/themes/kiosk/src/components/LoginForm/index.tsx +473 -151
  66. package/themes/kiosk/src/components/LoginForm/styles.tsx +14 -1
  67. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  68. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  69. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  70. package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +1 -0
  71. package/themes/kiosk/src/components/PhoneInputNumber/styles.tsx +1 -3
  72. package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
  73. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  74. package/themes/kiosk/src/components/shared/OModal.tsx +14 -11
  75. package/themes/kiosk/src/layouts/Container.tsx +7 -1
  76. package/themes/kiosk/src/types/index.d.ts +13 -0
  77. package/themes/kiosk/src/utils/index.tsx +15 -0
  78. package/themes/original/index.tsx +8 -0
  79. package/themes/original/src/components/AddressDetails/index.tsx +10 -8
  80. package/themes/original/src/components/AddressForm/index.tsx +155 -139
  81. package/themes/original/src/components/AddressList/index.tsx +18 -18
  82. package/themes/original/src/components/AddressList/styles.tsx +4 -2
  83. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  84. package/themes/original/src/components/BusinessBasicInformation/index.tsx +118 -76
  85. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -4
  86. package/themes/original/src/components/BusinessController/index.tsx +100 -47
  87. package/themes/original/src/components/BusinessController/styles.tsx +14 -9
  88. package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
  89. package/themes/original/src/components/BusinessItemAccordion/index.tsx +9 -3
  90. package/themes/original/src/components/BusinessListingSearch/index.tsx +86 -33
  91. package/themes/original/src/components/BusinessListingSearch/styles.tsx +6 -0
  92. package/themes/original/src/components/BusinessPreorder/index.tsx +96 -15
  93. package/themes/original/src/components/BusinessProductsList/index.tsx +10 -8
  94. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  95. package/themes/original/src/components/BusinessProductsListing/index.tsx +567 -495
  96. package/themes/original/src/components/BusinessProductsListing/styles.tsx +13 -12
  97. package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -2
  98. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +2 -1
  99. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +116 -81
  100. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
  101. package/themes/original/src/components/BusinessesListing/index.tsx +6 -6
  102. package/themes/original/src/components/Cart/index.tsx +87 -42
  103. package/themes/original/src/components/CartContent/index.tsx +77 -15
  104. package/themes/original/src/components/CartContent/styles.tsx +11 -1
  105. package/themes/original/src/components/Checkout/index.tsx +281 -174
  106. package/themes/original/src/components/Checkout/styles.tsx +4 -2
  107. package/themes/original/src/components/CitiesControl/index.tsx +89 -0
  108. package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
  109. package/themes/original/src/components/DriverTips/index.tsx +52 -37
  110. package/themes/original/src/components/DriverTips/styles.tsx +2 -1
  111. package/themes/original/src/components/Favorite/index.tsx +7 -4
  112. package/themes/original/src/components/Favorite/styles.tsx +1 -1
  113. package/themes/original/src/components/FavoriteList/index.tsx +70 -80
  114. package/themes/original/src/components/FloatingButton/index.tsx +1 -2
  115. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  116. package/themes/original/src/components/GPSButton/index.tsx +20 -19
  117. package/themes/original/src/components/GPSButton/styles.ts +3 -3
  118. package/themes/original/src/components/GoogleMap/index.tsx +10 -1
  119. package/themes/original/src/components/Help/index.tsx +8 -8
  120. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +11 -22
  121. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +6 -0
  122. package/themes/original/src/components/HelpGuide/index.tsx +12 -16
  123. package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
  124. package/themes/original/src/components/HelpOrder/index.tsx +12 -25
  125. package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
  126. package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
  127. package/themes/original/src/components/LastOrder/index.tsx +1 -34
  128. package/themes/original/src/components/LoginForm/Otp/index.tsx +89 -73
  129. package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
  130. package/themes/original/src/components/LoginForm/index.tsx +43 -19
  131. package/themes/original/src/components/LottieAnimation/index.tsx +78 -0
  132. package/themes/original/src/components/MessageListing/index.tsx +16 -42
  133. package/themes/original/src/components/Messages/index.tsx +31 -10
  134. package/themes/original/src/components/MomentOption/index.tsx +195 -88
  135. package/themes/original/src/components/MultiCart/index.tsx +50 -0
  136. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -93
  137. package/themes/original/src/components/MultiCheckout/index.tsx +204 -79
  138. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
  139. package/themes/original/src/components/MultiOrdersDetails/index.tsx +67 -20
  140. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
  141. package/themes/original/src/components/MyOrders/index.tsx +66 -17
  142. package/themes/original/src/components/NavBar/index.tsx +6 -11
  143. package/themes/original/src/components/NetworkError/index.tsx +5 -3
  144. package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
  145. package/themes/original/src/components/Notifications/index.tsx +144 -0
  146. package/themes/original/src/components/Notifications/styles.tsx +20 -0
  147. package/themes/original/src/components/OrderDetails/OrderEta.tsx +59 -0
  148. package/themes/original/src/components/OrderDetails/index.tsx +110 -221
  149. package/themes/original/src/components/OrderDetails/styles.tsx +10 -1
  150. package/themes/original/src/components/OrderItAgain/index.tsx +44 -42
  151. package/themes/original/src/components/OrderProgress/index.tsx +74 -112
  152. package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
  153. package/themes/original/src/components/OrderSummary/index.tsx +52 -17
  154. package/themes/original/src/components/OrderTypeSelector/index.tsx +9 -3
  155. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +29 -20
  156. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
  157. package/themes/original/src/components/OrdersOption/index.tsx +76 -83
  158. package/themes/original/src/components/PageBanner/index.tsx +146 -0
  159. package/themes/original/src/components/PageBanner/styles.tsx +11 -0
  160. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
  161. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  162. package/themes/original/src/components/PaymentOptions/index.tsx +2 -2
  163. package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
  164. package/themes/original/src/components/PlaceSpot/index.tsx +12 -6
  165. package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
  166. package/themes/original/src/components/ProductForm/index.tsx +240 -256
  167. package/themes/original/src/components/ProductForm/styles.tsx +5 -8
  168. package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
  169. package/themes/original/src/components/ProductOptionSubOption/index.tsx +18 -10
  170. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +1 -2
  171. package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
  172. package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -49
  173. package/themes/original/src/components/ProfessionalProfile/index.tsx +54 -14
  174. package/themes/original/src/components/Promotions/index.tsx +234 -220
  175. package/themes/original/src/components/Promotions/styles.tsx +7 -2
  176. package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
  177. package/themes/original/src/components/ReviewOrder/index.tsx +43 -11
  178. package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
  179. package/themes/original/src/components/ReviewProducts/index.tsx +8 -5
  180. package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
  181. package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
  182. package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
  183. package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
  184. package/themes/original/src/components/ServiceForm/index.tsx +377 -270
  185. package/themes/original/src/components/Sessions/index.tsx +11 -8
  186. package/themes/original/src/components/Sessions/styles.tsx +5 -0
  187. package/themes/original/src/components/SignupForm/index.tsx +79 -67
  188. package/themes/original/src/components/SingleOrderCard/index.tsx +126 -57
  189. package/themes/original/src/components/SingleOrderCard/styles.tsx +10 -8
  190. package/themes/original/src/components/SingleProductCard/index.tsx +104 -45
  191. package/themes/original/src/components/SingleProductCard/styles.tsx +14 -13
  192. package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
  193. package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
  194. package/themes/original/src/components/StripeCardsList/index.tsx +1 -1
  195. package/themes/original/src/components/StripeElementsForm/index.tsx +4 -1
  196. package/themes/original/src/components/UpsellingProducts/index.tsx +237 -218
  197. package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
  198. package/themes/original/src/components/UserDetails/index.tsx +8 -4
  199. package/themes/original/src/components/UserFormDetails/index.tsx +53 -54
  200. package/themes/original/src/components/UserProfile/index.tsx +58 -35
  201. package/themes/original/src/components/UserProfile/styles.ts +17 -0
  202. package/themes/original/src/components/UserProfileForm/index.tsx +21 -28
  203. package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
  204. package/themes/original/src/components/Wallets/index.tsx +96 -93
  205. package/themes/original/src/components/Wallets/styles.tsx +2 -0
  206. package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
  207. package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
  208. package/themes/original/src/components/shared/OBottomPopup.tsx +1 -1
  209. package/themes/original/src/components/shared/OButton.tsx +6 -2
  210. package/themes/original/src/components/shared/OIcon.tsx +8 -1
  211. package/themes/original/src/components/shared/OInput.tsx +10 -1
  212. package/themes/original/src/components/shared/OModal.tsx +3 -3
  213. package/themes/original/src/layouts/Container.tsx +13 -9
  214. package/themes/original/src/types/index.tsx +37 -5
  215. package/themes/original/src/utils/index.tsx +321 -58
  216. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -1,5 +1,6 @@
1
1
  import React, { useState, useEffect } from 'react';
2
2
  import { StyleSheet, View, TouchableOpacity, Linking, Pressable } from 'react-native';
3
+ import FastImage from 'react-native-fast-image'
3
4
  import { useUtils, useOrder, useLanguage } from 'ordering-components/native';
4
5
  import { useTheme } from 'styled-components/native';
5
6
  import { OIcon, OText, OModal } from '../shared';
@@ -45,8 +46,16 @@ export const BusinessBasicInformation = (
45
46
  const [openBusinessReviews, setOpenBusinessReviews] = useState(false);
46
47
  const [businessInformationObtained, setBusinessInformationObtained] = useState(false)
47
48
  const [businessReviewsObtained, setBusinessReviewsObtainedbtained] = useState(false)
48
- const isChewLayout = theme?.business_view?.components?.header?.components?.layout?.type === 'original'
49
- const showLogo = !theme?.business_view?.components?.header?.components?.business?.components?.logo?.hidden
49
+ const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
50
+ const hideLogo = theme?.business_view?.components?.header?.components?.business?.components?.logo?.hidden
51
+ const hideDeliveryFee = theme?.business_view?.components?.header?.components?.business?.components?.fee?.hidden
52
+ const hideTime = theme?.business_view?.components?.header?.components?.business?.components?.time?.hidden
53
+ const hideReviews = theme?.business_view?.components?.header?.components?.business?.components?.reviews?.hidden
54
+ const hideReviewsPopup = theme?.business_view?.components?.header?.components?.reviews?.hidden
55
+ const hideDistance = theme?.business_view?.components?.header?.components?.business?.components?.distance?.hidden
56
+ const hideInfoIcon = theme?.business_view?.components?.header?.components?.business?.components?.business_info?.hidden
57
+ const hideCity = theme?.business_view?.components?.header?.components?.business?.components?.city?.hidden
58
+ const hideHeader = theme?.business_view?.components?.header?.hidden
50
59
 
51
60
  const styles = StyleSheet.create({
52
61
  businesInfoheaderStyle: {
@@ -55,12 +64,12 @@ export const BusinessBasicInformation = (
55
64
  headerStyle: {
56
65
  height: isChewLayout ? 170 : 260,
57
66
  },
58
- businessLogo: {
67
+ logoStyle: {
59
68
  width: 72,
60
69
  height: 72,
61
70
  borderRadius: 7.6,
62
71
  justifyContent: 'flex-start',
63
- alignItems: 'flex-start',
72
+ alignItems: 'flex-start'
64
73
  },
65
74
  businessInfo: {
66
75
  paddingHorizontal: 40,
@@ -248,9 +257,13 @@ export const BusinessBasicInformation = (
248
257
  iconTitle='snapchat'
249
258
  />
250
259
  )}
251
- {isChewLayout && (
260
+ {isChewLayout && !hideInfoIcon && (
252
261
  <TouchableOpacity onPress={() => handleClickBusinessInformation()}>
253
- <OText style={{ textDecorationColor: theme.colors.black, textDecorationLine: 'underline' }}>
262
+ <OText
263
+ color={theme.colors.primary}
264
+ style={{ textDecorationColor: theme.colors.primary, textDecorationLine: 'underline' }}
265
+ size={12}
266
+ >
254
267
  {t('SEE_MORE_DESCRIPTION', 'See more')}
255
268
  </OText>
256
269
  </TouchableOpacity>
@@ -262,53 +275,63 @@ export const BusinessBasicInformation = (
262
275
  }
263
276
 
264
277
  return (
265
- <BusinessContainer isChewLayout={isChewLayout && !showLogo}>
266
- <BusinessHeader
267
- isChewLayout={isChewLayout}
268
- style={
269
- isBusinessInfoShow
270
- ? styles.businesInfoheaderStyle
271
- : { ...styles.headerStyle, backgroundColor: theme.colors.backgroundGray }
272
- }
273
- source={{
274
- uri:
275
- header ||
276
- optimizeImage(businessState?.business?.header, 'h_250,c_limit'),
277
- }}
278
- imageStyle={{ opacity: isChewLayout ? 0.5 : 1 }}
279
- >
280
- {!isBusinessInfoShow && !isChewLayout && (
281
- <WrapBusinessInfo onPress={() => handleClickBusinessInformation()}>
282
- <OIcon src={theme.images.general.info} width={24} />
283
- </WrapBusinessInfo>
284
- )}
285
- {isChewLayout && (
286
- <View style={styles.headerChewStyle}>
287
- <OText size={24} weight={'600'} mBottom={-5}>
288
- {business?.name}
289
- </OText>
290
- {business?.city?.name && (
291
- <OText>
292
- {business?.city?.name}
278
+ <BusinessContainer isChewLayout={isChewLayout && hideLogo}>
279
+ {!hideHeader && (
280
+ <BusinessHeader
281
+ isChewLayout={isChewLayout}
282
+ style={
283
+ isBusinessInfoShow
284
+ ? styles.businesInfoheaderStyle
285
+ : { ...styles.headerStyle, backgroundColor: theme.colors.backgroundGray }
286
+ }
287
+ {...(!loading && {
288
+ source: (header || businessState?.business?.header) ? {
289
+ uri: optimizeImage(businessState?.business?.header, 'h_250,c_limit') || header
290
+ } : theme?.images?.dummies?.businessHeader
291
+ })}
292
+ imageStyle={{ opacity: isChewLayout ? 0.5 : 1 }}
293
+ >
294
+ {!isBusinessInfoShow && !hideInfoIcon && !isChewLayout && (
295
+ <WrapBusinessInfo onPress={() => handleClickBusinessInformation()}>
296
+ <OIcon src={theme.images.general.info} width={24} />
297
+ </WrapBusinessInfo>
298
+ )}
299
+ {isChewLayout && !loading && (
300
+ <View style={styles.headerChewStyle}>
301
+ <OText size={24} weight={'600'} mBottom={-5}>
302
+ {business?.name}
293
303
  </OText>
294
- )}
295
- <View style={styles.socialIconsChewContainer}>
296
- <SocialIcons />
304
+ {business?.city?.name && !hideCity && (
305
+ <OText>
306
+ {business?.city?.name}
307
+ </OText>
308
+ )}
309
+ <View style={styles.socialIconsChewContainer}>
310
+ <SocialIcons />
311
+ </View>
297
312
  </View>
298
- </View>
299
- )}
300
- </BusinessHeader>
313
+ )}
314
+ </BusinessHeader>
315
+ )}
301
316
  <BusinessInfo style={styles.businessInfo}>
302
- {showLogo && (
317
+ {!hideLogo && (
303
318
  <BusinessLogo isChewLayout={isChewLayout}>
304
319
  {!isBusinessInfoShow && (
305
- <OIcon
306
- url={
307
- logo ||
308
- optimizeImage(businessState?.business?.logo, 'h_70,c_limit')
309
- }
310
- style={styles.businessLogo}
311
- />
320
+ logo || businessState?.business?.logo ?
321
+ <FastImage
322
+ style={styles.logoStyle}
323
+ source={{
324
+ uri: logo || optimizeImage(businessState?.business?.logo, 'h_70,c_limit'),
325
+ priority: FastImage.priority.high,
326
+ cache: FastImage.cacheControl.web
327
+ }}
328
+ resizeMode={FastImage.resizeMode.contain}
329
+ />
330
+ :
331
+ <OIcon
332
+ src={theme?.images?.dummies?.businessLogo}
333
+ style={styles.logoStyle}
334
+ />
312
335
  )}
313
336
  </BusinessLogo>
314
337
  )}
@@ -371,34 +394,43 @@ export const BusinessBasicInformation = (
371
394
  </Placeholder>
372
395
  )}
373
396
  <View style={styles.bullet}>
374
- <OText color={theme.colors.textSecondary} size={12} style={styles.metadata}>
375
- {`${t('DELIVERY_FEE', 'Delivery fee')} ${business && parsePrice(business?.delivery_price || 0)} \u2022 `}
376
- </OText>
377
- {orderState?.options?.type === 1 ? (
397
+ {!hideDeliveryFee && (
378
398
  <OText color={theme.colors.textSecondary} size={12} style={styles.metadata}>
379
- {convertHoursToMinutes(business?.delivery_time) + ` \u2022 `}
399
+ {`${t('DELIVERY_FEE', 'Delivery fee')} ${business && parsePrice(business?.delivery_price || 0)} \u2022 `}
380
400
  </OText>
381
- ) : (
401
+ )}
402
+ {!hideTime && (
403
+ <>
404
+ {orderState?.options?.type === 1 ? (
405
+ <OText color={theme.colors.textSecondary} size={12} style={styles.metadata}>
406
+ {convertHoursToMinutes(business?.delivery_time) + ` \u2022 `}
407
+ </OText>
408
+ ) : (
409
+ <OText color={theme.colors.textSecondary} size={12} style={styles.metadata}>
410
+ {convertHoursToMinutes(business?.pickup_time) + ` \u2022 `}
411
+ </OText>
412
+ )}
413
+ </>
414
+ )}
415
+ {!hideDistance && (
382
416
  <OText color={theme.colors.textSecondary} size={12} style={styles.metadata}>
383
- {convertHoursToMinutes(business?.pickup_time) + ` \u2022 `}
417
+ {parseDistance(business?.distance || 0) + ` \u2022 `}
384
418
  </OText>
385
419
  )}
386
- <OText color={theme.colors.textSecondary} size={12} style={styles.metadata}>
387
- {parseDistance(business?.distance || 0) + ` \u2022 `}
388
- </OText>
389
- </View>
390
-
391
- <View style={styles.reviewStyle}>
392
- <OIcon
393
- src={theme.images.general.star}
394
- width={14}
395
- color={theme.colors.textSecondary}
396
- style={{ marginTop: -2, marginEnd: 2 }}
397
- />
398
- <OText size={12} color={theme.colors.textSecondary}>
399
- {business?.reviews?.total}
400
- </OText>
401
420
  </View>
421
+ {!hideReviews && (
422
+ <View style={styles.reviewStyle}>
423
+ <OIcon
424
+ src={theme.images.general.star}
425
+ width={14}
426
+ color={theme.colors.textSecondary}
427
+ style={{ marginTop: -2, marginEnd: 2 }}
428
+ />
429
+ <OText size={12} color={theme.colors.textSecondary}>
430
+ {business?.reviews?.total}
431
+ </OText>
432
+ </View>
433
+ )}
402
434
  </BusinessInfoItem>
403
435
  </View>
404
436
  <WrapReviews>
@@ -407,18 +439,28 @@ export const BusinessBasicInformation = (
407
439
  {isPreOrder && (!business?.professionals || business?.professionals?.length === 0) && (
408
440
  <>
409
441
  <TouchableOpacity onPress={() => navigation.navigate('BusinessPreorder', { business: businessState?.business, handleBusinessClick: () => navigation?.goBack() })}>
410
- <OText color={theme.colors.textSecondary} style={{ textDecorationLine: 'underline' }}>
442
+ <OText
443
+ color={theme.colors.primary}
444
+ style={{ textDecorationColor: theme.colors.primary, textDecorationLine: 'underline' }}
445
+ size={12}
446
+ >
411
447
  {t('PREORDER', 'Preorder')}
412
448
  </OText>
413
449
  </TouchableOpacity>
414
450
  <OText size={12} color={theme.colors.textSecondary}>{' \u2022 '}</OText>
415
451
  </>
416
452
  )}
417
- <TouchableOpacity onPress={() => handleClickBusinessReviews()}>
418
- <OText color={theme.colors.textSecondary} style={{ textDecorationLine: 'underline' }}>
419
- {t('REVIEWS', 'Reviews')}
420
- </OText>
421
- </TouchableOpacity>
453
+ {!hideReviewsPopup && (
454
+ <TouchableOpacity onPress={() => handleClickBusinessReviews()}>
455
+ <OText
456
+ color={theme.colors.primary}
457
+ style={{ textDecorationColor: theme.colors.primary, textDecorationLine: 'underline' }}
458
+ size={12}
459
+ >
460
+ {t('REVIEWS', 'Reviews')}
461
+ </OText>
462
+ </TouchableOpacity>
463
+ )}
422
464
  </>
423
465
  )}
424
466
  </WrapReviews>
@@ -44,13 +44,10 @@ export const WrapBusinessInfo = styled.TouchableOpacity`
44
44
 
45
45
  export const TitleWrapper = styled.View`
46
46
  width: 100%;
47
- flex-direction: row;
48
- align-items: center;
49
- justify-content: space-between;
47
+ flex-direction: column;
50
48
  `
51
49
 
52
50
  export const RibbonBox = styled.View`
53
- margin-left: 5px;
54
51
  background-color: ${(props: any) => props.theme.colors.primary};
55
52
  padding: 2px 8px;
56
53
  max-width: 180px;
@@ -11,27 +11,28 @@ import {
11
11
  ToastType
12
12
  } from 'ordering-components/native';
13
13
  import { OIcon, OText } from '../shared';
14
- import { StyleSheet, TouchableOpacity, View, Animated } from 'react-native';
14
+ import { Dimensions, StyleSheet, Vibration, View } from 'react-native';
15
15
  import { InView } from 'react-native-intersection-observer'
16
16
  import { BusinessControllerParams } from '../../types';
17
17
  import { convertHoursToMinutes, shape } from '../../utils';
18
+
18
19
  import {
19
- Card,
20
20
  BusinessHero,
21
21
  BusinessContent,
22
- BusinessCategory,
23
22
  BusinessInfo,
24
23
  Metadata,
25
24
  BusinessState,
26
25
  BusinessLogo,
27
26
  Reviews,
28
27
  RibbonBox,
29
- ReviewAndFavorite
28
+ ReviewAndFavorite,
29
+ OfferBox
30
30
  } from './styles';
31
31
  import { useTheme } from 'styled-components/native';
32
32
  import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome5';
33
- import IconAntDesign from 'react-native-vector-icons/AntDesign'
34
33
  import FastImage from 'react-native-fast-image'
34
+ import { LottieAnimation } from '../LottieAnimation';
35
+ import { CardAnimation } from '../shared/CardAnimation';
35
36
 
36
37
  export const BusinessControllerUI = (props: BusinessControllerParams) => {
37
38
  const {
@@ -40,6 +41,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
40
41
  navigation,
41
42
  isBusinessOpen,
42
43
  style,
44
+ isCustomLayout,
43
45
  businessHeader,
44
46
  businessFeatured,
45
47
  businessLogo,
@@ -49,18 +51,31 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
49
51
  businessPickupTime,
50
52
  businessDistance,
51
53
  handleFavoriteBusiness,
52
- enableIntersection
54
+ enableIntersection,
55
+ getBusinessOffer
53
56
  } = props;
57
+
54
58
  const [{ parsePrice, parseDistance, parseNumber, optimizeImage }] = useUtils();
55
59
  const [, { showToast }] = useToast()
56
60
  const [orderState] = useOrder();
57
- const [ { auth }] = useSession()
61
+ const [{ auth }] = useSession()
58
62
  const [configState] = useConfig();
59
63
  const [, t] = useLanguage();
60
64
  const theme = useTheme()
65
+ const windowHeight = Dimensions.get('window').height
61
66
  const [isIntersectionObserver, setIsIntersectionObserver] = useState(!enableIntersection)
62
67
 
68
+ const textSize = isCustomLayout ? 12 : 10
69
+ const cardHeight = windowHeight * 0.3
70
+
63
71
  const styles = StyleSheet.create({
72
+ container: {
73
+ marginVertical: 20,
74
+ borderRadius: 7.6,
75
+ width: '100%',
76
+ position: 'relative',
77
+ height: cardHeight
78
+ },
64
79
  headerStyle: {
65
80
  borderTopLeftRadius: 7.6,
66
81
  borderTopRightRadius: 7.6,
@@ -110,7 +125,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
110
125
  flexDirection: 'row',
111
126
  alignItems: 'center',
112
127
  justifyContent: 'flex-start',
113
- },
128
+ }
114
129
  });
115
130
 
116
131
  const types = ['food', 'laundry', 'alcohol', 'groceries'];
@@ -127,6 +142,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
127
142
  };
128
143
 
129
144
  const handleBusinessClick = (selectedBusiness: any) => {
145
+ Vibration.vibrate()
130
146
  if (business?.open) handleClick && handleClick(selectedBusiness)
131
147
  else {
132
148
  if (configState?.configs?.preorder_status_enabled?.value === '1') {
@@ -152,7 +168,10 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
152
168
  return (
153
169
  <InView style={{ minHeight: 200 }} triggerOnce={true} onChange={(inView: boolean) => handleChangeInterSection(inView)}>
154
170
  {isIntersectionObserver ? (
155
- <Card activeOpacity={1} onPress={() => handleBusinessClick(business)} style={style}>
171
+ <CardAnimation
172
+ style={[style, styles.container]}
173
+ onClick={() => handleBusinessClick(business)}
174
+ >
156
175
  {business?.ribbon?.enabled && (
157
176
  <RibbonBox
158
177
  bgColor={business?.ribbon?.color}
@@ -173,11 +192,11 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
173
192
  )}
174
193
  <BusinessHero>
175
194
  <FastImage
176
- style={{ height: 120 }}
177
- source={{
195
+ style={{ height: isCustomLayout ? cardHeight * 0.66 : 120 }}
196
+ source={(businessHeader || business?.header) ? {
178
197
  uri: optimizeImage(businessHeader || business?.header, 'h_500,c_limit'),
179
198
  priority: FastImage.priority.normal,
180
- }}
199
+ } : theme.images.dummies.businessHeader}
181
200
  resizeMode={FastImage.resizeMode.cover}
182
201
  />
183
202
  {(businessFeatured ?? business?.featured) && (
@@ -185,6 +204,18 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
185
204
  <FontAwesomeIcon name="crown" size={26} color="gold" />
186
205
  </View>
187
206
  )}
207
+ {(!isCustomLayout) && (
208
+ getBusinessOffer((business?.offers)) &&
209
+ <OfferBox>
210
+ <OText
211
+ size={10}
212
+ weight={'400'}
213
+ numberOfLines={2}
214
+ ellipsizeMode='tail'
215
+ lineHeight={13}
216
+ >{getBusinessOffer((business?.offers)) || parsePrice(0)}</OText>
217
+ </OfferBox>
218
+ )}
188
219
  <BusinessState>
189
220
  {!isBusinessOpen && (configState?.configs?.preorder_status_enabled?.value === '1') && (
190
221
  <View style={styles.businessStateView}>
@@ -199,49 +230,71 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
199
230
  </BusinessState>
200
231
  </BusinessHero>
201
232
  <BusinessContent>
202
- <BusinessInfo>
233
+ <BusinessInfo style={isCustomLayout && { position: 'absolute', bottom: 85, left: 15 }}>
203
234
  <BusinessLogo style={styles.businessLogo}>
204
235
  <FastImage
205
236
  style={{ width: 56, height: 56 }}
206
- source={{
237
+ source={(businessLogo || business?.logo) ? {
207
238
  uri: optimizeImage(businessLogo || business?.logo, 'h_150,c_limit'),
208
239
  priority: FastImage.priority.normal,
209
- }}
240
+ } : theme.images.dummies.businessLogo}
210
241
  resizeMode={FastImage.resizeMode.cover}
211
242
  />
212
243
  </BusinessLogo>
213
- <ReviewAndFavorite>
214
- {(businessReviews?.reviews?.total > 0 ?? business?.reviews?.total > 0) && (
215
- <Reviews>
216
- <OIcon src={theme.images.general.star} width={12} style={styles.starIcon} />
217
- <OText size={10} style={{ lineHeight: 15 }}>
218
- {parseNumber(businessReviews?.reviews?.total ?? business?.reviews?.total, { separator: '.' })}
219
- </OText>
220
- </Reviews>
221
- )}
222
- <TouchableOpacity
223
- onPress={handleChangeFavorite}
224
- >
225
- <IconAntDesign
226
- name={business?.favorite ? 'heart' : 'hearto'}
227
- color={theme.colors.danger5}
228
- size={18}
244
+ {!isCustomLayout && (
245
+ <ReviewAndFavorite>
246
+ {(businessReviews?.reviews?.total > 0 ?? business?.reviews?.total > 0) && (
247
+ <Reviews>
248
+ <OIcon src={theme.images.general.star} width={12} style={styles.starIcon} />
249
+ <OText size={10} style={{ lineHeight: 15 }}>
250
+ {parseNumber(businessReviews?.reviews?.total ?? business?.reviews?.total, { separator: '.' })}
251
+ </OText>
252
+ </Reviews>
253
+ )}
254
+ <LottieAnimation
255
+ type='favorite'
256
+ onClick={handleChangeFavorite}
257
+ initialValue={business?.favorite ? 0.75 : 0}
258
+ toValue={business?.favorite ? 0 : 0.75}
259
+ disableAnimation={!auth}
260
+ iconProps={{ color: theme.colors.danger5, size: 18 }}
261
+ isActive={business?.favorite}
229
262
  />
230
- </TouchableOpacity>
231
- </ReviewAndFavorite>
263
+ </ReviewAndFavorite>
264
+ )}
232
265
  </BusinessInfo>
233
- <OText
234
- size={12}
235
- style={{ lineHeight: 18, marginBottom: 6 }}
236
- weight={'500'}>
237
- {business?.name}
238
- </OText>
239
- <OText size={10} style={{ lineHeight: 15, marginBottom: 3 }}>
266
+ <View style={isCustomLayout && { width: '100%', flexDirection: 'row', justifyContent: 'space-between', marginTop: 5 }}>
267
+ <OText
268
+ size={textSize + 2}
269
+ style={{ lineHeight: 18, marginBottom: 6 }}
270
+ weight={'500'}>
271
+ {business?.name}
272
+ </OText>
273
+ {isCustomLayout && (
274
+ <ReviewAndFavorite>
275
+ {(businessReviews?.reviews?.total > 0 ?? business?.reviews?.total > 0) && (
276
+ <Reviews>
277
+ <OIcon src={theme.images.general.star} width={12} style={styles.starIcon} />
278
+ <OText size={10} style={{ lineHeight: 15 }}>
279
+ {parseNumber(businessReviews?.reviews?.total ?? business?.reviews?.total, { separator: '.' })}
280
+ </OText>
281
+ </Reviews>
282
+ )}
283
+ <LottieAnimation
284
+ type='favorite'
285
+ onClick={handleChangeFavorite}
286
+ initialValue={business?.favorite ? 0.75 : 0}
287
+ toValue={business?.favorite ? 0 : 0.75}
288
+ disableAnimation={!auth}
289
+ iconProps={{ color: theme.colors.danger5, size: 18 }}
290
+ isActive={business?.favorite}
291
+ />
292
+ </ReviewAndFavorite>
293
+ )}
294
+ </View>
295
+ <OText size={textSize} style={{ lineHeight: 15, marginBottom: 3 }} numberOfLines={isCustomLayout ? 1 : 2}>
240
296
  {business?.address}
241
297
  </OText>
242
- {/* <BusinessCategory>
243
- <OText>{getBusinessType()}</OText>
244
- </BusinessCategory> */}
245
298
  <Metadata>
246
299
  {!isBusinessOpen ? (
247
300
  <View style={styles.closed}>
@@ -252,21 +305,21 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
252
305
  ) : (
253
306
  <View style={styles.bullet}>
254
307
  {orderState?.options?.type === 1 && (
255
- <OText size={10} color={theme.colors.textSecondary}>
308
+ <OText size={textSize} color={theme.colors.textSecondary}>
256
309
  {`${t('DELIVERY_FEE', 'Delivery fee')} ${parsePrice(businessDeliveryPrice ?? business?.delivery_price) + ' \u2022 '}`}
257
310
  </OText>
258
311
  )}
259
- <OText size={10} color={theme.colors.textSecondary}>{`${convertHoursToMinutes(
312
+ <OText size={textSize} color={theme.colors.textSecondary}>{`${convertHoursToMinutes(
260
313
  orderState?.options?.type === 1
261
314
  ? (businessDeliveryTime ?? business?.delivery_time)
262
315
  : (businessPickupTime ?? business?.pickup_time),
263
316
  )} \u2022 `}</OText>
264
- <OText size={10} color={theme.colors.textSecondary}>{parseDistance(businessDistance ?? business?.distance)}</OText>
317
+ <OText size={textSize} color={theme.colors.textSecondary}>{parseDistance(businessDistance ?? business?.distance)}</OText>
265
318
  </View>
266
319
  )}
267
320
  </Metadata>
268
321
  </BusinessContent>
269
- </Card>
322
+ </CardAnimation>
270
323
  ) : (
271
324
  <Placeholder
272
325
  Animation={Fade}
@@ -1,12 +1,5 @@
1
1
  import styled, { css } from 'styled-components/native';
2
2
 
3
- export const Card = styled.TouchableOpacity`
4
- margin-vertical: 20px;
5
- border-radius: 7.6px;
6
- width: 100%;
7
- position: relative;
8
- `
9
-
10
3
  export const BusinessHero = styled.View`
11
4
  position: relative;
12
5
  border-top-right-radius: 7.6px;
@@ -16,7 +9,7 @@ export const BusinessHero = styled.View`
16
9
 
17
10
  export const BusinessContent = styled.View`
18
11
  padding-horizontal: 18px;
19
- padding-bottom: 18px;
12
+ padding-bottom: 10px;
20
13
  border-bottom-left-radius: 7.6px;
21
14
  border-bottom-right-radius: 7.6px;
22
15
  border-width: 1px;
@@ -46,7 +39,7 @@ export const BusinessState = styled.View`
46
39
  `
47
40
 
48
41
  export const BusinessLogo = styled.View`
49
-
42
+
50
43
  `
51
44
 
52
45
  export const ReviewAndFavorite = styled.View`
@@ -80,3 +73,15 @@ export const RibbonBox = styled.View`
80
73
  border-radius: 50px;
81
74
  `}
82
75
  `
76
+
77
+ export const OfferBox = styled.View`
78
+ position: absolute;
79
+ z-index: 1;
80
+ top: 20px;
81
+ right: 10px;
82
+ border-radius: 50px;
83
+ color: ${(props: any) => props.theme.colors.textThird};
84
+ background: ${(props: any) => props.theme.colors.inputBorderColor};
85
+ padding: 3px 8px;
86
+ max-width: 180px;
87
+ `
@@ -16,26 +16,19 @@ import {
16
16
  DivideView,
17
17
  MediaWrapper,
18
18
  } from './styles';
19
- import { Platform, StyleSheet, View } from 'react-native';
19
+ import { StyleSheet, View } from 'react-native';
20
20
  import { BusinessInformationParams } from '../../types';
21
21
  import { GoogleMap } from '../GoogleMap';
22
22
  import { WebView } from 'react-native-webview';
23
23
  import { formatUrlVideo } from '../../utils'
24
+ import { ScheduleAccordion } from '../ScheduleAccordion';
24
25
  const BusinessInformationUI = (props: BusinessInformationParams) => {
25
26
  const { businessState, businessSchedule, businessLocation } = props;
26
27
 
27
28
  const theme = useTheme();
28
29
  const [, t] = useLanguage();
29
30
  const [{ optimizeImage }] = useUtils();
30
- const daysOfWeek = [
31
- t('SUNDAY_ABBREVIATION', 'Sun'),
32
- t('MONDAY_ABBREVIATION', 'Mon'),
33
- t('TUESDAY_ABBREVIATION', 'Tues'),
34
- t('WEDNESDAY_ABBREVIATION', 'Wed'),
35
- t('THURSDAY_ABBREVIATION', 'Thur'),
36
- t('FRIDAY_ABBREVIATION', 'Fri'),
37
- t('SATURDAY_ABBREVIATION', 'Sat'),
38
- ];
31
+
39
32
  const scheduleFormatted = ({
40
33
  hour,
41
34
  minute,
@@ -112,25 +105,11 @@ const BusinessInformationUI = (props: BusinessInformationParams) => {
112
105
  <WrapScheduleBlock>
113
106
  {businessSchedule.map((schedule: any, i: number) => (
114
107
  <ScheduleBlock key={i}>
115
- <OText
116
- lineHeight={21}
117
- mBottom={16}
118
- size={14}
119
- weight={Platform.OS === 'android' ? 'bold' : '600'}
120
- style={{ flexBasis: '20%' }}>
121
- {daysOfWeek[i].toUpperCase()}
122
- </OText>
123
- {schedule.enabled ? (
124
- <OText mBottom={16}>
125
- {scheduleFormatted(schedule.lapses[0].open) +
126
- ' - ' +
127
- scheduleFormatted(schedule.lapses[0].close)}
128
- </OText>
129
- ) : (
130
- <OText color={theme.colors.red} mBottom={16}>
131
- {t('CLOSED', 'Closed')}
132
- </OText>
133
- )}
108
+ <ScheduleAccordion
109
+ weekIndex={i}
110
+ scheduleFormatted={scheduleFormatted}
111
+ schedule={schedule}
112
+ />
134
113
  </ScheduleBlock>
135
114
  ))}
136
115
  </WrapScheduleBlock>
@@ -152,10 +131,10 @@ const BusinessInformationUI = (props: BusinessInformationParams) => {
152
131
  style={{ width: 210, height: 127, borderRadius: 7.6 }}
153
132
  javaScriptEnabled={true}
154
133
  domStorageEnabled={true}
155
- source={{
134
+ source={{
156
135
  html: `
157
136
  <iframe width='80%' height='80%' src="${formatUrlVideo(v.video)}" frameBorder='0' allow='autoplay; encrypted-media' allowFullScreen />
158
- `,
137
+ `,
159
138
  }}
160
139
  mediaPlaybackRequiresUserAction={true}
161
140
  />