ordering-ui-react-native 0.17.13 → 0.17.14-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 (211) hide show
  1. package/package.json +5 -7
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/BusinessesListing/index.tsx +1 -1
  4. package/src/components/OrderCreating/index.tsx +1 -21
  5. package/src/components/PaymentOptionsWebView/index.tsx +119 -120
  6. package/src/components/StripeMethodForm/index.tsx +108 -77
  7. package/src/components/VerifyPhone/styles.tsx +1 -2
  8. package/src/components/shared/OToast.tsx +4 -4
  9. package/src/types/index.tsx +5 -0
  10. package/src/utils/index.tsx +7 -1
  11. package/themes/business/index.tsx +2 -0
  12. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +265 -240
  13. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
  14. package/themes/business/src/components/BusinessController/index.tsx +0 -1
  15. package/themes/business/src/components/Chat/index.tsx +118 -107
  16. package/themes/business/src/components/DriverMap/index.tsx +17 -7
  17. package/themes/business/src/components/GoogleMap/index.tsx +58 -57
  18. package/themes/business/src/components/LoginForm/Otp/index.tsx +120 -0
  19. package/themes/business/src/components/LoginForm/Otp/styles.tsx +7 -0
  20. package/themes/business/src/components/LoginForm/index.tsx +238 -80
  21. package/themes/business/src/components/LoginForm/styles.tsx +10 -0
  22. package/themes/business/src/components/MapView/index.tsx +10 -10
  23. package/themes/business/src/components/NewOrderNotification/index.tsx +43 -50
  24. package/themes/business/src/components/OrderDetails/Delivery.tsx +4 -3
  25. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +90 -47
  26. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +59 -62
  27. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +195 -0
  28. package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
  29. package/themes/business/src/components/OrderMessage/index.tsx +18 -17
  30. package/themes/business/src/components/OrderSummary/index.tsx +113 -121
  31. package/themes/business/src/components/OrdersOption/index.tsx +32 -75
  32. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +250 -0
  33. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
  34. package/themes/business/src/components/PreviousOrders/index.tsx +445 -243
  35. package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
  36. package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
  37. package/themes/business/src/components/ReviewCustomer/index.tsx +41 -24
  38. package/themes/business/src/components/StoresList/index.tsx +2 -2
  39. package/themes/business/src/components/shared/OLink.tsx +33 -13
  40. package/themes/business/src/components/shared/OModal.tsx +16 -9
  41. package/themes/business/src/components/shared/OText.tsx +8 -2
  42. package/themes/business/src/types/index.tsx +32 -2
  43. package/themes/business/src/utils/index.tsx +44 -1
  44. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  45. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  46. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  47. package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
  48. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  49. package/themes/kiosk/src/components/LoginForm/Otp/index.tsx +92 -0
  50. package/themes/kiosk/src/components/LoginForm/Otp/styles.tsx +7 -0
  51. package/themes/kiosk/src/components/LoginForm/index.tsx +473 -151
  52. package/themes/kiosk/src/components/LoginForm/styles.tsx +14 -1
  53. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  54. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  55. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  56. package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +3 -2
  57. package/themes/kiosk/src/components/PhoneInputNumber/styles.tsx +1 -3
  58. package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
  59. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  60. package/themes/kiosk/src/components/shared/OModal.tsx +14 -11
  61. package/themes/kiosk/src/layouts/Container.tsx +7 -1
  62. package/themes/kiosk/src/types/index.d.ts +13 -0
  63. package/themes/kiosk/src/utils/index.tsx +15 -0
  64. package/themes/original/index.tsx +10 -2
  65. package/themes/original/src/components/AddressDetails/index.tsx +29 -11
  66. package/themes/original/src/components/AddressForm/index.tsx +41 -16
  67. package/themes/original/src/components/AddressList/index.tsx +26 -21
  68. package/themes/original/src/components/AddressList/styles.tsx +4 -2
  69. package/themes/original/src/components/AnalyticsSegment/index.tsx +195 -12
  70. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  71. package/themes/original/src/components/BusinessBasicInformation/index.tsx +125 -82
  72. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +9 -4
  73. package/themes/original/src/components/BusinessController/index.tsx +145 -68
  74. package/themes/original/src/components/BusinessController/styles.tsx +22 -9
  75. package/themes/original/src/components/BusinessFeaturedController/index.tsx +21 -54
  76. package/themes/original/src/components/BusinessFeaturedController/styles.tsx +8 -0
  77. package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
  78. package/themes/original/src/components/BusinessItemAccordion/index.tsx +23 -22
  79. package/themes/original/src/components/BusinessListingSearch/index.tsx +350 -323
  80. package/themes/original/src/components/BusinessPreorder/index.tsx +97 -16
  81. package/themes/original/src/components/BusinessProductsList/index.tsx +20 -11
  82. package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
  83. package/themes/original/src/components/BusinessProductsListing/index.tsx +617 -492
  84. package/themes/original/src/components/BusinessProductsListing/styles.tsx +7 -13
  85. package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
  86. package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -3
  87. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  88. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +105 -78
  89. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
  90. package/themes/original/src/components/BusinessesListing/index.tsx +5 -3
  91. package/themes/original/src/components/Cart/index.tsx +88 -43
  92. package/themes/original/src/components/CartContent/index.tsx +110 -19
  93. package/themes/original/src/components/CartContent/styles.tsx +15 -1
  94. package/themes/original/src/components/Checkout/index.tsx +323 -178
  95. package/themes/original/src/components/Checkout/styles.tsx +4 -2
  96. package/themes/original/src/components/CitiesControl/index.tsx +89 -0
  97. package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
  98. package/themes/original/src/components/CouponControl/index.tsx +10 -3
  99. package/themes/original/src/components/DriverTips/index.tsx +52 -37
  100. package/themes/original/src/components/DriverTips/styles.tsx +2 -1
  101. package/themes/original/src/components/Favorite/index.tsx +7 -4
  102. package/themes/original/src/components/Favorite/styles.tsx +1 -1
  103. package/themes/original/src/components/FavoriteList/index.tsx +51 -80
  104. package/themes/original/src/components/FloatingButton/index.tsx +1 -2
  105. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  106. package/themes/original/src/components/GPSButton/styles.ts +3 -3
  107. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +96 -0
  108. package/themes/original/src/components/GiftCard/GiftCardUI/styles.tsx +5 -0
  109. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +100 -0
  110. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +8 -0
  111. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +178 -0
  112. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +8 -0
  113. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +165 -0
  114. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +9 -0
  115. package/themes/original/src/components/Help/index.tsx +8 -8
  116. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +11 -22
  117. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +6 -0
  118. package/themes/original/src/components/HelpGuide/index.tsx +12 -16
  119. package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
  120. package/themes/original/src/components/HelpOrder/index.tsx +12 -25
  121. package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
  122. package/themes/original/src/components/Home/index.tsx +13 -4
  123. package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
  124. package/themes/original/src/components/LastOrder/index.tsx +1 -34
  125. package/themes/original/src/components/LoginForm/Otp/index.tsx +89 -73
  126. package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
  127. package/themes/original/src/components/LoginForm/index.tsx +48 -19
  128. package/themes/original/src/components/LottieAnimation/index.tsx +78 -0
  129. package/themes/original/src/components/MessageListing/index.tsx +16 -42
  130. package/themes/original/src/components/Messages/index.tsx +32 -10
  131. package/themes/original/src/components/MomentOption/index.tsx +195 -88
  132. package/themes/original/src/components/MultiCart/index.tsx +50 -0
  133. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +195 -116
  134. package/themes/original/src/components/MultiCheckout/index.tsx +262 -83
  135. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
  136. package/themes/original/src/components/MultiOrdersDetails/index.tsx +67 -20
  137. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
  138. package/themes/original/src/components/MyOrders/index.tsx +66 -17
  139. package/themes/original/src/components/NavBar/index.tsx +6 -11
  140. package/themes/original/src/components/Notifications/index.tsx +144 -0
  141. package/themes/original/src/components/Notifications/styles.tsx +20 -0
  142. package/themes/original/src/components/OrderDetails/OrderEta.tsx +61 -0
  143. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +10 -3
  144. package/themes/original/src/components/OrderDetails/index.tsx +262 -347
  145. package/themes/original/src/components/OrderDetails/styles.tsx +10 -1
  146. package/themes/original/src/components/OrderItAgain/index.tsx +47 -43
  147. package/themes/original/src/components/OrderProgress/index.tsx +74 -112
  148. package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
  149. package/themes/original/src/components/OrderSummary/index.tsx +67 -29
  150. package/themes/original/src/components/OrderTypeSelector/index.tsx +3 -2
  151. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +28 -19
  152. package/themes/original/src/components/OrdersOption/index.tsx +99 -89
  153. package/themes/original/src/components/PageBanner/index.tsx +171 -0
  154. package/themes/original/src/components/PageBanner/styles.tsx +11 -0
  155. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
  156. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  157. package/themes/original/src/components/PaymentOptions/index.tsx +34 -6
  158. package/themes/original/src/components/PhoneInputNumber/index.tsx +3 -3
  159. package/themes/original/src/components/PlaceSpot/index.tsx +12 -6
  160. package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
  161. package/themes/original/src/components/ProductForm/index.tsx +231 -253
  162. package/themes/original/src/components/ProductForm/styles.tsx +4 -7
  163. package/themes/original/src/components/ProductItemAccordion/index.tsx +197 -138
  164. package/themes/original/src/components/ProductOptionSubOption/index.tsx +18 -10
  165. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +1 -2
  166. package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
  167. package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -50
  168. package/themes/original/src/components/ProfessionalProfile/index.tsx +36 -7
  169. package/themes/original/src/components/Promotions/index.tsx +234 -220
  170. package/themes/original/src/components/Promotions/styles.tsx +10 -3
  171. package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
  172. package/themes/original/src/components/ReviewOrder/index.tsx +26 -9
  173. package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
  174. package/themes/original/src/components/ReviewProducts/index.tsx +7 -4
  175. package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
  176. package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
  177. package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
  178. package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
  179. package/themes/original/src/components/ServiceForm/index.tsx +358 -275
  180. package/themes/original/src/components/Sessions/index.tsx +11 -8
  181. package/themes/original/src/components/Sessions/styles.tsx +5 -0
  182. package/themes/original/src/components/SignupForm/index.tsx +82 -67
  183. package/themes/original/src/components/SingleOrderCard/index.tsx +148 -62
  184. package/themes/original/src/components/SingleOrderCard/styles.tsx +11 -9
  185. package/themes/original/src/components/SingleProductCard/index.tsx +99 -55
  186. package/themes/original/src/components/SingleProductCard/styles.tsx +27 -13
  187. package/themes/original/src/components/SingleProductReview/index.tsx +8 -2
  188. package/themes/original/src/components/SingleProductReview/styles.tsx +1 -1
  189. package/themes/original/src/components/StripeCardsList/index.tsx +9 -2
  190. package/themes/original/src/components/StripeElementsForm/index.tsx +28 -15
  191. package/themes/original/src/components/UpsellingProducts/index.tsx +238 -218
  192. package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
  193. package/themes/original/src/components/UserDetails/index.tsx +8 -4
  194. package/themes/original/src/components/UserFormDetails/index.tsx +53 -54
  195. package/themes/original/src/components/UserProfile/index.tsx +58 -35
  196. package/themes/original/src/components/UserProfile/styles.ts +17 -0
  197. package/themes/original/src/components/UserProfileForm/index.tsx +21 -28
  198. package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
  199. package/themes/original/src/components/Wallets/index.tsx +31 -17
  200. package/themes/original/src/components/Wallets/styles.tsx +2 -0
  201. package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
  202. package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
  203. package/themes/original/src/components/shared/OBottomPopup.tsx +1 -1
  204. package/themes/original/src/components/shared/OButton.tsx +6 -2
  205. package/themes/original/src/components/shared/OIcon.tsx +8 -1
  206. package/themes/original/src/components/shared/OInput.tsx +10 -1
  207. package/themes/original/src/components/shared/OModal.tsx +3 -3
  208. package/themes/original/src/layouts/Container.tsx +13 -9
  209. package/themes/original/src/types/index.tsx +43 -9
  210. package/themes/original/src/utils/index.tsx +375 -58
  211. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -5,7 +5,7 @@ import { useUtils, useOrder, useLanguage } from 'ordering-components/native';
