ordering-ui-react-native 0.17.4 → 0.17.5-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 (213) hide show
  1. package/package.json +5 -5
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/BusinessInformation/index.tsx +11 -4
  4. package/src/components/BusinessInformation/styles.tsx +2 -2
  5. package/src/components/BusinessesListing/index.tsx +1 -1
  6. package/src/components/OrderCreating/index.tsx +1 -21
  7. package/src/components/PaymentOptionsWebView/index.tsx +119 -120
  8. package/src/components/SingleProductReview/index.tsx +7 -4
  9. package/src/components/StripeMethodForm/index.tsx +6 -14
  10. package/src/components/VerifyPhone/styles.tsx +1 -2
  11. package/src/components/shared/OToast.tsx +4 -4
  12. package/src/utils/index.tsx +7 -1
  13. package/themes/business/index.tsx +2 -0
  14. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +265 -240
  15. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
  16. package/themes/business/src/components/BusinessController/index.tsx +0 -1
  17. package/themes/business/src/components/Chat/index.tsx +118 -107
  18. package/themes/business/src/components/DriverMap/index.tsx +22 -9
  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 +18 -7
  25. package/themes/business/src/components/NewOrderNotification/index.tsx +43 -50
  26. package/themes/business/src/components/OrderDetails/Delivery.tsx +4 -3
  27. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +96 -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 +41 -24
  40. package/themes/business/src/components/StoresList/index.tsx +2 -2
  41. package/themes/business/src/components/shared/OLink.tsx +33 -13
  42. package/themes/business/src/components/shared/OModal.tsx +16 -9
  43. package/themes/business/src/components/shared/OText.tsx +8 -2
  44. package/themes/business/src/types/index.tsx +33 -2
  45. package/themes/business/src/utils/index.tsx +51 -0
  46. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  47. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  48. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  49. package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
  50. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  51. package/themes/kiosk/src/components/LoginForm/Otp/index.tsx +92 -0
  52. package/themes/kiosk/src/components/LoginForm/Otp/styles.tsx +7 -0
  53. package/themes/kiosk/src/components/LoginForm/index.tsx +473 -151
  54. package/themes/kiosk/src/components/LoginForm/styles.tsx +14 -1
  55. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  56. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  57. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  58. package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +3 -2
  59. package/themes/kiosk/src/components/PhoneInputNumber/styles.tsx +1 -3
  60. package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
  61. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  62. package/themes/kiosk/src/components/shared/OModal.tsx +14 -11
  63. package/themes/kiosk/src/layouts/Container.tsx +7 -1
  64. package/themes/kiosk/src/types/index.d.ts +13 -0
  65. package/themes/kiosk/src/utils/index.tsx +15 -0
  66. package/themes/original/index.tsx +8 -0
  67. package/themes/original/src/components/AddressDetails/index.tsx +29 -11
  68. package/themes/original/src/components/AddressForm/index.tsx +41 -16
  69. package/themes/original/src/components/AddressList/index.tsx +26 -21
  70. package/themes/original/src/components/AddressList/styles.tsx +4 -2
  71. package/themes/original/src/components/AnalyticsSegment/index.tsx +189 -9
  72. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  73. package/themes/original/src/components/BusinessBasicInformation/index.tsx +125 -82
  74. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +9 -4
  75. package/themes/original/src/components/BusinessController/index.tsx +145 -68
  76. package/themes/original/src/components/BusinessController/styles.tsx +22 -9
  77. package/themes/original/src/components/BusinessFeaturedController/index.tsx +21 -54
  78. package/themes/original/src/components/BusinessFeaturedController/styles.tsx +8 -0
  79. package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
  80. package/themes/original/src/components/BusinessItemAccordion/index.tsx +24 -23
  81. package/themes/original/src/components/BusinessListingSearch/index.tsx +52 -24
  82. package/themes/original/src/components/BusinessPreorder/index.tsx +97 -16
  83. package/themes/original/src/components/BusinessProductsList/index.tsx +20 -11
  84. package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
  85. package/themes/original/src/components/BusinessProductsListing/index.tsx +617 -490
  86. package/themes/original/src/components/BusinessProductsListing/styles.tsx +7 -13
  87. package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
  88. package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -3
  89. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  90. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +98 -78
  91. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
  92. package/themes/original/src/components/BusinessesListing/index.tsx +5 -3
  93. package/themes/original/src/components/Cart/index.tsx +88 -43
  94. package/themes/original/src/components/CartContent/index.tsx +102 -3
  95. package/themes/original/src/components/CartContent/styles.tsx +15 -1
  96. package/themes/original/src/components/Checkout/index.tsx +311 -178
  97. package/themes/original/src/components/Checkout/styles.tsx +4 -2
  98. package/themes/original/src/components/CitiesControl/index.tsx +89 -0
  99. package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
  100. package/themes/original/src/components/CouponControl/index.tsx +10 -3
  101. package/themes/original/src/components/DriverTips/index.tsx +52 -37
  102. package/themes/original/src/components/DriverTips/styles.tsx +2 -1
  103. package/themes/original/src/components/Favorite/index.tsx +7 -4
  104. package/themes/original/src/components/Favorite/styles.tsx +1 -1
  105. package/themes/original/src/components/FavoriteList/index.tsx +70 -80
  106. package/themes/original/src/components/FloatingButton/index.tsx +1 -2
  107. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  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 +178 -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/Help/index.tsx +8 -8
  118. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +11 -22
  119. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +6 -0
  120. package/themes/original/src/components/HelpGuide/index.tsx +12 -16
  121. package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
  122. package/themes/original/src/components/HelpOrder/index.tsx +12 -25
  123. package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
  124. package/themes/original/src/components/Home/index.tsx +13 -4
  125. package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
  126. package/themes/original/src/components/LastOrder/index.tsx +1 -34
  127. package/themes/original/src/components/LoginForm/Otp/index.tsx +89 -73
  128. package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
  129. package/themes/original/src/components/LoginForm/index.tsx +43 -19
  130. package/themes/original/src/components/LottieAnimation/index.tsx +78 -0
  131. package/themes/original/src/components/MessageListing/index.tsx +16 -42
  132. package/themes/original/src/components/Messages/index.tsx +32 -10
  133. package/themes/original/src/components/MomentOption/index.tsx +195 -88
  134. package/themes/original/src/components/MultiCart/index.tsx +50 -0
  135. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +117 -96
  136. package/themes/original/src/components/MultiCheckout/index.tsx +248 -83
  137. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
  138. package/themes/original/src/components/MultiOrdersDetails/index.tsx +67 -20
  139. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
  140. package/themes/original/src/components/MyOrders/index.tsx +66 -17
  141. package/themes/original/src/components/NavBar/index.tsx +6 -11
  142. package/themes/original/src/components/Notifications/index.tsx +144 -0
  143. package/themes/original/src/components/Notifications/styles.tsx +20 -0
  144. package/themes/original/src/components/OrderDetails/OrderEta.tsx +61 -0
  145. package/themes/original/src/components/OrderDetails/index.tsx +262 -347
  146. package/themes/original/src/components/OrderDetails/styles.tsx +10 -1
  147. package/themes/original/src/components/OrderItAgain/index.tsx +47 -43
  148. package/themes/original/src/components/OrderProgress/index.tsx +74 -112
  149. package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
  150. package/themes/original/src/components/OrderSummary/index.tsx +68 -29
  151. package/themes/original/src/components/OrderTypeSelector/index.tsx +4 -3
  152. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +28 -19
  153. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
  154. package/themes/original/src/components/OrdersOption/index.tsx +101 -89
  155. package/themes/original/src/components/PageBanner/index.tsx +171 -0
  156. package/themes/original/src/components/PageBanner/styles.tsx +11 -0
  157. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
  158. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  159. package/themes/original/src/components/PaymentOptions/index.tsx +3 -3
  160. package/themes/original/src/components/PhoneInputNumber/index.tsx +3 -3
  161. package/themes/original/src/components/PlaceSpot/index.tsx +12 -6
  162. package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
  163. package/themes/original/src/components/ProductForm/index.tsx +240 -261
  164. package/themes/original/src/components/ProductForm/styles.tsx +4 -7
  165. package/themes/original/src/components/ProductItemAccordion/index.tsx +200 -128
  166. package/themes/original/src/components/ProductOptionSubOption/index.tsx +18 -10
  167. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +1 -2
  168. package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
  169. package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -49
  170. package/themes/original/src/components/ProfessionalProfile/index.tsx +54 -14
  171. package/themes/original/src/components/Promotions/index.tsx +234 -220
  172. package/themes/original/src/components/Promotions/styles.tsx +10 -3
  173. package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
  174. package/themes/original/src/components/ReviewOrder/index.tsx +26 -9
  175. package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
  176. package/themes/original/src/components/ReviewProducts/index.tsx +7 -4
  177. package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
  178. package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
  179. package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
  180. package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
  181. package/themes/original/src/components/ServiceForm/index.tsx +377 -270
  182. package/themes/original/src/components/Sessions/index.tsx +11 -8
  183. package/themes/original/src/components/Sessions/styles.tsx +5 -0
  184. package/themes/original/src/components/SignupForm/index.tsx +79 -66
  185. package/themes/original/src/components/SingleOrderCard/index.tsx +148 -62
  186. package/themes/original/src/components/SingleOrderCard/styles.tsx +11 -9
  187. package/themes/original/src/components/SingleProductCard/index.tsx +111 -56
  188. package/themes/original/src/components/SingleProductCard/styles.tsx +27 -13
  189. package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
  190. package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
  191. package/themes/original/src/components/StripeCardsList/index.tsx +1 -1
  192. package/themes/original/src/components/StripeElementsForm/index.tsx +4 -1
  193. package/themes/original/src/components/UpsellingProducts/index.tsx +238 -218
  194. package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
  195. package/themes/original/src/components/UserDetails/index.tsx +8 -4
  196. package/themes/original/src/components/UserFormDetails/index.tsx +53 -54
  197. package/themes/original/src/components/UserProfile/index.tsx +58 -35
  198. package/themes/original/src/components/UserProfile/styles.ts +17 -0
  199. package/themes/original/src/components/UserProfileForm/index.tsx +21 -28
  200. package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
  201. package/themes/original/src/components/Wallets/index.tsx +31 -17
  202. package/themes/original/src/components/Wallets/styles.tsx +2 -0
  203. package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
  204. package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
  205. package/themes/original/src/components/shared/OBottomPopup.tsx +1 -1
  206. package/themes/original/src/components/shared/OButton.tsx +6 -2
  207. package/themes/original/src/components/shared/OIcon.tsx +8 -1
  208. package/themes/original/src/components/shared/OInput.tsx +10 -1
  209. package/themes/original/src/components/shared/OModal.tsx +3 -3
  210. package/themes/original/src/layouts/Container.tsx +13 -9
  211. package/themes/original/src/types/index.tsx +47 -9
  212. package/themes/original/src/utils/index.tsx +364 -58
  213. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -1,12 +1,5 @@
