ordering-ui-react-native 0.17.49 → 0.17.50-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 (219) 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/PhoneInputNumber/index.tsx +6 -2
  7. package/src/components/StripeMethodForm/index.tsx +136 -102
  8. package/src/components/VerifyPhone/styles.tsx +1 -2
  9. package/src/components/shared/OToast.tsx +4 -4
  10. package/src/types/index.tsx +5 -0
  11. package/src/utils/index.tsx +7 -1
  12. package/themes/business/index.tsx +2 -0
  13. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +265 -240
  14. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
  15. package/themes/business/src/components/BusinessController/index.tsx +0 -1
  16. package/themes/business/src/components/Chat/index.tsx +125 -113
  17. package/themes/business/src/components/DriverMap/index.tsx +17 -6
  18. package/themes/business/src/components/DriverSchedule/index.tsx +29 -2
  19. package/themes/business/src/components/GoogleMap/index.tsx +58 -57
  20. package/themes/business/src/components/LoginForm/Otp/index.tsx +120 -0
  21. package/themes/business/src/components/LoginForm/Otp/styles.tsx +7 -0
  22. package/themes/business/src/components/LoginForm/index.tsx +238 -80
  23. package/themes/business/src/components/LoginForm/styles.tsx +10 -0
  24. package/themes/business/src/components/MapView/index.tsx +10 -10
  25. package/themes/business/src/components/NewOrderNotification/index.tsx +35 -21
  26. package/themes/business/src/components/OrderDetails/Delivery.tsx +30 -4
  27. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +93 -50
  28. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +59 -62
  29. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +195 -0
  30. package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
  31. package/themes/business/src/components/OrderMessage/index.tsx +18 -17
  32. package/themes/business/src/components/OrderSummary/index.tsx +113 -121
  33. package/themes/business/src/components/OrdersOption/index.tsx +32 -75
  34. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +250 -0
  35. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
  36. package/themes/business/src/components/PreviousOrders/index.tsx +445 -243
  37. package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
  38. package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
  39. package/themes/business/src/components/ReviewCustomer/index.tsx +29 -14
  40. package/themes/business/src/components/StoresList/index.tsx +2 -2
  41. package/themes/business/src/components/UserProfileForm/index.tsx +11 -13
  42. package/themes/business/src/components/shared/OLink.tsx +33 -13
  43. package/themes/business/src/components/shared/OModal.tsx +16 -9
  44. package/themes/business/src/components/shared/OText.tsx +8 -2
  45. package/themes/business/src/types/index.tsx +32 -2
  46. package/themes/business/src/utils/index.tsx +44 -1
  47. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  48. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  49. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  50. package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
  51. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  52. package/themes/kiosk/src/components/LoginForm/Otp/index.tsx +92 -0
  53. package/themes/kiosk/src/components/LoginForm/Otp/styles.tsx +7 -0
  54. package/themes/kiosk/src/components/LoginForm/index.tsx +480 -156
  55. package/themes/kiosk/src/components/LoginForm/styles.tsx +14 -1
  56. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  57. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  58. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  59. package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +3 -2
  60. package/themes/kiosk/src/components/PhoneInputNumber/styles.tsx +1 -3
  61. package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
  62. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  63. package/themes/kiosk/src/components/shared/OModal.tsx +14 -11
  64. package/themes/kiosk/src/layouts/Container.tsx +7 -1
  65. package/themes/kiosk/src/types/index.d.ts +13 -0
  66. package/themes/kiosk/src/utils/index.tsx +15 -0
  67. package/themes/original/index.tsx +6 -0
  68. package/themes/original/src/components/AddressDetails/index.tsx +29 -11
  69. package/themes/original/src/components/AddressForm/index.tsx +79 -44
  70. package/themes/original/src/components/AddressList/index.tsx +27 -22
  71. package/themes/original/src/components/AddressList/styles.tsx +4 -2
  72. package/themes/original/src/components/AnalyticsSegment/index.tsx +193 -10
  73. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  74. package/themes/original/src/components/AppleLogin/styles.tsx +3 -1
  75. package/themes/original/src/components/BusinessBasicInformation/index.tsx +160 -91
  76. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +9 -7
  77. package/themes/original/src/components/BusinessController/index.tsx +146 -68
  78. package/themes/original/src/components/BusinessController/styles.tsx +22 -2
  79. package/themes/original/src/components/BusinessFeaturedController/index.tsx +21 -54
  80. package/themes/original/src/components/BusinessFeaturedController/styles.tsx +8 -0
  81. package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
  82. package/themes/original/src/components/BusinessItemAccordion/index.tsx +23 -22
  83. package/themes/original/src/components/BusinessListingSearch/index.tsx +352 -326
  84. package/themes/original/src/components/BusinessPreorder/index.tsx +97 -16
  85. package/themes/original/src/components/BusinessProductsList/index.tsx +23 -14
  86. package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
  87. package/themes/original/src/components/BusinessProductsListing/UpsellingRedirect.tsx +1 -1
  88. package/themes/original/src/components/BusinessProductsListing/index.tsx +669 -513
  89. package/themes/original/src/components/BusinessProductsListing/styles.tsx +2 -2
  90. package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
  91. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  92. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +98 -79
  93. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -11
  94. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  95. package/themes/original/src/components/Cart/index.tsx +100 -67
  96. package/themes/original/src/components/CartContent/index.tsx +115 -19
  97. package/themes/original/src/components/CartContent/styles.tsx +17 -7
  98. package/themes/original/src/components/Checkout/index.tsx +366 -173
  99. package/themes/original/src/components/Checkout/styles.tsx +4 -2
  100. package/themes/original/src/components/CitiesControl/index.tsx +89 -0
  101. package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
  102. package/themes/original/src/components/CouponControl/index.tsx +10 -3
  103. package/themes/original/src/components/DriverTips/index.tsx +52 -34
  104. package/themes/original/src/components/FacebookLogin/styles.tsx +3 -1
  105. package/themes/original/src/components/Favorite/index.tsx +8 -9
  106. package/themes/original/src/components/Favorite/styles.tsx +1 -1
  107. package/themes/original/src/components/FavoriteList/index.tsx +51 -80
  108. package/themes/original/src/components/FloatingButton/index.tsx +1 -2
  109. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  110. package/themes/original/src/components/GPSButton/index.tsx +6 -4
  111. package/themes/original/src/components/GPSButton/styles.ts +3 -3
  112. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +96 -0
  113. package/themes/original/src/components/GiftCard/GiftCardUI/styles.tsx +5 -0
  114. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +100 -0
  115. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +8 -0
  116. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +191 -0
  117. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +8 -0
  118. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +165 -0
  119. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +9 -0
  120. package/themes/original/src/components/GoogleLogin/styles.tsx +1 -1
  121. package/themes/original/src/components/GoogleMap/index.tsx +15 -4
  122. package/themes/original/src/components/Help/index.tsx +8 -8
  123. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +10 -31
  124. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +5 -3
  125. package/themes/original/src/components/HelpGuide/index.tsx +6 -6
  126. package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
  127. package/themes/original/src/components/HelpOrder/index.tsx +6 -15
  128. package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
  129. package/themes/original/src/components/Home/index.tsx +13 -4
  130. package/themes/original/src/components/LastOrder/index.tsx +1 -34
  131. package/themes/original/src/components/LoginForm/Otp/index.tsx +55 -13
  132. package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
  133. package/themes/original/src/components/LoginForm/index.tsx +64 -26
  134. package/themes/original/src/components/LottieAnimation/index.tsx +89 -55
  135. package/themes/original/src/components/MessageListing/index.tsx +16 -42
  136. package/themes/original/src/components/Messages/index.tsx +32 -10
  137. package/themes/original/src/components/MomentOption/index.tsx +195 -88
  138. package/themes/original/src/components/MultiCart/index.tsx +50 -0
  139. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +151 -49
  140. package/themes/original/src/components/MultiCheckout/index.tsx +308 -88
  141. package/themes/original/src/components/MultiCheckout/styles.tsx +3 -1
  142. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
  143. package/themes/original/src/components/MultiOrdersDetails/index.tsx +68 -21
  144. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
  145. package/themes/original/src/components/MyOrders/index.tsx +77 -52
  146. package/themes/original/src/components/NavBar/index.tsx +18 -18
  147. package/themes/original/src/components/NotFoundSource/index.tsx +14 -10
  148. package/themes/original/src/components/Notifications/index.tsx +46 -50
  149. package/themes/original/src/components/Notifications/styles.tsx +6 -3
  150. package/themes/original/src/components/OrderDetails/OrderEta.tsx +76 -0
  151. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +15 -3
  152. package/themes/original/src/components/OrderDetails/index.tsx +190 -358
  153. package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
  154. package/themes/original/src/components/OrderItAgain/index.tsx +3 -1
  155. package/themes/original/src/components/OrderProgress/index.tsx +93 -114
  156. package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
  157. package/themes/original/src/components/OrderSummary/index.tsx +85 -57
  158. package/themes/original/src/components/OrderTypeSelector/index.tsx +1 -1
  159. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +24 -19
  160. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +14 -14
  161. package/themes/original/src/components/OrdersOption/index.tsx +76 -66
  162. package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
  163. package/themes/original/src/components/PageBanner/index.tsx +171 -0
  164. package/themes/original/src/components/PageBanner/styles.tsx +11 -0
  165. package/themes/original/src/components/PaymentOptionCard/index.tsx +180 -0
  166. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
  167. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  168. package/themes/original/src/components/PaymentOptions/index.tsx +64 -7
  169. package/themes/original/src/components/PhoneInputNumber/index.tsx +3 -3
  170. package/themes/original/src/components/PlaceSpot/index.tsx +12 -6
  171. package/themes/original/src/components/ProductForm/index.tsx +114 -36
  172. package/themes/original/src/components/ProductForm/styles.tsx +5 -7
  173. package/themes/original/src/components/ProductItemAccordion/index.tsx +17 -14
  174. package/themes/original/src/components/ProductOptionSubOption/index.tsx +24 -14
  175. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +3 -4
  176. package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
  177. package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -50
  178. package/themes/original/src/components/ProfessionalProfile/index.tsx +36 -7
  179. package/themes/original/src/components/Promotions/index.tsx +234 -220
  180. package/themes/original/src/components/Promotions/styles.tsx +10 -3
  181. package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
  182. package/themes/original/src/components/ReviewOrder/index.tsx +26 -9
  183. package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
  184. package/themes/original/src/components/ReviewProducts/index.tsx +23 -11
  185. package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
  186. package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
  187. package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
  188. package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
  189. package/themes/original/src/components/ServiceForm/index.tsx +66 -17
  190. package/themes/original/src/components/Sessions/index.tsx +11 -8
  191. package/themes/original/src/components/Sessions/styles.tsx +5 -0
  192. package/themes/original/src/components/SignupForm/index.tsx +43 -20
  193. package/themes/original/src/components/SingleOrderCard/index.tsx +130 -52
  194. package/themes/original/src/components/SingleOrderCard/styles.tsx +11 -2
  195. package/themes/original/src/components/SingleProductCard/index.tsx +72 -34
  196. package/themes/original/src/components/SingleProductCard/styles.tsx +22 -4
  197. package/themes/original/src/components/SingleProductReview/styles.tsx +1 -1
  198. package/themes/original/src/components/StripeCardsList/index.tsx +13 -3
  199. package/themes/original/src/components/StripeElementsForm/index.tsx +67 -34
  200. package/themes/original/src/components/UpsellingProducts/index.tsx +238 -224
  201. package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
  202. package/themes/original/src/components/UserDetails/index.tsx +8 -4
  203. package/themes/original/src/components/UserFormDetails/index.tsx +76 -7
  204. package/themes/original/src/components/UserFormDetails/styles.tsx +1 -1
  205. package/themes/original/src/components/UserProfile/index.tsx +12 -29
  206. package/themes/original/src/components/UserProfileForm/index.tsx +27 -29
  207. package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
  208. package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
  209. package/themes/original/src/components/WalletTransactions/index.tsx +3 -3
  210. package/themes/original/src/components/Wallets/index.tsx +67 -24
  211. package/themes/original/src/components/Wallets/styles.tsx +3 -4
  212. package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
  213. package/themes/original/src/components/shared/OButton.tsx +6 -2
  214. package/themes/original/src/components/shared/OInput.tsx +16 -2
  215. package/themes/original/src/components/shared/OModal.tsx +3 -3
  216. package/themes/original/src/layouts/Container.tsx +1 -1
  217. package/themes/original/src/types/index.tsx +40 -11
  218. package/themes/original/src/utils/index.tsx +375 -58
  219. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -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`
@@ -11,10 +11,11 @@ import {
11
11
  ToastType
12
12
  } from 'ordering-components/native';
13
13
  import { OIcon, OText } from '../shared';
14
- import { StyleSheet, View } from 'react-native';
14
+ import { Dimensions, StyleSheet, 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
+ import ReactNativeHapticFeedback from "react-native-haptic-feedback";
18
19
 
19
20
  import {
20
21
  BusinessHero,
@@ -25,7 +26,8 @@ import {
25
26
  BusinessLogo,
26
27
  Reviews,
27
28
  RibbonBox,
28
- ReviewAndFavorite
29
+ ReviewAndFavorite,
30
+ OfferBox
29
31
  } from './styles';
30
32
  import { useTheme } from 'styled-components/native';
31
33
  import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome5';
@@ -40,6 +42,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
40
42
  navigation,
41
43
  isBusinessOpen,
42
44
  style,
45
+ isCustomLayout,
43
46
  businessHeader,
44
47
  businessFeatured,
45
48
  businessLogo,
@@ -49,8 +52,10 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
49
52
  businessPickupTime,
50
53
  businessDistance,
51
54
  handleFavoriteBusiness,
52
- enableIntersection
55
+ enableIntersection,
56
+ getBusinessOffer
53
57
  } = props;
58
+
54
59
  const [{ parsePrice, parseDistance, parseNumber, optimizeImage }] = useUtils();
55
60
  const [, { showToast }] = useToast()
56
61
  const [orderState] = useOrder();
@@ -58,14 +63,29 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
58
63
  const [configState] = useConfig();
59
64
  const [, t] = useLanguage();
60
65
  const theme = useTheme()
66
+ const windowHeight = Dimensions.get('window').height
61
67
  const [isIntersectionObserver, setIsIntersectionObserver] = useState(!enableIntersection)
62
68
 
69
+ const hideBusinessLogo = theme?.business_listing_view?.components?.business?.components?.logo?.hidden
70
+ const hideBusinessFee = theme?.business_listing_view?.components?.business?.components?.fee?.hidden
71
+ const hideBusinessTime = theme?.business_listing_view?.components?.business?.components?.time?.hidden
72
+ const hideBusinessDistance = theme?.business_listing_view?.components?.business?.components?.distance?.hidden
73
+ const hideBusinessReviews = theme?.business_listing_view?.components?.business?.components?.reviews?.hidden
74
+ const hideBusinessFavorite = theme?.business_listing_view?.components?.business?.components?.favorite?.hidden
75
+ const hideBusinessOffer = theme?.business_listing_view?.components?.business?.components?.offer?.hidden
76
+ const hideBusinessHeader = theme?.business_listing_view?.components?.business?.components?.header?.hidden
77
+ const hideBusinessFavoriteBadge = theme?.business_listing_view?.components?.business?.components?.featured_badge?.hidden
78
+
79
+ const textSize = isCustomLayout ? 12 : 10
80
+ const cardHeight = windowHeight * 0.3
81
+
63
82
  const styles = StyleSheet.create({
64
83
  container: {
65
84
  marginVertical: 20,
66
85
  borderRadius: 7.6,
67
86
  width: '100%',
68
- position: 'relative'
87
+ position: 'relative',
88
+ height: cardHeight
69
89
  },
70
90
  headerStyle: {
71
91
  borderTopLeftRadius: 7.6,
@@ -132,7 +152,16 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
132
152
  return _types.join(', ');
133
153
  };
134
154
 
155
+ const vibrateApp = (impact?: string) => {
156
+ const options = {
157
+ enableVibrateFallback: true,
158
+ ignoreAndroidSystemSettings: false
159
+ };
160
+ ReactNativeHapticFeedback.trigger(impact || "impactLight", options);
161
+ }
162
+
135
163
  const handleBusinessClick = (selectedBusiness: any) => {
164
+ vibrateApp()
136
165
  if (business?.open) handleClick && handleClick(selectedBusiness)
137
166
  else {
138
167
  if (configState?.configs?.preorder_status_enabled?.value === '1') {
@@ -159,22 +188,21 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
159
188
  <InView style={{ minHeight: 200 }} triggerOnce={true} onChange={(inView: boolean) => handleChangeInterSection(inView)}>
160
189
  {isIntersectionObserver ? (
161
190
  <CardAnimation
191
+ style={[style, styles.container]}
162
192
  onClick={() => handleBusinessClick(business)}
163
- style={[
164
- style,
165
- styles.container
166
- ]}
167
193
  >
168
194
  {business?.ribbon?.enabled && (
169
195
  <RibbonBox
170
196
  bgColor={business?.ribbon?.color}
197
+ colorText={lightenDarkenColor(business?.ribbon?.color)}
198
+ borderRibbon={lightenDarkenColor(business?.ribbon?.color)}
171
199
  isRoundRect={business?.ribbon?.shape === shape?.rectangleRound}
172
200
  isCapsule={business?.ribbon?.shape === shape?.capsuleShape}
173
201
  >
174
202
  <OText
175
203
  size={10}
176
204
  weight={'400'}
177
- color={theme.colors.white}
205
+ color={lightenDarkenColor(business?.ribbon?.color) ? theme.colors.black : theme.colors.white}
178
206
  numberOfLines={2}
179
207
  ellipsizeMode='tail'
180
208
  lineHeight={13}
@@ -184,20 +212,38 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
184
212
  </RibbonBox>
185
213
  )}
186
214
  <BusinessHero>
187
- <FastImage
188
- style={{ height: 120 }}
189
- source={(businessHeader || business?.header) ? {
190
- uri: optimizeImage(businessHeader || business?.header, 'h_500,c_limit'),
191
- priority: FastImage.priority.normal,
192
- } : theme.images.dummies.businessHeader}
193
- resizeMode={FastImage.resizeMode.cover}
194
- />
195
- {(businessFeatured ?? business?.featured) && (
215
+ {!hideBusinessHeader && (
216
+ <FastImage
217
+ style={{ height: isCustomLayout ? cardHeight * 0.66 : 120 }}
218
+ source={(businessHeader || business?.header || typeof theme.images.dummies.businessHeader === 'string') ? {
219
+ uri: optimizeImage(businessHeader || business?.header || theme.images.dummies.businessHeader, 'h_500,c_limit'),
220
+ priority: FastImage.priority.normal,
221
+ } : theme.images.dummies.businessHeader}
222
+ resizeMode={FastImage.resizeMode.cover}
223
+ />
224
+ )}
225
+ {(businessFeatured ?? business?.featured) && !hideBusinessFavoriteBadge && (
196
226
  <View style={styles.featured}>
197
227
  <FontAwesomeIcon name="crown" size={26} color="gold" />
198
228
  </View>
199
229
  )}
200
- <BusinessState>
230
+ {(!isCustomLayout) && !hideBusinessOffer && (
231
+ getBusinessOffer((business?.offers)) &&
232
+ <OfferBox
233
+ isClosed={!isBusinessOpen && (configState?.configs?.preorder_status_enabled?.value === '1')}
234
+ isRibbon={business?.ribbon?.enabled && !!business?.ribbon?.text}
235
+ >
236
+ <OText
237
+ size={10}
238
+ weight={'400'}
239
+ color={theme.colors.textThird}
240
+ numberOfLines={2}
241
+ ellipsizeMode='tail'
242
+ lineHeight={13}
243
+ >{getBusinessOffer((business?.offers)) || parsePrice(0)}</OText>
244
+ </OfferBox>
245
+ )}
246
+ <BusinessState isRibbon={business?.ribbon?.enabled && !!business?.ribbon?.text}>
201
247
  {!isBusinessOpen && (configState?.configs?.preorder_status_enabled?.value === '1') && (
202
248
  <View style={styles.businessStateView}>
203
249
  <OText
@@ -211,49 +257,77 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
211
257
  </BusinessState>
212
258
  </BusinessHero>
213
259
  <BusinessContent>
214
- <BusinessInfo>
215
- <BusinessLogo style={styles.businessLogo}>
216
- <FastImage
217
- style={{ width: 56, height: 56 }}
218
- source={(businessLogo || business?.logo) ? {
219
- uri: optimizeImage(businessLogo || business?.logo, 'h_150,c_limit'),
220
- priority: FastImage.priority.normal,
221
- } : theme.images.dummies.businessLogo}
222
- resizeMode={FastImage.resizeMode.cover}
223
- />
224
- </BusinessLogo>
225
- <ReviewAndFavorite>
226
- {(businessReviews?.reviews?.total > 0 ?? business?.reviews?.total > 0) && (
227
- <Reviews>
228
- <OIcon src={theme.images.general.star} width={12} style={styles.starIcon} />
229
- <OText size={10} style={{ lineHeight: 15 }}>
230
- {parseNumber(businessReviews?.reviews?.total ?? business?.reviews?.total, { separator: '.' })}
231
- </OText>
232
- </Reviews>
233
- )}
234
- <LottieAnimation
235
- type='favorite'
236
- onClick={handleChangeFavorite}
237
- initialValue={business?.favorite ? 0.75 : 0}
238
- toValue={business?.favorite ? 0 : 0.75}
239
- disableAnimation={!auth}
240
- iconProps={{ color: theme.colors.danger5, size: 18 }}
241
- isActive={business?.favorite}
242
- />
243
- </ReviewAndFavorite>
260
+ <BusinessInfo style={isCustomLayout && { position: 'absolute', bottom: 85, left: 15 }}>
261
+ {!hideBusinessLogo && (
262
+ <BusinessLogo style={styles.businessLogo}>
263
+ <FastImage
264
+ style={{ width: 56, height: 56 }}
265
+ source={(businessLogo || business?.logo || typeof theme.images.dummies.businessLogo === 'string') ? {
266
+ uri: optimizeImage(businessLogo || business?.logo || theme.images.dummies.businessLogo, 'h_150,c_limit'),
267
+ priority: FastImage.priority.normal,
268
+ } : theme.images.dummies.businessLogo}
269
+ resizeMode={FastImage.resizeMode.cover}
270
+ />
271
+ </BusinessLogo>
272
+ )}
273
+ {!isCustomLayout && (!hideBusinessFavorite || !hideBusinessReviews) && (
274
+ <ReviewAndFavorite>
275
+ {(businessReviews?.reviews?.total > 0 ?? business?.reviews?.total > 0) && !hideBusinessReviews && (
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
+ {!hideBusinessFavorite && (
284
+ <LottieAnimation
285
+ type='favorite'
286
+ onClick={handleChangeFavorite}
287
+ initialValue={business?.favorite ? 0.5 : 0}
288
+ toValue={business?.favorite ? 0 : 0.5}
289
+ disableAnimation={!auth}
290
+ iconProps={{ color: theme.colors.danger5, size: 18 }}
291
+ isActive={business?.favorite}
292
+ />
293
+ )}
294
+ </ReviewAndFavorite>
295
+ )}
244
296
  </BusinessInfo>
245
- <OText
246
- size={12}
247
- style={{ lineHeight: 18, marginBottom: 6 }}
248
- weight={'500'}>
249
- {business?.name}
250
- </OText>
251
- <OText size={10} style={{ lineHeight: 15, marginBottom: 3 }}>
297
+ <View style={isCustomLayout && { width: '100%', flexDirection: 'row', justifyContent: 'space-between', marginTop: 5 }}>
298
+ <OText
299
+ size={textSize + 2}
300
+ style={{ lineHeight: 18, marginBottom: 6 }}
301
+ weight={'500'}>
302
+ {business?.name}
303
+ </OText>
304
+ {isCustomLayout && (!hideBusinessFavorite || !hideBusinessReviews) && (
305
+ <ReviewAndFavorite>
306
+ {(businessReviews?.reviews?.total > 0 ?? business?.reviews?.total > 0) && !hideBusinessReviews && (
307
+ <Reviews>
308
+ <OIcon src={theme.images.general.star} width={12} style={styles.starIcon} />
309
+ <OText size={10} style={{ lineHeight: 15 }}>
310
+ {parseNumber(businessReviews?.reviews?.total ?? business?.reviews?.total, { separator: '.' })}
311
+ </OText>
312
+ </Reviews>
313
+ )}
314
+ {!hideBusinessFavorite && (
315
+ <LottieAnimation
316
+ type='favorite'
317
+ onClick={handleChangeFavorite}
318
+ initialValue={business?.favorite ? 0.5 : 0}
319
+ toValue={business?.favorite ? 0 : 0.5}
320
+ disableAnimation={!auth}
321
+ iconProps={{ color: theme.colors.danger5, size: 18 }}
322
+ isActive={business?.favorite}
323
+ />
324
+ )}
325
+ </ReviewAndFavorite>
326
+ )}
327
+ </View>
328
+ <OText size={textSize} style={{ lineHeight: 15, marginBottom: 3 }} numberOfLines={isCustomLayout ? 1 : 2}>
252
329
  {business?.address}
253
330
  </OText>
254
- {/* <BusinessCategory>
255
- <OText>{getBusinessType()}</OText>
256
- </BusinessCategory> */}
257
331
  <Metadata>
258
332
  {!isBusinessOpen ? (
259
333
  <View style={styles.closed}>
@@ -263,17 +337,21 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
263
337
  </View>
264
338
  ) : (
265
339
  <View style={styles.bullet}>
266
- {orderState?.options?.type === 1 && (
267
- <OText size={10} color={theme.colors.textSecondary}>
340
+ {orderState?.options?.type === 1 && !hideBusinessFee && (
341
+ <OText size={textSize} color={theme.colors.textSecondary}>
268
342
  {`${t('DELIVERY_FEE', 'Delivery fee')} ${parsePrice(businessDeliveryPrice ?? business?.delivery_price) + ' \u2022 '}`}
269
343
  </OText>
270
344
  )}
271
- <OText size={10} color={theme.colors.textSecondary}>{`${convertHoursToMinutes(
272
- orderState?.options?.type === 1
273
- ? (businessDeliveryTime ?? business?.delivery_time)
274
- : (businessPickupTime ?? business?.pickup_time),
275
- )} \u2022 `}</OText>
276
- <OText size={10} color={theme.colors.textSecondary}>{parseDistance(businessDistance ?? business?.distance)}</OText>
345
+ {!hideBusinessTime && (
346
+ <OText size={textSize} color={theme.colors.textSecondary}>{`${convertHoursToMinutes(
347
+ orderState?.options?.type === 1
348
+ ? (businessDeliveryTime ?? business?.delivery_time)
349
+ : (businessPickupTime ?? business?.pickup_time),
350
+ )} \u2022 `}</OText>
351
+ )}
352
+ {!hideBusinessDistance && (
353
+ <OText size={textSize} color={theme.colors.textSecondary}>{parseDistance(businessDistance ?? business?.distance)}</OText>
354
+ )}
277
355
  </View>
278
356
  )}
279
357
  </Metadata>
@@ -9,7 +9,7 @@ export const BusinessHero = styled.View`
9
9
 