5
5
  import { useTheme } from 'styled-components/native';
6
6
  import { OIcon, OText, OModal } from '../shared';
7
7
  import { BusinessBasicInformationParams } from '../../types';
8
- import { convertHoursToMinutes, shape } from '../../utils';
8
+ import { convertHoursToMinutes, lightenDarkenColor, shape } from '../../utils';
9
9
  import MaterialComIcon from 'react-native-vector-icons/MaterialCommunityIcons'
10
10
  import dayjs from 'dayjs';
11
11
  import timezone from 'dayjs/plugin/timezone';
@@ -46,8 +46,16 @@ export const BusinessBasicInformation = (
46
46
  const [openBusinessReviews, setOpenBusinessReviews] = useState(false);
47
47
  const [businessInformationObtained, setBusinessInformationObtained] = useState(false)
48
48
  const [businessReviewsObtained, setBusinessReviewsObtainedbtained] = useState(false)
49
- const isChewLayout = theme?.business_view?.components?.header?.components?.layout?.type === 'chew'
50
- 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
51
59
 
52
60
  const styles = StyleSheet.create({
53
61
  businesInfoheaderStyle: {
@@ -57,12 +65,12 @@ export const BusinessBasicInformation = (
57
65
  height: isChewLayout ? 170 : 260,
58
66
  },
59
67
  logoStyle: {
60
- width: 72,
61
- height: 72,
62
- borderRadius: 7.6,
63
- justifyContent: 'flex-start',
64
- alignItems: 'flex-start'
65
- },
68
+ width: 72,
69
+ height: 72,
70
+ borderRadius: 7.6,
71
+ justifyContent: 'flex-start',
72
+ alignItems: 'flex-start'
73
+ },
66
74
  businessInfo: {
67
75
  paddingHorizontal: 40,
68
76
  paddingTop: isChewLayout ? 0 : 56,
@@ -249,9 +257,13 @@ export const BusinessBasicInformation = (
249
257
  iconTitle='snapchat'
250
258
  />
251
259
  )}
252
- {isChewLayout && (
260
+ {isChewLayout && !hideInfoIcon && (
253
261
  <TouchableOpacity onPress={() => handleClickBusinessInformation()}>
254
- <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
+ >
255
267
  {t('SEE_MORE_DESCRIPTION', 'See more')}
256
268
  </OText>
257
269
  </TouchableOpacity>
@@ -263,53 +275,63 @@ export const BusinessBasicInformation = (
263
275
  }
264
276
 
265
277
  return (
266
- <BusinessContainer isChewLayout={isChewLayout && !showLogo}>
267
- <BusinessHeader
268
- isChewLayout={isChewLayout}
269
- style={
270
- isBusinessInfoShow
271
- ? styles.businesInfoheaderStyle
272
- : { ...styles.headerStyle, backgroundColor: theme.colors.backgroundGray }
273
- }
274
- {...(!loading && { source: {
275
- uri: header || optimizeImage(businessState?.business?.header || theme?.images?.dummies?.businessHeader, 'h_250,c_limit')
276
- }})}
277
- imageStyle={{ opacity: isChewLayout ? 0.5 : 1 }}
278
- >
279
- {!isBusinessInfoShow && !isChewLayout && (
280
- <WrapBusinessInfo onPress={() => handleClickBusinessInformation()}>
281
- <OIcon src={theme.images.general.info} width={24} />
282
- </WrapBusinessInfo>
283
- )}
284
- {isChewLayout && !loading && (
285
- <View style={styles.headerChewStyle}>
286
- <OText size={24} weight={'600'} mBottom={-5}>
287
- {business?.name}
288
- </OText>
289
- {business?.city?.name && (
290
- <OText>
291
- {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}
292
303
  </OText>
293
- )}
294
- <View style={styles.socialIconsChewContainer}>
295
- <SocialIcons />
304
+ {business?.city?.name && !hideCity && (
305
+ <OText>
306
+ {business?.city?.name}
307
+ </OText>
308
+ )}
309
+ <View style={styles.socialIconsChewContainer}>
310
+ <SocialIcons />
311
+ </View>
296
312
  </View>
297
- </View>
298
- )}
299
- </BusinessHeader>
313
+ )}
314
+ </BusinessHeader>
315
+ )}
300
316
  <BusinessInfo style={styles.businessInfo}>
301
- {showLogo && (
317
+ {!hideLogo && (
302
318
  <BusinessLogo isChewLayout={isChewLayout}>
303
319
  {!isBusinessInfoShow && (
304
- <FastImage
305
- style={styles.logoStyle}
306
- source={{
307
- uri: logo || optimizeImage(businessState?.business?.logo || theme?.images?.dummies?.businessLogo, 'h_70,c_limit'),
308
- priority: FastImage.priority.high,
309
- cache:FastImage.cacheControl.web
310
- }}
311
- resizeMode={FastImage.resizeMode.contain}
312
- />
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
+ />
313
335
  )}
314
336
  </BusinessLogo>
315
337
  )}
@@ -329,13 +351,15 @@ export const BusinessBasicInformation = (
329
351
  {business?.ribbon?.enabled && (
330
352
  <RibbonBox
331
353
  bgColor={business?.ribbon?.color}
354
+ colorText={lightenDarkenColor(business?.ribbon?.color)}
355
+ borderRibbon={lightenDarkenColor(business?.ribbon?.color)}
332
356
  isRoundRect={business?.ribbon?.shape === shape?.rectangleRound}
333
357
  isCapsule={business?.ribbon?.shape === shape?.capsuleShape}
334
358
  >
335
359
  <OText
336
360
  size={10}
337
361
  weight={'400'}
338
- color={theme.colors.white}
362
+ color={lightenDarkenColor(business?.ribbon?.color) ? theme.colors.black : theme.colors.white}
339
363
  numberOfLines={2}
340
364
  ellipsizeMode='tail'
341
365
  lineHeight={13}
@@ -372,34 +396,43 @@ export const BusinessBasicInformation = (
372
396
  </Placeholder>
373
397
  )}
374
398
  <View style={styles.bullet}>
375
- <OText color={theme.colors.textSecondary} size={12} style={styles.metadata}>
376
- {`${t('DELIVERY_FEE', 'Delivery fee')} ${business && parsePrice(business?.delivery_price || 0)} \u2022 `}
377
- </OText>
378
- {orderState?.options?.type === 1 ? (
399
+ {!hideDeliveryFee && (
379
400
  <OText color={theme.colors.textSecondary} size={12} style={styles.metadata}>
380
- {convertHoursToMinutes(business?.delivery_time) + ` \u2022 `}
401
+ {`${t('DELIVERY_FEE', 'Delivery fee')} ${business && parsePrice(business?.delivery_price || 0)} \u2022 `}
381
402
  </OText>
382
- ) : (
403
+ )}
404
+ {!hideTime && (
405
+ <>
406
+ {orderState?.options?.type === 1 ? (
407
+ <OText color={theme.colors.textSecondary} size={12} style={styles.metadata}>
408
+ {convertHoursToMinutes(business?.delivery_time) + ` \u2022 `}
409
+ </OText>
410
+ ) : (
411
+ <OText color={theme.colors.textSecondary} size={12} style={styles.metadata}>
412
+ {convertHoursToMinutes(business?.pickup_time) + ` \u2022 `}
413
+ </OText>
414
+ )}
415
+ </>
416
+ )}
417
+ {!hideDistance && (
383
418
  <OText color={theme.colors.textSecondary} size={12} style={styles.metadata}>
384
- {convertHoursToMinutes(business?.pickup_time) + ` \u2022 `}
419
+ {parseDistance(business?.distance || 0) + ` \u2022 `}
385
420
  </OText>
386
421
  )}
387
- <OText color={theme.colors.textSecondary} size={12} style={styles.metadata}>
388
- {parseDistance(business?.distance || 0) + ` \u2022 `}
389
- </OText>
390
- </View>
391
-
392
- <View style={styles.reviewStyle}>
393
- <OIcon
394
- src={theme.images.general.star}
395
- width={14}
396
- color={theme.colors.textSecondary}
397
- style={{ marginTop: -2, marginEnd: 2 }}
398
- />
399
- <OText size={12} color={theme.colors.textSecondary}>
400
- {business?.reviews?.total}
401
- </OText>
402
422
  </View>
423
+ {!hideReviews && (
424
+ <View style={styles.reviewStyle}>
425
+ <OIcon
426
+ src={theme.images.general.star}
427
+ width={14}
428
+ color={theme.colors.textSecondary}
429
+ style={{ marginTop: -2, marginEnd: 2 }}
430
+ />
431
+ <OText size={12} color={theme.colors.textSecondary}>
432
+ {business?.reviews?.total}
433
+ </OText>
434
+ </View>
435
+ )}
403
436
  </BusinessInfoItem>
404
437
  </View>
405
438
  <WrapReviews>
@@ -408,18 +441,28 @@ export const BusinessBasicInformation = (
408
441
  {isPreOrder && (!business?.professionals || business?.professionals?.length === 0) && (
409
442
  <>
410
443
  <TouchableOpacity onPress={() => navigation.navigate('BusinessPreorder', { business: businessState?.business, handleBusinessClick: () => navigation?.goBack() })}>
411
- <OText color={theme.colors.textSecondary} style={{ textDecorationLine: 'underline' }}>
444
+ <OText
445
+ color={theme.colors.primary}
446
+ style={{ textDecorationColor: theme.colors.primary, textDecorationLine: 'underline' }}
447
+ size={12}
448
+ >
412
449
  {t('PREORDER', 'Preorder')}
413
450
  </OText>
414
451
  </TouchableOpacity>
415
452
  <OText size={12} color={theme.colors.textSecondary}>{' \u2022 '}</OText>
416
453
  </>
417
454
  )}
418
- <TouchableOpacity onPress={() => handleClickBusinessReviews()}>
419
- <OText color={theme.colors.textSecondary} style={{ textDecorationLine: 'underline' }}>
420
- {t('REVIEWS', 'Reviews')}
421
- </OText>
422
- </TouchableOpacity>
455
+ {!hideReviewsPopup && (
456
+ <TouchableOpacity onPress={() => handleClickBusinessReviews()}>
457
+ <OText
458
+ color={theme.colors.primary}
459
+ style={{ textDecorationColor: theme.colors.primary, textDecorationLine: 'underline' }}
460
+ size={12}
461
+ >
462
+ {t('REVIEWS', 'Reviews')}
463
+ </OText>
464
+ </TouchableOpacity>
465
+ )}
423
466
  </>
424
467
  )}
425
468
  </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;
@@ -67,6 +64,14 @@ export const RibbonBox = styled.View`
67
64
  ${(props: any) => props.isCapsule && css`
68
65
  border-radius: 50px;
69
66
  `}
67
+
68
+ ${(props: any) => props.colorText && css`
69
+ color: ${props.colorText ? 'black' : 'white'};
70
+ `}
71
+
72
+ ${(props: any) => props.borderRibbon && css`
73
+ border: 1px solid ${props.borderRibbon ? 'black' : 'white'};
74
+ `}
70
75
  `
71
76
 
72
77
  export const SocialListWrapper = styled.ScrollView`
@@ -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
- import { convertHoursToMinutes, shape } from '../../utils';
17
+ import { convertHoursToMinutes, lightenDarkenColor, 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,41 @@ 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 hideBusinessLogo = theme?.business_listing_view?.components?.business?.components?.logo?.hidden
69
+ const hideBusinessFee = theme?.business_listing_view?.components?.business?.components?.fee?.hidden
70
+ const hideBusinessTime = theme?.business_listing_view?.components?.business?.components?.time?.hidden
71
+ const hideBusinessDistance = theme?.business_listing_view?.components?.business?.components?.distance?.hidden
72
+ const hideBusinessReviews = theme?.business_listing_view?.components?.business?.components?.reviews?.hidden
73
+ const hideBusinessFavorite = theme?.business_listing_view?.components?.business?.components?.favorite?.hidden
74
+ const hideBusinessOffer = theme?.business_listing_view?.components?.business?.components?.offer?.hidden
75
+ const hideBusinessHeader = theme?.business_listing_view?.components?.business?.components?.header?.hidden
76
+ const hideBusinessFavoriteBadge = theme?.business_listing_view?.components?.business?.components?.featured_badge?.hidden
77
+
78
+ const textSize = isCustomLayout ? 12 : 10
79
+ const cardHeight = windowHeight * 0.3
80
+
63
81
  const styles = StyleSheet.create({
82
+ container: {
83
+ marginVertical: 20,
84
+ borderRadius: 7.6,
85
+ width: '100%',
86
+ position: 'relative',
87
+ height: cardHeight
88
+ },
64
89
  headerStyle: {
65
90
  borderTopLeftRadius: 7.6,
66
91
  borderTopRightRadius: 7.6,
@@ -110,7 +135,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
110
135
  flexDirection: 'row',
111
136
  alignItems: 'center',
112
137
  justifyContent: 'flex-start',
113
- },
138
+ }
114
139
  });
115
140
 
116
141
  const types = ['food', 'laundry', 'alcohol', 'groceries'];
@@ -127,6 +152,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
127
152
  };
128
153
 
129
154
  const handleBusinessClick = (selectedBusiness: any) => {
155
+ Vibration.vibrate()
130
156
  if (business?.open) handleClick && handleClick(selectedBusiness)
131
157
  else {
132
158
  if (configState?.configs?.preorder_status_enabled?.value === '1') {
@@ -152,17 +178,22 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
152
178
  return (
153
179
  <InView style={{ minHeight: 200 }} triggerOnce={true} onChange={(inView: boolean) => handleChangeInterSection(inView)}>
154
180
  {isIntersectionObserver ? (
155
- <Card activeOpacity={1} onPress={() => handleBusinessClick(business)} style={style}>
181
+ <CardAnimation
182
+ style={[style, styles.container]}
183
+ onClick={() => handleBusinessClick(business)}
184
+ >
156
185
  {business?.ribbon?.enabled && (
157
186
  <RibbonBox
158
187
  bgColor={business?.ribbon?.color}
188
+ colorText={lightenDarkenColor(business?.ribbon?.color)}
189
+ borderRibbon={lightenDarkenColor(business?.ribbon?.color)}
159
190
  isRoundRect={business?.ribbon?.shape === shape?.rectangleRound}
160
191
  isCapsule={business?.ribbon?.shape === shape?.capsuleShape}
161
192
  >
162
193
  <OText
163
194
  size={10}
164
195
  weight={'400'}
165
- color={theme.colors.white}
196
+ color={lightenDarkenColor(business?.ribbon?.color) ? theme.colors.black : theme.colors.white}
166
197
  numberOfLines={2}
167
198
  ellipsizeMode='tail'
168
199
  lineHeight={13}
@@ -172,19 +203,33 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
172
203
  </RibbonBox>
173
204
  )}
174
205
  <BusinessHero>
175
- <FastImage
176
- style={{ height: 120 }}
177
- source={{
178
- uri: optimizeImage(businessHeader || business?.header || theme.images.dummies.businessHeader, 'h_500,c_limit'),
179
- priority: FastImage.priority.normal,
180
- }}
181
- resizeMode={FastImage.resizeMode.cover}
182
- />
183
- {(businessFeatured ?? business?.featured) && (
206
+ {!hideBusinessHeader && (
207
+ <FastImage
208
+ style={{ height: isCustomLayout ? cardHeight * 0.66 : 120 }}
209
+ source={(businessHeader || business?.header || typeof theme.images.dummies.businessHeader === 'string') ? {
210
+ uri: optimizeImage(businessHeader || business?.header || theme.images.dummies.businessHeader, 'h_500,c_limit'),
211
+ priority: FastImage.priority.normal,
212
+ } : theme.images.dummies.businessHeader}
213
+ resizeMode={FastImage.resizeMode.cover}
214
+ />
215
+ )}
216
+ {(businessFeatured ?? business?.featured) && !hideBusinessFavoriteBadge && (
184
217
  <View style={styles.featured}>
185
218
  <FontAwesomeIcon name="crown" size={26} color="gold" />
186
219
  </View>
187
220
  )}
221
+ {(!isCustomLayout) && !hideBusinessOffer && (
222
+ getBusinessOffer((business?.offers)) &&
223
+ <OfferBox>
224
+ <OText
225
+ size={10}
226
+ weight={'400'}
227
+ numberOfLines={2}
228
+ ellipsizeMode='tail'
229
+ lineHeight={13}
230
+ >{getBusinessOffer((business?.offers)) || parsePrice(0)}</OText>
231
+ </OfferBox>
232
+ )}
188
233
  <BusinessState>
189
234
  {!isBusinessOpen && (configState?.configs?.preorder_status_enabled?.value === '1') && (
190
235
  <View style={styles.businessStateView}>
@@ -199,49 +244,77 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
199
244
  </BusinessState>
200
245
  </BusinessHero>
201
246
  <BusinessContent>
202
- <BusinessInfo>
203
- <BusinessLogo style={styles.businessLogo}>
204
- <FastImage
205
- style={{ width: 56, height: 56 }}
206
- source={{
207
- uri: optimizeImage(businessLogo || business?.logo || theme.images.dummies.businessLogo, 'h_150,c_limit'),
208
- priority: FastImage.priority.normal,
209
- }}
210
- resizeMode={FastImage.resizeMode.cover}
211
- />
212
- </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}
247
+ <BusinessInfo style={isCustomLayout && { position: 'absolute', bottom: 85, left: 15 }}>
248
+ {!hideBusinessLogo && (
249
+ <BusinessLogo style={styles.businessLogo}>
250
+ <FastImage
251
+ style={{ width: 56, height: 56 }}
252
+ source={(businessLogo || business?.logo || typeof theme.images.dummies.businessLogo === 'string') ? {
253
+ uri: optimizeImage(businessLogo || business?.logo || theme.images.dummies.businessLogo, 'h_150,c_limit'),
254
+ priority: FastImage.priority.normal,
255
+ } : theme.images.dummies.businessLogo}
256
+ resizeMode={FastImage.resizeMode.cover}
229
257
  />
230
- </TouchableOpacity>
231
- </ReviewAndFavorite>
258
+ </BusinessLogo>
259
+ )}
260
+ {!isCustomLayout && (!hideBusinessFavorite || !hideBusinessReviews) && (
261
+ <ReviewAndFavorite>
262
+ {(businessReviews?.reviews?.total > 0 ?? business?.reviews?.total > 0) && !hideBusinessReviews && (
263
+ <Reviews>
264
+ <OIcon src={theme.images.general.star} width={12} style={styles.starIcon} />
265
+ <OText size={10} style={{ lineHeight: 15 }}>
266
+ {parseNumber(businessReviews?.reviews?.total ?? business?.reviews?.total, { separator: '.' })}
267
+ </OText>
268
+ </Reviews>
269
+ )}
270
+ {!hideBusinessFavorite && (
271
+ <LottieAnimation
272
+ type='favorite'
273
+ onClick={handleChangeFavorite}
274
+ initialValue={business?.favorite ? 0.5 : 0}
275
+ toValue={business?.favorite ? 0 : 0.5}
276
+ disableAnimation={!auth}
277
+ iconProps={{ color: theme.colors.danger5, size: 18 }}
278
+ isActive={business?.favorite}
279
+ />
280
+ )}
281
+ </ReviewAndFavorite>
282
+ )}
232
283
  </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 }}>
284
+ <View style={isCustomLayout && { width: '100%', flexDirection: 'row', justifyContent: 'space-between', marginTop: 5 }}>
285
+ <OText
286
+ size={textSize + 2}
287
+ style={{ lineHeight: 18, marginBottom: 6 }}
288
+ weight={'500'}>
289
+ {business?.name}
290
+ </OText>
291
+ {isCustomLayout && (!hideBusinessFavorite || !hideBusinessReviews) && (
292
+ <ReviewAndFavorite>
293
+ {(businessReviews?.reviews?.total > 0 ?? business?.reviews?.total > 0) && !hideBusinessReviews && (
294
+ <Reviews>
295
+ <OIcon src={theme.images.general.star} width={12} style={styles.starIcon} />
296
+ <OText size={10} style={{ lineHeight: 15 }}>
297
+ {parseNumber(businessReviews?.reviews?.total ?? business?.reviews?.total, { separator: '.' })}
298
+ </OText>
299
+ </Reviews>
300
+ )}
301
+ {!hideBusinessFavorite && (
302
+ <LottieAnimation
303
+ type='favorite'
304
+ onClick={handleChangeFavorite}
305
+ initialValue={business?.favorite ? 0.5 : 0}
306
+ toValue={business?.favorite ? 0 : 0.5}
307
+ disableAnimation={!auth}
308
+ iconProps={{ color: theme.colors.danger5, size: 18 }}
309
+ isActive={business?.favorite}
310
+ />
311
+ )}
312
+ </ReviewAndFavorite>
313
+ )}
314
+ </View>
315
+ <OText size={textSize} style={{ lineHeight: 15, marginBottom: 3 }} numberOfLines={isCustomLayout ? 1 : 2}>
240
316
  {business?.address}
241
317
  </OText>
242
- {/* <BusinessCategory>
243
- <OText>{getBusinessType()}</OText>
244
- </BusinessCategory> */}
245
318
  <Metadata>
246
319
  {!isBusinessOpen ? (
247
320
  <View style={styles.closed}>
@@ -251,22 +324,26 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
251
324
  </View>
252
325
  ) : (
253
326
  <View style={styles.bullet}>
254
- {orderState?.options?.type === 1 && (
255
- <OText size={10} color={theme.colors.textSecondary}>
327
+ {orderState?.options?.type === 1 && !hideBusinessFee && (
328
+ <OText size={textSize} color={theme.colors.textSecondary}>
256
329
  {`${t('DELIVERY_FEE', 'Delivery fee')} ${parsePrice(businessDeliveryPrice ?? business?.delivery_price) + ' \u2022 '}`}
257
330
  </OText>
258
331
  )}
259
- <OText size={10} color={theme.colors.textSecondary}>{`${convertHoursToMinutes(
260
- orderState?.options?.type === 1
261
- ? (businessDeliveryTime ?? business?.delivery_time)
262
- : (businessPickupTime ?? business?.pickup_time),
263
- )} \u2022 `}</OText>
264
- <OText size={10} color={theme.colors.textSecondary}>{parseDistance(businessDistance ?? business?.distance)}</OText>
332
+ {!hideBusinessTime && (
333
+ <OText size={textSize} color={theme.colors.textSecondary}>{`${convertHoursToMinutes(
334
+ orderState?.options?.type === 1
335
+ ? (businessDeliveryTime ?? business?.delivery_time)
336
+ : (businessPickupTime ?? business?.pickup_time),
337
+ )} \u2022 `}</OText>
338
+ )}
339
+ {!hideBusinessDistance && (
340
+ <OText size={textSize} color={theme.colors.textSecondary}>{parseDistance(businessDistance ?? business?.distance)}</OText>
341
+ )}
265
342
  </View>
266
343
  )}
267
344
  </Metadata>
268
345
  </BusinessContent>
269
- </Card>
346
+ </CardAnimation>
270
347
  ) : (
271
348
  <Placeholder
272
349
  Animation={Fade}