1
1
  import styled, { css } from 'styled-components/native';
2
2
 
3
- export const Card = styled.TouchableOpacity`
4
- margin-vertical: 20px;
5
- border-radius: 7.6px;
6
- width: 100%;
7
- position: relative;
8
- `
9
-
10
3
  export const BusinessHero = styled.View`
11
4
  position: relative;
12
5
  border-top-right-radius: 7.6px;
@@ -16,7 +9,7 @@ export const BusinessHero = styled.View`
16
9
 
17
10
  export const BusinessContent = styled.View`
18
11
  padding-horizontal: 18px;
19
- padding-bottom: 18px;
12
+ padding-bottom: 10px;
20
13
  border-bottom-left-radius: 7.6px;
21
14
  border-bottom-right-radius: 7.6px;
22
15
  border-width: 1px;
@@ -46,7 +39,7 @@ export const BusinessState = styled.View`
46
39
  `
47
40
 
48
41
  export const BusinessLogo = styled.View`
49
-
42
+
50
43
  `
51
44
 
52
45
  export const ReviewAndFavorite = styled.View`
@@ -79,4 +72,24 @@ export const RibbonBox = styled.View`
79
72
  ${(props: any) => props.isCapsule && css`
80
73
  border-radius: 50px;
81
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;
82
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
  />