10
10
  export const BusinessContent = styled.View`
11
11
  padding-horizontal: 18px;
12
- padding-bottom: 18px;
12
+ padding-bottom: 10px;
13
13
  border-bottom-left-radius: 7.6px;
14
14
  border-bottom-right-radius: 7.6px;
15
15
  border-width: 1px;
@@ -39,7 +39,7 @@ export const BusinessState = styled.View`
39
39
  `
40
40
 
41
41
  export const BusinessLogo = styled.View`
42
-
42
+
43
43
  `
44
44
 
45
45
  export const ReviewAndFavorite = styled.View`
@@ -72,4 +72,24 @@ export const RibbonBox = styled.View`
72
72
  ${(props: any) => props.isCapsule && css`
73
73
  border-radius: 50px;
74
74
  `}
75
+
76
+ ${(props: any) => props.colorText && css`
77
+ color: ${props.colorText ? 'black' : 'white'};
78
+ `}
79
+
80
+ ${(props: any) => props.borderRibbon && css`
81
+ border: 1px solid ${props.borderRibbon ? 'black' : 'white'};
82
+ `}
83
+ `
84
+
85
+ export const OfferBox = styled.View`
86
+ position: absolute;
87
+ z-index: 1;
88
+ top: 20px;
89
+ right: 10px;
90
+ border-radius: 50px;
91
+ color: ${(props: any) => props.theme.colors.textThird};
92
+ background: ${(props: any) => props.theme.colors.inputBorderColor};
93
+ padding: 3px 8px;
94
+ max-width: 180px;
75
95
  `
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { StyleSheet, useWindowDimensions, View } from 'react-native';
2
3
  import {
3
4
  BusinessController as BusinessSingleCard,
4
5
  useUtils,
@@ -6,33 +7,29 @@ import {
6
7
  useLanguage,
7
8
  } from 'ordering-components/native';
8
9
  import { useTheme } from 'styled-components/native';
9
- import { OIcon, OText } from '../shared';
10
- import { StyleSheet, useWindowDimensions, View } from 'react-native';
10
+ import FastImage from 'react-native-fast-image'
11
+
12
+ import { OText } from '../shared';
11
13
  import { BusinessControllerParams } from '../../types';
12
- import { convertHoursToMinutes, shape } from '../../utils';
14
+ import { convertHoursToMinutes, lightenDarkenColor, shape } from '../../utils';
13
15
  import {
14
16
  Card,
15
17
  BusinessHero,
16
18
  BusinessContent,
17
- BusinessCategory,
18
19
  BusinessInfo,
19
20
  Metadata,
20
- BusinessState,
21
21
  BusinessLogo,
22
- Reviews,
23
22
  RibbonBox
24
23
  } from './styles';
25
24
 
26
25
  export const BusinessFeaturedCtrlUI = (props: BusinessControllerParams) => {
27
26
  const { business, handleClick, isBusinessOpen } = props;
28
- const [{ parsePrice, parseDistance, parseNumber, optimizeImage }] =
29
- useUtils();
27
+
28
+ const [{ parsePrice, parseDistance, optimizeImage }] = useUtils();
30
29
  const [orderState] = useOrder();
31
30
  const [, t] = useLanguage();
32
-
33
31
  const theme = useTheme();
34
32
 
35
-
36
33
  const styles = StyleSheet.create({
37
34
  headerStyle: {
38
35
  borderTopLeftRadius: 25,
@@ -79,35 +76,28 @@ export const BusinessFeaturedCtrlUI = (props: BusinessControllerParams) => {
79
76
  justifyContent: 'flex-start',
80
77
  width: '100%',
81
78
  },
79
+ productStyle: {
80
+ height: 40,
81
+ width: 40
82
+ }
82
83
  });
83
84
 
84
- const types = ['food', 'laundry', 'alcohol', 'groceries'];
85
-
86
85
  const { width } = useWindowDimensions();
87
86
 
88
- const getBusinessType = () => {
89
- if (Object.keys(business).length <= 0) return t('GENERAL', 'General');
90
- const _types: any = [];
91
- types.forEach((type) => {
92
- if (business[type]) {
93
- _types.push(t(type.toUpperCase(), type));
94
- }
95
- });
96
- return _types.join(', ');
97
- };
98
-
99
87
  return (
100
88
  <Card activeOpacity={1} onPress={() => handleClick(business)}>
101
89
  {business?.ribbon?.enabled && (
102
90
  <RibbonBox
103
91
  bgColor={business?.ribbon?.color}
92
+ colorText={lightenDarkenColor(business?.ribbon?.color)}
93
+ borderRibbon={lightenDarkenColor(business?.ribbon?.color)}
104
94
  isRoundRect={business?.ribbon?.shape === shape?.rectangleRound}
105
95
  isCapsule={business?.ribbon?.shape === shape?.capsuleShape}
106
96
  >
107
97
  <OText
108
98
  size={10}
109
99
  weight={'400'}
110
- color={theme.colors.white}
100
+ color={lightenDarkenColor(business?.ribbon?.color) ? theme.colors.black : theme.colors.white}
111
101
  numberOfLines={2}
112
102
  ellipsizeMode='tail'
113
103
  lineHeight={13}
@@ -118,10 +108,13 @@ export const BusinessFeaturedCtrlUI = (props: BusinessControllerParams) => {
118
108
  )}
119
109
  <BusinessHero>
120
110
  <BusinessLogo>
121
- <OIcon
122
- url={optimizeImage(business?.logo, 'h_100,c_limit')}
123
- width={40}
124
- height={40}
111
+ <FastImage
112
+ style={styles.productStyle}
113
+ source={{
114
+ uri: optimizeImage(business?.logo, 'h_100,c_limit'),
115
+ priority: FastImage.priority.normal,
116
+ }}
117
+ resizeMode={FastImage.resizeMode.cover}
125
118
  />
126
119
  </BusinessLogo>
127
120
  <BusinessContent style={{ width: width * 0.6 }}>
@@ -129,23 +122,7 @@ export const BusinessFeaturedCtrlUI = (props: BusinessControllerParams) => {
129
122
  <OText size={12} ellipsizeMode={'tail'} numberOfLines={2}>
130
123
  {business?.name}
131
124
  </OText>
132
- {/* {business?.reviews?.total > 0 && (
133
- <Reviews>
134
- <IconAntDesign
135
- name="star"
136
- color={theme.colors.primary}
137
- size={16}
138
- style={styles.starIcon}
139
- />
140
- <OText>
141
- {parseNumber(business?.reviews?.total, { separator: '.' })}
142
- </OText>
143
- </Reviews>
144
- )} */}
145
125
  </BusinessInfo>
146
- {/* <BusinessCategory>
147
- <OText>{getBusinessType()}</OText>
148
- </BusinessCategory> */}
149
126
  <Metadata>
150
127
  {!isBusinessOpen ? (
151
128
  <View style={styles.closed}>
@@ -155,7 +132,6 @@ export const BusinessFeaturedCtrlUI = (props: BusinessControllerParams) => {
155
132
  </View>
156
133
  ) : (
157
134
  <View style={styles.bullet}>
158
- {/* <MaterialComIcon name="alarm" size={16} /> */}
159
135
  <OText size={10} color={theme.colors.textSecondary}>
160
136
  {t('DELIVERY_FEE', 'Delivery Fee')}
161
137
  </OText>
@@ -184,15 +160,6 @@ export const BusinessFeaturedCtrlUI = (props: BusinessControllerParams) => {
184
160
  )}
185
161
  </Metadata>
186
162
  </BusinessContent>
187
- {/* <BusinessState>
188
- {!business?.open && (
189
- <View style={styles.businessStateView}>
190
- <OText color={theme.colors.white} size={20} style={styles.businessStateText}>
191
- {t('PREORDER', 'PREORDER')}
192
- </OText>
193
- </View>
194
- )}
195
- </BusinessState> */}
196
163
  </BusinessHero>
197
164
  </Card>
198
165
  );
@@ -70,4 +70,12 @@ export const RibbonBox = styled.View`
70
70
  ${(props: any) => props.isCapsule && css`
71
71
  border-radius: 50px;
72
72
  `}
73
+
74
+ ${(props: any) => props.colorText && css`
75
+ color: ${props.colorText ? 'black' : 'white'};
76
+ `}
77
+
78
+ ${(props: any) => props.borderRibbon && css`
79
+ border: 1px solid ${props.borderRibbon ? 'black' : 'white'};
80
+ `}
73
81
  `
@@ -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
  />