ordering-ui-react-native 0.17.43 → 0.17.44-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 (215) hide show
  1. package/package.json +8 -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 +29 -8
  6. package/src/components/StripeMethodForm/index.tsx +136 -102
  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 +125 -113
  16. package/themes/business/src/components/DriverMap/index.tsx +17 -6
  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 +49 -50
  24. package/themes/business/src/components/OrderDetails/Delivery.tsx +4 -3
  25. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +92 -49
  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 +35 -18
  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 +6 -0
  65. package/themes/original/src/components/AddressDetails/index.tsx +29 -11
  66. package/themes/original/src/components/AddressForm/index.tsx +79 -44
  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 +193 -10
  70. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  71. package/themes/original/src/components/AppleLogin/styles.tsx +3 -1
  72. package/themes/original/src/components/BusinessBasicInformation/index.tsx +160 -91
  73. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +9 -7
  74. package/themes/original/src/components/BusinessController/index.tsx +141 -67
  75. package/themes/original/src/components/BusinessController/styles.tsx +22 -2
  76. package/themes/original/src/components/BusinessFeaturedController/index.tsx +21 -54
  77. package/themes/original/src/components/BusinessFeaturedController/styles.tsx +8 -0
  78. package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
  79. package/themes/original/src/components/BusinessItemAccordion/index.tsx +23 -22
  80. package/themes/original/src/components/BusinessListingSearch/index.tsx +351 -326
  81. package/themes/original/src/components/BusinessPreorder/index.tsx +97 -16
  82. package/themes/original/src/components/BusinessProductsList/index.tsx +20 -11
  83. package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
  84. package/themes/original/src/components/BusinessProductsListing/UpsellingRedirect.tsx +1 -1
  85. package/themes/original/src/components/BusinessProductsListing/index.tsx +684 -524
  86. package/themes/original/src/components/BusinessProductsListing/styles.tsx +2 -4
  87. package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
  88. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  89. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +106 -79
  90. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
  91. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  92. package/themes/original/src/components/Cart/index.tsx +100 -67
  93. package/themes/original/src/components/CartContent/index.tsx +115 -19
  94. package/themes/original/src/components/CartContent/styles.tsx +17 -7
  95. package/themes/original/src/components/Checkout/index.tsx +375 -178
  96. package/themes/original/src/components/Checkout/styles.tsx +4 -2
  97. package/themes/original/src/components/CitiesControl/index.tsx +89 -0
  98. package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
  99. package/themes/original/src/components/CouponControl/index.tsx +10 -3
  100. package/themes/original/src/components/DriverTips/index.tsx +52 -34
  101. package/themes/original/src/components/FacebookLogin/styles.tsx +3 -1
  102. package/themes/original/src/components/Favorite/index.tsx +8 -9
  103. package/themes/original/src/components/Favorite/styles.tsx +1 -1
  104. package/themes/original/src/components/FavoriteList/index.tsx +51 -80
  105. package/themes/original/src/components/FloatingButton/index.tsx +1 -2
  106. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  107. package/themes/original/src/components/GPSButton/index.tsx +6 -4
  108. package/themes/original/src/components/GPSButton/styles.ts +3 -3
  109. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +96 -0
  110. package/themes/original/src/components/GiftCard/GiftCardUI/styles.tsx +5 -0
  111. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +100 -0
  112. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +8 -0
  113. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +191 -0
  114. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +8 -0
  115. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +165 -0
  116. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +9 -0
  117. package/themes/original/src/components/GoogleLogin/styles.tsx +1 -1
  118. package/themes/original/src/components/GoogleMap/index.tsx +15 -4
  119. package/themes/original/src/components/Help/index.tsx +8 -8
  120. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +10 -31
  121. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +5 -3
  122. package/themes/original/src/components/HelpGuide/index.tsx +6 -6
  123. package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
  124. package/themes/original/src/components/HelpOrder/index.tsx +6 -15
  125. package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
  126. package/themes/original/src/components/Home/index.tsx +13 -4
  127. package/themes/original/src/components/LastOrder/index.tsx +1 -34
  128. package/themes/original/src/components/LoginForm/Otp/index.tsx +139 -75
  129. package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
  130. package/themes/original/src/components/LoginForm/index.tsx +70 -27
  131. package/themes/original/src/components/LottieAnimation/index.tsx +89 -55
  132. package/themes/original/src/components/MessageListing/index.tsx +16 -42
  133. package/themes/original/src/components/Messages/index.tsx +32 -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 +151 -49
  137. package/themes/original/src/components/MultiCheckout/index.tsx +308 -88
  138. package/themes/original/src/components/MultiCheckout/styles.tsx +3 -1
  139. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
  140. package/themes/original/src/components/MultiOrdersDetails/index.tsx +68 -21
  141. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
  142. package/themes/original/src/components/MyOrders/index.tsx +53 -51
  143. package/themes/original/src/components/NavBar/index.tsx +18 -18
  144. package/themes/original/src/components/NotFoundSource/index.tsx +14 -10
  145. package/themes/original/src/components/Notifications/index.tsx +46 -50
  146. package/themes/original/src/components/Notifications/styles.tsx +6 -3
  147. package/themes/original/src/components/OrderDetails/OrderEta.tsx +76 -0
  148. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +15 -3
  149. package/themes/original/src/components/OrderDetails/index.tsx +199 -359
  150. package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
  151. package/themes/original/src/components/OrderItAgain/index.tsx +3 -1
  152. package/themes/original/src/components/OrderProgress/index.tsx +93 -114
  153. package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
  154. package/themes/original/src/components/OrderSummary/index.tsx +85 -57
  155. package/themes/original/src/components/OrderTypeSelector/index.tsx +1 -1
  156. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +24 -19
  157. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +14 -14
  158. package/themes/original/src/components/OrdersOption/index.tsx +70 -65
  159. package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
  160. package/themes/original/src/components/PageBanner/index.tsx +171 -0
  161. package/themes/original/src/components/PageBanner/styles.tsx +11 -0
  162. package/themes/original/src/components/PaymentOptionCard/index.tsx +180 -0
  163. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
  164. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  165. package/themes/original/src/components/PaymentOptions/index.tsx +64 -7
  166. package/themes/original/src/components/PhoneInputNumber/index.tsx +4 -4
  167. package/themes/original/src/components/PlaceSpot/index.tsx +12 -6
  168. package/themes/original/src/components/ProductForm/index.tsx +116 -37
  169. package/themes/original/src/components/ProductForm/styles.tsx +5 -7
  170. package/themes/original/src/components/ProductItemAccordion/index.tsx +14 -13
  171. package/themes/original/src/components/ProductOptionSubOption/index.tsx +19 -11
  172. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +1 -2
  173. package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
  174. package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -50
  175. package/themes/original/src/components/ProfessionalProfile/index.tsx +36 -7
  176. package/themes/original/src/components/Promotions/index.tsx +234 -220
  177. package/themes/original/src/components/Promotions/styles.tsx +10 -3
  178. package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
  179. package/themes/original/src/components/ReviewOrder/index.tsx +26 -9
  180. package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
  181. package/themes/original/src/components/ReviewProducts/index.tsx +23 -11
  182. package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
  183. package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
  184. package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
  185. package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
  186. package/themes/original/src/components/ServiceForm/index.tsx +74 -19
  187. package/themes/original/src/components/Sessions/index.tsx +11 -8
  188. package/themes/original/src/components/Sessions/styles.tsx +5 -0
  189. package/themes/original/src/components/SignupForm/index.tsx +42 -19
  190. package/themes/original/src/components/SingleOrderCard/index.tsx +130 -52
  191. package/themes/original/src/components/SingleOrderCard/styles.tsx +11 -2
  192. package/themes/original/src/components/SingleProductCard/index.tsx +72 -34
  193. package/themes/original/src/components/SingleProductCard/styles.tsx +22 -4
  194. package/themes/original/src/components/SingleProductReview/styles.tsx +1 -1
  195. package/themes/original/src/components/StripeCardsList/index.tsx +13 -3
  196. package/themes/original/src/components/StripeElementsForm/index.tsx +51 -34
  197. package/themes/original/src/components/UpsellingProducts/index.tsx +238 -224
  198. package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
  199. package/themes/original/src/components/UserDetails/index.tsx +8 -4
  200. package/themes/original/src/components/UserFormDetails/index.tsx +47 -7
  201. package/themes/original/src/components/UserProfile/index.tsx +5 -7
  202. package/themes/original/src/components/UserProfileForm/index.tsx +25 -28
  203. package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
  204. package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
  205. package/themes/original/src/components/WalletTransactions/index.tsx +3 -3
  206. package/themes/original/src/components/Wallets/index.tsx +67 -24
  207. package/themes/original/src/components/Wallets/styles.tsx +5 -4
  208. package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
  209. package/themes/original/src/components/shared/OButton.tsx +6 -2
  210. package/themes/original/src/components/shared/OInput.tsx +16 -2
  211. package/themes/original/src/components/shared/OModal.tsx +3 -3
  212. package/themes/original/src/layouts/Container.tsx +1 -1
  213. package/themes/original/src/types/index.tsx +38 -9
  214. package/themes/original/src/utils/index.tsx +364 -58
  215. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -21,7 +21,7 @@ export const AppleLogin = (props: any) => {
21
21
  const [{ configs }] = useConfig();
22
22
  const [credentialStateForUser, updateCredentialStateForUser] = useState<any>(-1);
23
23
 
24
- let user : any= null
24
+ let user: any = null
25
25
 
26
26
  const buttonText = auth
27
27
  ? t('CONTINUE_WITH_APPLE', 'Logout with Apple')
@@ -53,7 +53,7 @@ export const AppleLogin = (props: any) => {
53
53
  }
54
54
  }