@@ -1,6 +1,6 @@
1
1
  import React, { useState, useRef, useEffect } from 'react';
2
2
  import { TouchableOpacity, View } from 'react-native';
3
- import { useOrder, useLanguage, useUtils, useConfig } from 'ordering-components/native';
3
+ import { useOrder, useLanguage, useUtils, useConfig, useEvent } from 'ordering-components/native';
4
4
  import { useTheme } from 'styled-components/native';
5
5
  import {
6
6
  BIContainer,
@@ -22,7 +22,8 @@ export const BusinessItemAccordion = (props: any) => {
22
22
  handleClearProducts,
23
23
  handleClickCheckout,
24
24
  checkoutButtonDisabled,
25
- isMultiCheckout
25
+ isMultiCheckout,
26
+ isFromUpselling
26
27
  } = props
27
28
 
28
29
  const [orderState] = useOrder();
@@ -30,6 +31,7 @@ export const BusinessItemAccordion = (props: any) => {
30
31
  const [{ parsePrice }] = useUtils();
31
32
  const [{ configs }] = useConfig()
32
33
  const theme = useTheme();
34
+ const [events] = useEvent()
33
35
 
34
36
  const isCartPending = cart?.status === 2
35
37
  const isClosed = !cart?.valid_schedule
@@ -37,6 +39,7 @@ export const BusinessItemAccordion = (props: any) => {
37
39
  const isBusinessChangeEnabled = configs?.cart_change_business_validation?.value === '1'
38
40
 
39
41
  const [isActive, setActiveState] = useState(!!singleBusiness)
42
+ const [viewedCart, setViewedCart] = useState<any>(null)
40
43
 
41
44
  useEffect(() => {
42
45
  const cartsArray = Object.values(orderState?.carts)
@@ -46,6 +49,21 @@ export const BusinessItemAccordion = (props: any) => {
46
49
  }
47
50
  }, [orderState?.carts, isClosed])
48
51
 
52
+ const subtotalWithTaxes = cart?.taxes?.reduce((acc: any, item: any) => {
53
+ if (item?.type === 1)
54
+ return acc = acc + item?.summary?.tax
55
+ return acc = acc
56
+ }, cart?.subtotal)
57
+
58
+ useEffect(() => {
59
+ if (isActive && !isFromUpselling) {
60
+ if (cart?.uuid !== viewedCart?.uuid) {
61
+ setViewedCart(cart)
62
+ events.emit('cart_viewed', cart)
63
+ }
64
+ }
65
+ }, [isActive, viewedCart])
66
+
49
67
  return (
50
68
  <BIContainer isClosed={isClosed} isMultiCheckout={isMultiCheckout} checkoutVisible={!isActive && !isClosed && !!isProducts && !checkoutButtonDisabled}>
51
69
  <BIHeader
@@ -56,23 +74,6 @@ export const BusinessItemAccordion = (props: any) => {
56
74
  <BIInfo>
57
75
  <BIContentInfo>
58
76
  <OText size={16} lineHeight={24} weight={'600'}>{cart?.business?.name}</OText>
59
- {/* {orderState?.options?.type === 1 ? (
60
- <View style={{ display: 'flex', flexDirection: 'row', alignItems: 'center' }}>
61
- <MaterialCommunityIcon
62
- name='clock-outline'
63
- size={24}
64
- />
65
- <OText>{convertHoursToMinutes(cart?.business?.delivery_time)}</OText>
66
- </View>
67
- ) : (
68
- <View style={{ display: 'flex', flexDirection: 'row', alignItems: 'center' }}>
69
- <MaterialCommunityIcon
70
- name='clock-outline'
71
- size={24}
72
- />
73
- <OText>{convertHoursToMinutes(cart?.business?.pickup_time)}</OText>
74
- </View>
75
- )} */}
76
77
  <View style={{ flexDirection: 'row' }}>
77
78
  {props.onNavigationRedirect && !isClosed && (
78
79
  <>
@@ -81,7 +82,7 @@ export const BusinessItemAccordion = (props: any) => {
81
82
  </TouchableOpacity>
82
83
  </>
83
84
  )}
84
- {!isCartPending && !isClosed && (
85
+ {!isCartPending && (
85
86
  <>
86
87
  <OText color={theme.colors.textSecondary}>{' \u2022 '}</OText>
87
88
  <OAlert
@@ -102,7 +103,7 @@ export const BusinessItemAccordion = (props: any) => {
102
103
  <OText
103
104
  size={12}
104
105
  lineHeight={18}
105
- color={theme.colors.textSecondary}
106
+ color={theme.colors.primary}
106
107
  style={{ textDecorationLine: 'underline' }}
107
108
  >
108
109
  {t('CHANGE_STORE', 'Change store')}
@@ -149,9 +150,9 @@ export const BusinessItemAccordion = (props: any) => {
149
150
  <OButton
150
151
  onClick={handleClickCheckout}
151
152
  textStyle={{ color: 'white', textAlign: 'center', flex: 1 }}
152
- style={{ width: 160, flexDirection: 'row', justifyContent: 'center', borderRadius: 7.6, shadowOpacity: 0 }}
153
+ style={{ width: 180, flexDirection: 'row', justifyContent: 'center', borderRadius: 7.6, shadowOpacity: 0 }}
153
154
  text={t('CHECKOUT', 'Checkout')}
154
- bgColor={(cart?.subtotal < cart?.minimum || !cart?.valid_address) ? theme.colors.secundary : theme.colors.primary}
155
+ bgColor={(subtotalWithTaxes < cart?.minimum || !cart?.valid_address) ? theme.colors.secundary : theme.colors.primary}
155
156
  borderColor={theme.colors.primary}
156
157
  isDisabled={checkoutButtonDisabled}
157
158
  />
@@ -52,7 +52,8 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
52
52
  brandList,
53
53
  onNavigationRedirect,
54
54
  handleUpdateBusinessList,
55
- handleUpdateProducts
55
+ handleUpdateProducts,
56
+ brandId
56
57
  } = props
57
58
 
58
59
  const screenHeight = Dimensions.get('window').height;
@@ -75,6 +76,8 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
75
76
  { text: t('PICKUP_TIME', 'Pickup time'), value: 'pickup_time' }
76
77
  ]
77
78
 
79
+ const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
80
+
78
81
  const priceList = [
79
82
  { level: '1', content: '$' },
80
83
  { level: '2', content: '$$' },
@@ -96,7 +99,7 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
96
99
  width: '100%'
97
100
  },
98
101
  searchInput: {
99
- fontSize: 10,
102
+ fontSize: 12,
100
103
  },
101
104
  productsContainer: {
102
105
  marginTop: 20
@@ -188,7 +191,8 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
188
191
 
189
192
  const isInteger = (val: any) => Number.isInteger(Number(val)) && !!val
190
193
 
191
- const onProductClick = (business: any, categoryId: any, productId: any) => {
194
+
195
+ const onProductClick = (business: any, categoryId: any, productId: any, product: any) => {
192
196
  if (!isInteger(business?.id) ||
193
197
  !isInteger(categoryId) ||
194
198
  !isInteger(productId) ||
@@ -196,17 +200,20 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
196
200
  showToast(ToastType.error, t('NOT_AVAILABLE', 'Not Available'))
197
201
  return
198
202
  }
199
-
203
+ const currentCart: any = Object.values(orderState.carts).find((cart: any) => cart?.business?.slug === business?.slug) ?? {}
204
+ const productAddedToCartLength = currentCart?.products?.reduce((productsLength: number, Cproduct: any) => { return productsLength + (Cproduct?.id === productId ? Cproduct?.quantity : 0) }, 0) || 0
200
205
  navigation.navigate('ProductDetails', {
201
206
  isRedirect: 'business',
202
207
  businessId: business?.id,
203
208
  categoryId: categoryId,
204
209
  productId: productId,
210
+ product: product,
205
211
  business: {
206
212
  store: business.slug,
207
213
  header: business.header,
208
214
  logo: business.logo,
209
- }
215
+ },
216
+ productAddedToCartLength
210
217
  })
211
218
  }
212
219
 
@@ -226,17 +233,23 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
226
233
  }, [isFocused])
227
234
 
228
235
  return (
229
- <BContainer>
236
+ <BContainer
237
+ style={{ paddingHorizontal: isChewLayout ? 20 : 40 }}
238
+ >
230
239
  <SearchWrapper>
231
240
  <SearchBar
232
241
  lazyLoad
233
- inputStyle={{ ...styles.searchInput, ...Platform.OS === 'ios' ? {} : { paddingBottom: 4 } }}
234
- placeholder={`${t('SEARCH_BUSINESSES', 'Search Businesses')} / ${t('TYPE_AT_LEAST_3_CHARACTERS', 'type at least 3 characters')}`}
242
+ {...(isChewLayout && { height: 55 })}
243
+ inputStyle={{ ...styles.searchInput }}
244
+ placeholder={t('SEARCH_BUSINESSES', 'Search Businesses')}
235
245
  onSearch={(val: string) => handleChangeTermValue(val)}
236
246
  value={termValue}
237
247
  iconCustomRight={<AntDesignIcon name='filter' size={16} style={{ bottom: 2 }} onPress={() => handleOpenfilters()} />}
238
248
  />
239
249
  </SearchWrapper>
250
+ <OText size={12} lineHeight={20} color={theme.colors.textThird} mLeft={5}>
251
+ {t('TYPE_AT_LEAST_3_CHARACTERS', 'Type at least 3 characters')}
252
+ </OText>
240
253
  {
241
254
  noResults && (
242
255
  <View>
@@ -253,26 +266,41 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
253
266
  onNavigationRedirect={onNavigationRedirect}
254
267
  BusinessControllerSkeletons={BusinessControllerSkeletons}
255
268
  businessPaginationProps={paginationProps}
269
+ franchiseId={brandId}
270
+ hideBackBtn
271
+ titleStyle={{
272
+ paddingHorizontal: 0,
273
+ marginTop: 0,
274
+ marginLeft: 0
275
+ }}
256
276
  />
257
277
  )}
258
278
 
259
- <OptionTitle isBusinessesSearchList={!!businessesSearchList}>
260
- <OText size={16} lineHeight={24} weight={'500'} color={theme.colors.textNormal} mBottom={10}>
261
- {t('BUSINESSES', 'Businesses')}
262
- </OText>
263
- </OptionTitle>
264
- <ScrollView horizontal>
279
+ {businessesSearchList.businesses?.length > 0 && (
280
+ <OptionTitle isBusinessesSearchList={!!businessesSearchList}>
281
+ <OText size={16} lineHeight={24} weight={'500'} color={theme.colors.textNormal} mBottom={10}>
282
+ {t('BUSINESSES', 'Businesses')}
283
+ </OText>
284
+ </OptionTitle>
285
+ )}
286
+ <ScrollView horizontal showsHorizontalScrollIndicator={false}>
265
287
  {businessesSearchList.businesses?.length > 0 && businessesSearchList.businesses.map((business: any, i: number) => (
266
- <BusinessController
288
+ <View
267
289
  key={business.id}
268
- business={business}
269
- isBusinessOpen={business.open}
270
- enableIntersection={false}
271
- handleCustomClick={() => onBusinessClick(business)}
272
- handleUpdateBusinessList={handleUpdateBusinessList}
273
- orderType={orderState?.options?.type}
274
- style={{ width: screenWidth - 120, marginRight: (businessesSearchList.loading || i !== businessesSearchList.businesses?.length - 1) ? 20 : 0 }}
275
- />
290
+ style={{
291
+ width: screenWidth - 120,
292
+ marginRight: (businessesSearchList.loading || i !== businessesSearchList.businesses?.length - 1) ? 20 : 0
293
+ }}
294
+ >
295
+ <BusinessController
296
+ business={business}
297
+ isBusinessOpen={business.open}
298
+ enableIntersection={false}
299
+ handleCustomClick={() => onBusinessClick(business)}
300
+ handleUpdateBusinessList={handleUpdateBusinessList}
301
+ orderType={orderState?.options?.type}
302
+ />
303
+ </View>
276
304
  ))}
277
305
  {!businessesSearchList.loading && paginationProps?.totalPages && paginationProps?.currentPage < paginationProps?.totalPages && (
278
306
  <LoadMoreBusinessContainer>
@@ -341,7 +369,7 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
341
369
  product={product}
342
370
  enableIntersection={false}
343
371
  businessId={business?.id}
344
- onProductClick={(product: any) => onProductClick(business, category?.id, product?.id)}
372
+ onProductClick={(product: any) => onProductClick(business, category?.id, product?.id, product)}
345
373
  productAddedToCartLength={0}
346
374
  handleUpdateProducts={(productId: number, changes: any) => handleUpdateProducts(productId, category?.id, business?.id, changes)}
347
375
  style={{ width: screenWidth - 80, maxWidth: screenWidth - 80, marginRight: 20 }}