55
55
 
56
- const fetchAndUpdateCredentialState = async (updateCredentialStateForUser : any) => {
56
+ const fetchAndUpdateCredentialState = async (updateCredentialStateForUser: any) => {
57
57
  if (user === null) {
58
58
  updateCredentialStateForUser('N/A');
59
59
  } else {
@@ -66,7 +66,7 @@ export const AppleLogin = (props: any) => {
66
66
  }
67
67
  }
68
68
 
69
- const onIOSButtonPress = async (updateCredentialStateForUser : any) => {
69
+ const onIOSButtonPress = async (updateCredentialStateForUser: any) => {
70
70
  try {
71
71
  const appleAuthRequestResponse = await appleAuth.performRequest({
72
72
  requestedOperation: appleAuth.Operation.LOGIN,
@@ -79,7 +79,7 @@ export const AppleLogin = (props: any) => {
79
79
  identityToken,
80
80
  authorizationCode
81
81
  } = appleAuthRequestResponse;
82
-
82
+
83
83
  user = newUser;
84
84
 
85
85
  fetchAndUpdateCredentialState(updateCredentialStateForUser).catch(error =>
@@ -1,6 +1,8 @@
1
1
  import styled from 'styled-components/native'
2
2
 
3
- export const Container = styled.View``
3
+ export const Container = styled.View`
4
+ margin-bottom: 20px;
5
+ `
4
6
 
5
7
  export const AppleButton = styled.TouchableOpacity`
6
8
  background-color: #FFFFFF;
@@ -1,11 +1,11 @@
1
1
  import React, { useState, useEffect } from 'react';
2
- import { StyleSheet, View, TouchableOpacity, Linking, Pressable } from 'react-native';
2
+ import { StyleSheet, View, TouchableOpacity, Linking, Pressable, Image } from 'react-native';
3
3
  import FastImage from 'react-native-fast-image'
4
4
  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';
@@ -21,7 +21,6 @@ import {
21
21
  BusinessInfo,
22
22
  BusinessInfoItem,
23
23
  WrapReviews,
24
- WrapBusinessInfo,
25
24
  TitleWrapper,
26
25
  RibbonBox,
27
26
  SocialListWrapper
@@ -46,15 +45,24 @@ export const BusinessBasicInformation = (
46
45
  const [openBusinessReviews, setOpenBusinessReviews] = useState(false);
47
46
  const [businessInformationObtained, setBusinessInformationObtained] = useState(false)
48
47
  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
48
+ const [imageRealSize, setImageRealSize] = useState({ width: 16, height: 9, loading: true })
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: {
54
62
  height: 150,
55
63
  },
56
64
  headerStyle: {
57
- height: isChewLayout ? 170 : 260,
65
+ aspectRatio: imageRealSize?.width / imageRealSize?.height
58
66
  },
59
67
  logoStyle: {
60
68
  width: 72,
@@ -93,11 +101,11 @@ export const BusinessBasicInformation = (
93
101
  borderRadius: 3,
94
102
  borderColor: theme.colors.border,
95
103
  borderWidth: isChewLayout ? 0 : 1,
96
- width: 20,
97
- height: 20,
104
+ width: 30,
105
+ height: 30,
98
106
  justifyContent: 'center',
99
107
  alignItems: 'center',
100
- marginRight: 5,
108
+ marginRight: 10,
101
109
  marginBottom: 7
102
110
  },
103
111
  tiktokIcon: {
@@ -158,7 +166,7 @@ export const BusinessBasicInformation = (
158
166
  <MaterialComIcon
159
167
  name={iconTitle}
160
168
  color={isChewLayout ? theme.colors.black : theme.colors.textNormal}
161
- size={isChewLayout ? 18 : 14}
169
+ size={isChewLayout ? 25 : 22}
162
170
  />
163
171
  </TouchableOpacity>
164
172
  )
@@ -188,6 +196,20 @@ export const BusinessBasicInformation = (
188
196
  }
189
197
  }, [businessState?.business])
190
198
 
199
+ useEffect(() => {
200
+ const bannerImage = header || businessState?.business?.header
201
+ if (!bannerImage) {
202
+ setImageRealSize({ width: 16, height: 9, loading: false })
203
+ return
204
+ }
205
+ Image.getSize(bannerImage, (width: number, height: number) => {
206
+ setImageRealSize({ width: width, height: height, loading: false });
207
+ }, (error: any) => {
208
+ setImageRealSize({ ...imageRealSize, loading: false });
209
+ console.log(error);
210
+ });
211
+ }, [header, businessState?.business?.header])
212
+
191
213
  const SocialIcons = () => {
192
214
  return (
193
215
  <>
@@ -249,9 +271,13 @@ export const BusinessBasicInformation = (
249
271
  iconTitle='snapchat'
250
272
  />
251
273
  )}
252
- {isChewLayout && (
274
+ {isChewLayout && !hideInfoIcon && (
253
275
  <TouchableOpacity onPress={() => handleClickBusinessInformation()}>
254
- <OText style={{ textDecorationColor: theme.colors.black, textDecorationLine: 'underline' }}>
276
+ <OText
277
+ color={theme.colors.primary}
278
+ style={{ textDecorationColor: theme.colors.primary, textDecorationLine: 'underline' }}
279
+ size={12}
280
+ >
255
281
  {t('SEE_MORE_DESCRIPTION', 'See more')}
256
282
  </OText>
257
283
  </TouchableOpacity>
@@ -263,61 +289,68 @@ export const BusinessBasicInformation = (
263
289
  }
264
290
 
265
291
  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 && {
275
- source: (header || businessState?.business?.header) ? {
276
- uri: header || optimizeImage(businessState?.business?.header, 'h_250,c_limit')
277
- } : theme?.images?.dummies?.businessHeader
278
- })}
279
- imageStyle={{ opacity: isChewLayout ? 0.5 : 1 }}
280
- >
281
- {!isBusinessInfoShow && !isChewLayout && (
282
- <WrapBusinessInfo onPress={() => handleClickBusinessInformation()}>
283
- <OIcon src={theme.images.general.info} width={24} />
284
- </WrapBusinessInfo>
285
- )}
286
- {isChewLayout && !loading && (
287
- <View style={styles.headerChewStyle}>
288
- <OText size={24} weight={'600'} mBottom={-5}>
289
- {business?.name}
290
- </OText>
291
- {business?.city?.name && (
292
- <OText>
293
- {business?.city?.name}
292
+ <BusinessContainer isChewLayout={isChewLayout && hideLogo}>
293
+ {!hideHeader && (
294
+ <BusinessHeader
295
+ isChewLayout={isChewLayout}
296
+ style={
297
+ isBusinessInfoShow
298
+ ? styles.businesInfoheaderStyle
299
+ : { ...styles.headerStyle, backgroundColor: theme.colors.backgroundGray }
300
+ }
301
+ {...(!loading && !imageRealSize?.loading && {
302
+ source: (header || businessState?.business?.header || typeof theme?.images?.dummies?.businessHeader === 'string') ? {
303
+ uri: optimizeImage(businessState?.business?.header, 'h_250,c_limit') || header || theme?.images?.dummies?.businessHeader
304
+ } : theme?.images?.dummies?.businessHeader
305
+ })}
306
+ imageStyle={{ opacity: isChewLayout ? 0.5 : 1 }}
307
+ >
308
+ {isChewLayout && !loading && (
309
+ <View style={styles.headerChewStyle}>
310
+ <OText size={24} weight={'600'} mBottom={-5}>
311
+ {business?.name}
294
312
  </OText>
295
- )}
296
- <View style={styles.socialIconsChewContainer}>
297
- <SocialIcons />
313
+ {business?.city?.name && !hideCity && (
314
+ <OText>
315
+ {business?.city?.name}
316
+ </OText>
317
+ )}
318
+ <View style={styles.socialIconsChewContainer}>
319
+ <SocialIcons />
320
+ </View>
298
321
  </View>
299
- </View>
300
- )}
301
- </BusinessHeader>
322
+ )}
323
+ </BusinessHeader>
324
+ )}
302
325
  <BusinessInfo style={styles.businessInfo}>
303
- {showLogo && (
326
+ {!hideLogo && (
304
327
  <BusinessLogo isChewLayout={isChewLayout}>
305
328
  {!isBusinessInfoShow && (
306
- logo || businessState?.business?.logo ?
307
- <FastImage
308
- style={styles.logoStyle}
309
- source={{
310
- uri: logo || optimizeImage(businessState?.business?.logo, 'h_70,c_limit'),
311
- priority: FastImage.priority.high,
312
- cache: FastImage.cacheControl.web
313
- }}
314
- resizeMode={FastImage.resizeMode.contain}
315
- />
316
- :
317
- <OIcon
318
- src={theme?.images?.dummies?.businessLogo}
319
- style={styles.logoStyle}
320
- />
329
+ <>
330
+ {loading ? (
331
+ <View style={styles.logoStyle}>
332
+ <Placeholder Animation={Fade}>
333
+ <PlaceholderLine height={72} style={{ borderRadius: 8 }} />
334
+ </Placeholder>
335
+ </View>
336
+ ) : (
337
+ logo || businessState?.business?.logo || typeof theme.images.dummies.businessLogo === 'string' ?
338
+ <FastImage
339
+ style={styles.logoStyle}
340
+ source={{
341
+ uri: logo || optimizeImage(businessState?.business?.logo, 'h_70,c_limit') || theme.images.dummies.businessLogo,
342
+ priority: FastImage.priority.high,
343
+ cache: FastImage.cacheControl.web
344
+ }}
345
+ resizeMode={FastImage.resizeMode.contain}
346
+ />
347
+ :
348
+ <OIcon
349
+ src={theme?.images?.dummies?.businessLogo}
350
+ style={styles.logoStyle}
351
+ />
352
+ )}
353
+ </>
321
354
  )}
322
355
  </BusinessLogo>
323
356
  )}
@@ -337,13 +370,15 @@ export const BusinessBasicInformation = (
337
370
  {business?.ribbon?.enabled && (
338
371
  <RibbonBox
339
372
  bgColor={business?.ribbon?.color}
373
+ colorText={lightenDarkenColor(business?.ribbon?.color)}
374
+ borderRibbon={lightenDarkenColor(business?.ribbon?.color)}
340
375
  isRoundRect={business?.ribbon?.shape === shape?.rectangleRound}
341
376
  isCapsule={business?.ribbon?.shape === shape?.capsuleShape}
342
377
  >
343
378
  <OText
344
379
  size={10}
345
380
  weight={'400'}
346
- color={theme.colors.white}
381
+ color={lightenDarkenColor(business?.ribbon?.color) ? theme.colors.black : theme.colors.white}
347
382
  numberOfLines={2}
348
383
  ellipsizeMode='tail'
349
384
  lineHeight={13}
@@ -380,34 +415,43 @@ export const BusinessBasicInformation = (
380
415
  </Placeholder>
381
416
  )}
382
417
  <View style={styles.bullet}>
383
- <OText color={theme.colors.textSecondary} size={12} style={styles.metadata}>
384
- {`${t('DELIVERY_FEE', 'Delivery fee')} ${business && parsePrice(business?.delivery_price || 0)} \u2022 `}
385
- </OText>
386
- {orderState?.options?.type === 1 ? (
418
+ {!hideDeliveryFee && (
387
419
  <OText color={theme.colors.textSecondary} size={12} style={styles.metadata}>
388
- {convertHoursToMinutes(business?.delivery_time) + ` \u2022 `}
420
+ {`${t('DELIVERY_FEE', 'Delivery fee')} ${business && parsePrice(business?.delivery_price || 0)} \u2022 `}
389
421
  </OText>
390
- ) : (
422
+ )}
423
+ {!hideTime && (
424
+ <>
425
+ {orderState?.options?.type === 1 ? (
426
+ <OText color={theme.colors.textSecondary} size={12} style={styles.metadata}>
427
+ {convertHoursToMinutes(business?.delivery_time) + ` \u2022 `}
428
+ </OText>
429
+ ) : (
430
+ <OText color={theme.colors.textSecondary} size={12} style={styles.metadata}>
431
+ {convertHoursToMinutes(business?.pickup_time) + ` \u2022 `}
432
+ </OText>
433
+ )}
434
+ </>
435
+ )}
436
+ {!hideDistance && (
391
437
  <OText color={theme.colors.textSecondary} size={12} style={styles.metadata}>
392
- {convertHoursToMinutes(business?.pickup_time) + ` \u2022 `}
438
+ {parseDistance(business?.distance || 0) + ` \u2022 `}
393
439
  </OText>
394
440
  )}
395
- <OText color={theme.colors.textSecondary} size={12} style={styles.metadata}>
396
- {parseDistance(business?.distance || 0) + ` \u2022 `}
397
- </OText>
398
- </View>
399
-
400
- <View style={styles.reviewStyle}>
401
- <OIcon
402
- src={theme.images.general.star}
403
- width={14}
404
- color={theme.colors.textSecondary}
405
- style={{ marginTop: -2, marginEnd: 2 }}
406
- />
407
- <OText size={12} color={theme.colors.textSecondary}>
408
- {business?.reviews?.total}
409
- </OText>
410
441
  </View>
442
+ {!hideReviews && (
443
+ <View style={styles.reviewStyle}>
444
+ <OIcon
445
+ src={theme.images.general.star}
446
+ width={14}
447
+ color={theme.colors.textSecondary}
448
+ style={{ marginTop: -2, marginEnd: 2 }}
449
+ />
450
+ <OText size={12} color={theme.colors.textSecondary}>
451
+ {business?.reviews?.total}
452
+ </OText>
453
+ </View>
454
+ )}
411
455
  </BusinessInfoItem>
412
456
  </View>
413
457
  <WrapReviews>
@@ -416,18 +460,43 @@ export const BusinessBasicInformation = (
416
460
  {isPreOrder && (!business?.professionals || business?.professionals?.length === 0) && (
417
461
  <>
418
462
  <TouchableOpacity onPress={() => navigation.navigate('BusinessPreorder', { business: businessState?.business, handleBusinessClick: () => navigation?.goBack() })}>
419
- <OText color={theme.colors.textSecondary} style={{ textDecorationLine: 'underline' }}>
463
+ <OText
464
+ color={theme.colors.primary}
465
+ style={{ textDecorationColor: theme.colors.primary, textDecorationLine: 'underline' }}
466
+ size={12}
467
+ >
420
468
  {t('PREORDER', 'Preorder')}
421
469
  </OText>
422
470
  </TouchableOpacity>
423
471
  <OText size={12} color={theme.colors.textSecondary}>{' \u2022 '}</OText>
424
472
  </>
425
473
  )}
426
- <TouchableOpacity onPress={() => handleClickBusinessReviews()}>
427
- <OText color={theme.colors.textSecondary} style={{ textDecorationLine: 'underline' }}>
428
- {t('REVIEWS', 'Reviews')}
429
- </OText>
430
- </TouchableOpacity>
474
+ {!hideReviewsPopup && (
475
+ <>
476
+ <TouchableOpacity onPress={() => handleClickBusinessReviews()}>
477
+ <OText
478
+ color={theme.colors.primary}
479
+ style={{ textDecorationColor: theme.colors.primary, textDecorationLine: 'underline' }}
480
+ size={12}
481
+ >
482
+ {t('REVIEWS', 'Reviews')}
483
+ </OText>
484
+ </TouchableOpacity>
485
+ <OText size={12} color={theme.colors.textSecondary}>{' \u2022 '}</OText>
486
+ </>
487
+ )}
488
+
489
+ {!isBusinessInfoShow && !hideInfoIcon && !isChewLayout && (
490
+ <TouchableOpacity onPress={() => handleClickBusinessInformation()}>
491
+ <OText
492
+ color={theme.colors.primary}
493
+ style={{ textDecorationColor: theme.colors.primary, textDecorationLine: 'underline' }}
494
+ size={12}
495
+ >
496
+ {t('INFORMATION', 'Information')}
497
+ </OText>
498
+ </TouchableOpacity>
499
+ )}
431
500
  </>
432
501
  )}
433
502
  </WrapReviews>
@@ -8,9 +8,6 @@ export const BusinessContainer = styled.View`
8
8
  export const BusinessHeader = styled.ImageBackground`
9
9
  width: 100%;
10
10
  position: relative;
11
- max-height: 258px;
12
- height: 258px;
13
- resize-mode: cover;
14
11
  `;
15
12
  export const BusinessLogo = styled.View`
16
13
  position: absolute;
@@ -44,13 +41,10 @@ export const WrapBusinessInfo = styled.TouchableOpacity`
44
41
 
45
42
  export const TitleWrapper = styled.View`
46
43
  width: 100%;
47
- flex-direction: row;
48
- align-items: center;
49
- justify-content: space-between;
44
+ flex-direction: column;
50
45
  `
51
46
 
52
47
  export const RibbonBox = styled.View`
53
- margin-left: 5px;
54
48
  background-color: ${(props: any) => props.theme.colors.primary};
55
49
  padding: 2px 8px;
56
50
  max-width: 180px;
@@ -67,6 +61,14 @@ export const RibbonBox = styled.View`
67
61
  ${(props: any) => props.isCapsule && css`
68
62
  border-radius: 50px;
69
63
  `}
64
+
65
+ ${(props: any) => props.colorText && css`
66
+ color: ${props.colorText ? 'black' : 'white'};
67
+ `}
68
+
69
+ ${(props: any) => props.borderRibbon && css`
70
+ border: 1px solid ${props.borderRibbon ? 'black' : 'white'};
71
+ `}
70
72
  `
71
73
 
72
74
  export const SocialListWrapper = styled.ScrollView`