ordering-ui-react-native 0.15.67 → 0.15.68-release

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (216) hide show
  1. package/package.json +7 -3
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/ActiveOrders/index.tsx +61 -63
  4. package/src/components/ActiveOrders/styles.tsx +1 -1
  5. package/src/components/AddressForm/index.tsx +18 -2
  6. package/src/components/BusinessBasicInformation/index.tsx +11 -19
  7. package/src/components/BusinessController/index.tsx +16 -8
  8. package/src/components/BusinessInformation/index.tsx +14 -0
  9. package/src/components/BusinessTypeFilter/index.tsx +1 -2
  10. package/src/components/BusinessesListing/index.tsx +1 -1
  11. package/src/components/Checkout/index.tsx +23 -2
  12. package/src/components/DriverTips/index.tsx +11 -6
  13. package/src/components/LanguageSelector/index.tsx +6 -2
  14. package/src/components/LoginForm/index.tsx +120 -30
  15. package/src/components/LoginForm/styles.tsx +6 -0
  16. package/src/components/OrderDetails/index.tsx +7 -21
  17. package/src/components/PaymentOptions/index.tsx +67 -50
  18. package/src/components/PaymentOptionsWebView/index.tsx +120 -121
  19. package/src/components/ReviewDriver/index.tsx +1 -1
  20. package/src/components/ReviewOrder/index.tsx +2 -1
  21. package/src/components/ReviewProducts/index.tsx +11 -0
  22. package/src/components/SignupForm/index.tsx +145 -61
  23. package/src/components/SingleProductCard/index.tsx +16 -4
  24. package/src/components/SingleProductReview/index.tsx +1 -1
  25. package/src/components/StripeMethodForm/index.tsx +22 -24
  26. package/src/components/UpsellingProducts/index.tsx +1 -1
  27. package/src/components/UserProfileForm/index.tsx +63 -6
  28. package/src/components/UserProfileForm/styles.tsx +8 -0
  29. package/src/components/VerifyPhone/styles.tsx +1 -2
  30. package/src/components/shared/OModal.tsx +1 -1
  31. package/src/hooks/useCountdownTimer.tsx +26 -0
  32. package/src/navigators/CheckoutNavigator.tsx +6 -0
  33. package/src/navigators/HomeNavigator.tsx +12 -0
  34. package/src/pages/BusinessesListing.tsx +7 -6
  35. package/src/pages/MultiCheckout.tsx +31 -0
  36. package/src/pages/MultiOrdersDetails.tsx +27 -0
  37. package/src/pages/OrderDetails.tsx +1 -1
  38. package/src/pages/ReviewDriver.tsx +2 -2
  39. package/src/pages/ReviewOrder.tsx +2 -2
  40. package/src/pages/Sessions.tsx +22 -0
  41. package/src/theme.json +0 -1
  42. package/src/types/index.tsx +18 -11
  43. package/src/utils/index.tsx +68 -2
  44. package/themes/business/index.tsx +4 -0
  45. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +103 -15
  46. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -0
  47. package/themes/business/src/components/Chat/index.tsx +42 -90
  48. package/themes/business/src/components/DriverMap/index.tsx +6 -5
  49. package/themes/business/src/components/DriverSchedule/index.tsx +71 -0
  50. package/themes/business/src/components/DriverSchedule/styles.tsx +6 -0
  51. package/themes/business/src/components/LoginForm/index.tsx +89 -2
  52. package/themes/business/src/components/LoginForm/styles.tsx +6 -0
  53. package/themes/business/src/components/LogoutButton/index.tsx +1 -1
  54. package/themes/business/src/components/NewOrderNotification/index.tsx +26 -13
  55. package/themes/business/src/components/OrderDetails/Business.tsx +2 -2
  56. package/themes/business/src/components/OrderDetails/Delivery.tsx +28 -11
  57. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +14 -7
  58. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +6 -0
  59. package/themes/business/src/components/OrdersListManager/index.tsx +1 -1
  60. package/themes/business/src/components/OrdersOption/index.tsx +8 -4
  61. package/themes/business/src/components/PreviousOrders/index.tsx +7 -7
  62. package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
  63. package/themes/business/src/components/ScheduleBlocked/index.tsx +53 -0
  64. package/themes/business/src/components/UserFormDetails/index.tsx +5 -2
  65. package/themes/business/src/components/UserProfileForm/index.tsx +28 -4
  66. package/themes/business/src/components/shared/OModal.tsx +41 -38
  67. package/themes/business/src/types/index.tsx +8 -2
  68. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  69. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  70. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  71. package/themes/kiosk/src/components/BusinessMenu/index.tsx +39 -28
  72. package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -3
  73. package/themes/kiosk/src/components/Cart/index.tsx +11 -12
  74. package/themes/kiosk/src/components/CartBottomSheet/index.tsx +9 -2
  75. package/themes/kiosk/src/components/CartContent/index.tsx +0 -11
  76. package/themes/kiosk/src/components/CartItem/index.tsx +4 -3
  77. package/themes/kiosk/src/components/CategoriesMenu/index.tsx +107 -62
  78. package/themes/kiosk/src/components/Checkout/index.tsx +40 -22
  79. package/themes/kiosk/src/components/CustomerName/index.tsx +0 -6
  80. package/themes/kiosk/src/components/DrawerView/index.tsx +1 -0
  81. package/themes/kiosk/src/components/DrawerView/styles.tsx +2 -2
  82. package/themes/kiosk/src/components/NavBar/index.tsx +29 -20
  83. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  84. package/themes/kiosk/src/components/OrderDetails/index.tsx +32 -27
  85. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +9 -11
  86. package/themes/kiosk/src/components/PaymentOptions/index.tsx +56 -54
  87. package/themes/kiosk/src/components/ProductForm/index.tsx +7 -8
  88. package/themes/kiosk/src/components/ProductItemAccordion/index.tsx +2 -2
  89. package/themes/kiosk/src/components/ProductOption/index.tsx +1 -1
  90. package/themes/kiosk/src/components/ProductOptionSubOption/index.tsx +3 -1
  91. package/themes/kiosk/src/components/UpsellingProducts/index.tsx +16 -5
  92. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  93. package/themes/kiosk/src/types/index.d.ts +1 -0
  94. package/themes/original/index.tsx +30 -8
  95. package/themes/original/src/components/ActiveOrders/index.tsx +15 -132
  96. package/themes/original/src/components/ActiveOrders/styles.tsx +0 -54
  97. package/themes/original/src/components/AddressForm/index.tsx +7 -6
  98. package/themes/original/src/components/AddressList/index.tsx +30 -18
  99. package/themes/original/src/components/AppleLogin/index.tsx +6 -8
  100. package/themes/original/src/components/BusinessBasicInformation/index.tsx +304 -158
  101. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +6 -2
  102. package/themes/original/src/components/BusinessController/index.tsx +195 -96
  103. package/themes/original/src/components/BusinessController/styles.tsx +5 -0
  104. package/themes/original/src/components/BusinessItemAccordion/index.tsx +8 -5
  105. package/themes/original/src/components/BusinessItemAccordion/styles.tsx +3 -1
  106. package/themes/original/src/components/BusinessListingSearch/index.tsx +231 -63
  107. package/themes/original/src/components/BusinessListingSearch/styles.tsx +22 -2
  108. package/themes/original/src/components/BusinessPreorder/index.tsx +1 -1
  109. package/themes/original/src/components/BusinessProductsCategories/index.tsx +2 -2
  110. package/themes/original/src/components/BusinessProductsList/CategoryDescription/index.tsx +44 -0
  111. package/themes/original/src/components/BusinessProductsList/index.tsx +53 -52
  112. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  113. package/themes/original/src/components/BusinessProductsListing/index.tsx +318 -155
  114. package/themes/original/src/components/BusinessProductsListing/styles.tsx +32 -0
  115. package/themes/original/src/components/BusinessReviews/index.tsx +6 -1
  116. package/themes/original/src/components/BusinessTypeFilter/index.tsx +106 -39
  117. package/themes/original/src/components/BusinessTypeFilter/styles.tsx +2 -0
  118. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +560 -0
  119. package/themes/original/src/components/BusinessesListing/{styles.tsx → Layout/Appointment/styles.tsx} +24 -2
  120. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +679 -0
  121. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +137 -0
  122. package/themes/original/src/components/BusinessesListing/index.tsx +99 -458
  123. package/themes/original/src/components/Cart/index.tsx +61 -42
  124. package/themes/original/src/components/Checkout/index.tsx +90 -39
  125. package/themes/original/src/components/DriverTips/index.tsx +17 -12
  126. package/themes/original/src/components/Favorite/index.tsx +92 -0
  127. package/themes/original/src/components/Favorite/styles.tsx +22 -0
  128. package/themes/original/src/components/FavoriteList/index.tsx +298 -0
  129. package/themes/original/src/components/FavoriteList/styles.tsx +5 -0
  130. package/themes/original/src/components/ForgotPasswordForm/index.tsx +84 -4
  131. package/themes/original/src/components/GPSButton/index.tsx +15 -8
  132. package/themes/original/src/components/GoogleMap/index.tsx +11 -11
  133. package/themes/original/src/components/Help/index.tsx +21 -4
  134. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +18 -1
  135. package/themes/original/src/components/LastOrders/index.tsx +12 -1
  136. package/themes/original/src/components/LoginForm/Otp/index.tsx +91 -0
  137. package/themes/original/src/components/LoginForm/Otp/styles.tsx +7 -0
  138. package/themes/original/src/components/LoginForm/index.tsx +332 -164
  139. package/themes/original/src/components/LoginForm/styles.tsx +1 -3
  140. package/themes/original/src/components/MessageListing/index.tsx +10 -1
  141. package/themes/original/src/components/Messages/index.tsx +1 -1
  142. package/themes/original/src/components/MomentSelector/index.tsx +197 -0
  143. package/themes/original/src/components/MomentSelector/styles.tsx +6 -0
  144. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +243 -0
  145. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/styles.tsx +46 -0
  146. package/themes/original/src/components/MultiCheckout/index.tsx +298 -0
  147. package/themes/original/src/components/MultiCheckout/styles.tsx +59 -0
  148. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +372 -0
  149. package/themes/original/src/components/MultiOrdersDetails/index.tsx +258 -0
  150. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +50 -0
  151. package/themes/original/src/components/MyOrders/index.tsx +120 -32
  152. package/themes/original/src/components/MyOrders/styles.tsx +8 -1
  153. package/themes/original/src/components/NavBar/index.tsx +4 -4
  154. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +167 -0
  155. package/themes/original/src/components/OrderDetails/index.tsx +148 -63
  156. package/themes/original/src/components/OrderDetails/styles.tsx +1 -2
  157. package/themes/original/src/components/OrderSummary/index.tsx +6 -6
  158. package/themes/original/src/components/OrderTypeSelector/index.tsx +79 -35
  159. package/themes/original/src/components/OrderTypeSelector/styles.tsx +19 -1
  160. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +153 -0
  161. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +6 -0
  162. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +53 -0
  163. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +6 -0
  164. package/themes/original/src/components/OrdersOption/index.tsx +137 -38
  165. package/themes/original/src/components/OrdersOption/styles.tsx +4 -1
  166. package/themes/original/src/components/PaymentOptionCash/index.tsx +2 -2
  167. package/themes/original/src/components/PaymentOptionWallet/index.tsx +17 -23
  168. package/themes/original/src/components/PaymentOptionWallet/styles.tsx +1 -1
  169. package/themes/original/src/components/PaymentOptions/index.tsx +58 -37
  170. package/themes/original/src/components/PhoneInputNumber/index.tsx +5 -11
  171. package/themes/original/src/components/PreviousOrders/index.tsx +18 -147
  172. package/themes/original/src/components/ProductForm/index.tsx +718 -679
  173. package/themes/original/src/components/ProductForm/styles.tsx +6 -2
  174. package/themes/original/src/components/ProductItemAccordion/index.tsx +2 -2
  175. package/themes/original/src/components/ProductOption/index.tsx +1 -1
  176. package/themes/original/src/components/ProductOptionSubOption/index.tsx +18 -12
  177. package/themes/original/src/components/ProfessionalFilter/index.tsx +128 -0
  178. package/themes/original/src/components/ProfessionalFilter/styles.tsx +0 -0
  179. package/themes/original/src/components/ProfessionalProfile/index.tsx +298 -0
  180. package/themes/original/src/components/ProfessionalProfile/styles.tsx +46 -0
  181. package/themes/original/src/components/Promotions/index.tsx +151 -133
  182. package/themes/original/src/components/Promotions/styles.tsx +3 -23
  183. package/themes/original/src/components/ReviewDriver/index.tsx +6 -6
  184. package/themes/original/src/components/ReviewOrder/index.tsx +1 -1
  185. package/themes/original/src/components/ReviewTrigger/index.tsx +118 -0
  186. package/themes/original/src/components/ReviewTrigger/styles.tsx +34 -0
  187. package/themes/original/src/components/SearchBar/index.tsx +13 -5
  188. package/themes/original/src/components/ServiceForm/index.tsx +579 -0
  189. package/themes/original/src/components/ServiceForm/styles.tsx +50 -0
  190. package/themes/original/src/components/Sessions/index.tsx +160 -0
  191. package/themes/original/src/components/Sessions/styles.tsx +15 -0
  192. package/themes/original/src/components/SignupForm/index.tsx +237 -126
  193. package/themes/original/src/components/SingleOrderCard/index.tsx +275 -0
  194. package/themes/original/src/components/SingleOrderCard/styles.tsx +54 -0
  195. package/themes/original/src/components/SingleProductCard/index.tsx +215 -90
  196. package/themes/original/src/components/SingleProductCard/styles.tsx +2 -2
  197. package/themes/original/src/components/StripeElementsForm/index.tsx +16 -8
  198. package/themes/original/src/components/StripeElementsForm/naked.tsx +2 -2
  199. package/themes/original/src/components/UpsellingProducts/index.tsx +86 -74
  200. package/themes/original/src/components/UserDetails/index.tsx +15 -81
  201. package/themes/original/src/components/UserFormDetails/index.tsx +98 -66
  202. package/themes/original/src/components/UserProfile/index.tsx +11 -2
  203. package/themes/original/src/components/UserProfileForm/index.tsx +33 -22
  204. package/themes/original/src/components/UserVerification/index.tsx +178 -192
  205. package/themes/original/src/components/VerifyPhone/index.tsx +10 -7
  206. package/themes/original/src/components/VerifyPhone/styles.tsx +2 -1
  207. package/themes/original/src/components/Wallets/index.tsx +25 -12
  208. package/themes/original/src/components/shared/OBottomPopup.tsx +44 -13
  209. package/themes/original/src/components/shared/OButton.tsx +2 -0
  210. package/themes/original/src/components/shared/OInput.tsx +3 -2
  211. package/themes/original/src/components/shared/OModal.tsx +4 -2
  212. package/themes/original/src/layouts/FloatingBottomContainer.tsx +5 -1
  213. package/themes/original/src/types/index.tsx +187 -35
  214. package/themes/original/src/utils/index.tsx +94 -1
  215. package/themes/single-business/src/components/OrderTypeSelector/index.tsx +1 -1
  216. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -26,6 +26,7 @@ interface Props {
26
26
  isNotDecoration?: boolean;
27
27
  styleCloseButton?: any;
28
28
  order?: any;
29
+ hideIcons?: boolean
29
30
  }
30
31
 
31
32
  const OModal = (props: Props): React.ReactElement => {
@@ -47,6 +48,7 @@ const OModal = (props: Props): React.ReactElement => {
47
48
  style,
48
49
  styleCloseButton,
49
50
  order,
51
+ hideIcons
50
52
  } = props;
51
53
 
52
54
  const theme = useTheme();
@@ -70,8 +72,8 @@ const OModal = (props: Props): React.ReactElement => {
70
72
  alignItems: 'center',
71
73
  paddingHorizontal: 30,
72
74
  paddingTop: 30,
73
- paddingBottom: 25,
74
- borderBottomWidth: 2,
75
+ paddingBottom: !hideIcons ? 25 : 15,
76
+ borderBottomWidth: !hideIcons ? 2 : 0,
75
77
  borderBottomColor: '#e6e6e6',
76
78
  },
77
79
  titleGroups: {
@@ -165,7 +167,7 @@ const OModal = (props: Props): React.ReactElement => {
165
167
  transparent={isTransparent}
166
168
  visible={open}
167
169
  onRequestClose={() => {
168
- onClose();
170
+ onClose && onClose();
169
171
  }}
170
172
  style={{
171
173
  height: '100%',
@@ -218,50 +220,51 @@ const OModal = (props: Props): React.ReactElement => {
218
220
  {title}
219
221
  </OText>
220
222
  </View>
223
+ {!hideIcons && (
224
+ <View style={styles.titleGroups}>
225
+ <View style={styles.shadow}>
226
+ {order?.business?.logo ? (
227
+ <OIcon
228
+ url={optimizeImage(
229
+ order?.business?.logo,
230
+ 'h_300,c_limit',
231
+ )}
232
+ style={styles.titleIcons}
233
+ />
234
+ ) : (
235
+ <OIcon
236
+ src={theme.images.dummies.businessLogo}
237
+ style={styles.titleIcons}
238
+ />
239
+ )}
240
+ </View>
221
241
 
222
- <View style={styles.titleGroups}>
223
- <View style={styles.shadow}>
224
- {order?.business?.logo ? (
242
+ <View style={styles.shadow}>
225
243
  <OIcon
226
244
  url={optimizeImage(
227
- order?.business?.logo,
245
+ order?.customer?.photo ||
246
+ theme?.images?.dummies?.customerPhoto,
228
247
  'h_300,c_limit',
229
248
  )}
230
249
  style={styles.titleIcons}
231
250
  />
232
- ) : (
233
- <OIcon
234
- src={theme.images.dummies.businessLogo}
235
- style={styles.titleIcons}
236
- />
237
- )}
238
- </View>
251
+ </View>
239
252
 
240
- <View style={styles.shadow}>
241
- <OIcon
242
- url={optimizeImage(
243
- order?.customer?.photo ||
244
- theme?.images?.dummies?.customerPhoto,
245
- 'h_300,c_limit',
246
- )}
247
- style={styles.titleIcons}
248
- />
253
+ {order?.driver && (
254
+ <View style={styles.shadow}>
255
+ <OIcon
256
+ url={
257
+ optimizeImage(
258
+ order?.driver?.photo,
259
+ 'h_300,c_limit',
260
+ ) || theme?.images?.dummies?.driverPhoto
261
+ }
262
+ style={styles.titleIcons}
263
+ />
264
+ </View>
265
+ )}
249
266
  </View>
250
-
251
- {order?.driver && (
252
- <View style={styles.shadow}>
253
- <OIcon
254
- url={
255
- optimizeImage(
256
- order?.driver?.photo,
257
- 'h_300,c_limit',
258
- ) || theme?.images?.dummies?.driverPhoto
259
- }
260
- style={styles.titleIcons}
261
- />
262
- </View>
263
- )}
264
- </View>
267
+ )}
265
268
  </View>
266
269
  )}
267
270
  {children}
@@ -20,6 +20,9 @@ export interface LoginParams {
20
20
  passwordInputIcon?: any;
21
21
  allowedLevels?: any;
22
22
  useRootPoint?: any;
23
+ notificationState?: any;
24
+ handleReCaptcha?: any;
25
+ enableReCaptcha?: any;
23
26
  }
24
27
  export interface ProfileParams {
25
28
  navigation?: any;
@@ -38,6 +41,7 @@ export interface ProfileParams {
38
41
  validationFields?: any;
39
42
  showField?: any;
40
43
  isRequiredField?: any;
44
+ isAlsea?: boolean;
41
45
  }
42
46
 
43
47
  export interface AddressListParams {
@@ -289,7 +293,8 @@ export interface OrdersOptionParams {
289
293
  handleClickLogisticOrder: (status: number, orderId: number) => void,
290
294
  logisticOrders: {orders: Array<any>, loading: boolean, error: Array<string> | string},
291
295
  loadLogisticOrders: () => void;
292
- isLogisticActivated?: boolean
296
+ isLogisticActivated?: boolean;
297
+ isAlsea?: boolean;
293
298
  }
294
299
  export interface ActiveOrdersParams {
295
300
  orders?: any;
@@ -373,6 +378,7 @@ export interface OrderDetailsParams {
373
378
  handleClickLogisticOrder?: (status: number, orderId: number) => void;
374
379
  orderTitle?: any;
375
380
  forceUpdate?: number;
381
+ getPermissions?: any
376
382
  }
377
383
  export interface ProductItemAccordionParams {
378
384
  isCartPending?: boolean;
@@ -578,4 +584,4 @@ export interface ReviewCustomerParams {
578
584
 
579
585
  export interface NoNetworkParams {
580
586
  image?: any;
581
- }
587
+ }
@@ -197,7 +197,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
197
197
  {isFarAway && (
198
198
  <FarAwayMessage style={styles.farAwayMsg}>
199
199
  <Ionicons name='md-warning-outline' style={styles.iconStyle} />
200
- <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'You are far from this address')}</OText>
200
+ <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'Your are far from this address')}</OText>
201
201
  </FarAwayMessage>
202
202
  )}
203
203
  {!auth && (
@@ -410,8 +410,7 @@ const LoginFormUI = (props: LoginParams) => {
410
410
  textInputProps={{
411
411
  returnKeyType: 'next',
412
412
  onSubmitEditing: () => inputRef?.current?.focus?.(),
413
- style: { borderWidth: 0, fontSize: 12 },
414
- maxLength: 10
413
+ style: { borderWidth: 0, fontSize: 12 }
415
414
  }}
416
415
  textWrapStyle={{ borderColor: theme.colors.clear, borderWidth: 0, height: 40, paddingStart: 0 }}
417
416
  />
@@ -155,7 +155,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
155
155
  {isFarAway && (
156
156
  <FarAwayMessage style={styles.farAwayMsg}>
157
157
  <Ionicons name='md-warning-outline' style={styles.iconStyle} />
158
- <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'You are far from this address')}</OText>
158
+ <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'Your are far from this address')}</OText>
159
159
  </FarAwayMessage>
160
160
  )}
161
161
  <View style={styles.wrapperOrderOptions}>
@@ -1,5 +1,5 @@
1
1
  import React, { useCallback, useEffect, useRef, useState } from 'react';
2
- import { PanResponder, TouchableOpacity, View } from 'react-native';
2
+ import { PanResponder, Platform, TouchableOpacity, View } from 'react-native';
3
3
  import {
4
4
  useLanguage,
5
5
  useOrder,
@@ -40,7 +40,7 @@ const BusinessMenu = (props:any): React.ReactElement => {
40
40
  const clearCartWhenTimeOut = () => {
41
41
  if (cart?.uuid) clearCart(cart?.uuid)
42
42
  }
43
- const timerId = useRef(false);
43
+ const timerId: any = useRef(false);
44
44
 
45
45
  const clearInactivityTimeout = () =>{
46
46
  clearTimeout(timerId.current);
@@ -93,6 +93,17 @@ const BusinessMenu = (props:any): React.ReactElement => {
93
93
  else showCartBottomSheet();
94
94
  }
95
95
 
96
+ const handleRedirect = () => {
97
+ navigation.navigate('DeliveryType', {
98
+ callback: () => {
99
+ navigation.navigate('Business');
100
+ },
101
+ goBack: () => {
102
+ navigation.goBack();
103
+ },
104
+ });
105
+ };
106
+
96
107
  return (
97
108
  <View style={{
98
109
  flex: 1,
@@ -109,31 +120,31 @@ const BusinessMenu = (props:any): React.ReactElement => {
109
120
  }}
110
121
  >
111
122
  <Container nopadding nestedScrollEnabled>
112
- <View style={{ paddingTop: 20 }}>
113
- <NavBar
114
- title={t('MENU_V21', 'Menu')}
115
- onActionLeft={goToBack}
116
- includeOrderTypeSelector
117
- rightComponent={cart && (
118
- <TouchableOpacity
119
- style={{ paddingHorizontal: 20, flexDirection: 'row', alignItems: 'center' }}
120
- onPress={onToggleCart}
123
+ {Platform.OS === 'android' && (<View style={{ paddingTop: 20 }} />)}
124
+ <NavBar
125
+ title={t('MENU_V21', 'Menu')}
126
+ onActionLeft={goToBack}
127
+ includeOrderTypeSelector
128
+ onClickTypes={handleRedirect}
129
+ rightComponent={cart && (
130
+ <TouchableOpacity
131
+ style={{ flexDirection: 'row', alignItems: 'center' }}
132
+ onPress={onToggleCart}
133
+ >
134
+ <OText
135
+ color={theme.colors.mediumGray}
121
136
  >
122
- <OText
123
- color={theme.colors.mediumGray}
124
- >
125
- {`${cart?.products?.length || 0} ${t('ITEMS', 'items')}`} {parsePrice(cart?.total || 0)} {' '}
126
- </OText>
127
-
128
- <MaterialIcon
129
- name={bottomSheetVisibility ? "cart-off" : "cart-outline"}
130
- color={theme.colors.primary}
131
- size={30}
132
- />
133
- </TouchableOpacity>
134
- )}
135
- />
136
- </View>
137
+ {`${cart?.products?.length || 0} ${t('ITEMS', 'items')}`} {parsePrice(cart?.total || 0)} {' '}
138
+ </OText>
139
+
140
+ <MaterialIcon
141
+ name={bottomSheetVisibility ? "cart-off" : "cart-outline"}
142
+ color={theme.colors.primary}
143
+ size={30}
144
+ />
145
+ </TouchableOpacity>
146
+ )}
147
+ />
137
148
 
138
149
  <BusinessProductsListing
139
150
  { ...businessProductsListingProps }
@@ -144,7 +155,7 @@ const BusinessMenu = (props:any): React.ReactElement => {
144
155
  </Container>
145
156
  </View>
146
157
 
147
- <View
158
+ {/* <View
148
159
  style={{
149
160
  flex: bottomSheetVisibility && orientationState?.orientation === PORTRAIT ? 0 : 0.8,
150
161
  display: bottomSheetVisibility ? 'flex' : 'none'
@@ -155,7 +166,7 @@ const BusinessMenu = (props:any): React.ReactElement => {
155
166
  resetInactivityTimeout={resetInactivityTimeout}
156
167
  clearInactivityTimeout={clearInactivityTimeout}
157
168
  />
158
- </View>
169
+ </View> */}
159
170
  </View>
160
171
  );
161
172
  };
@@ -1,5 +1,5 @@
1
- import React, { useEffect, useState } from 'react';
2
- import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
1
+ import React from 'react';
2
+ import { PlaceholderLine } from 'rn-placeholder';
3
3
  import { View, ScrollView, Platform } from 'react-native';
4
4
  import { useTheme } from 'styled-components/native';
5
5
  import { useDeviceOrientation } from '../../../../../src/hooks/DeviceOrientation';
@@ -21,7 +21,6 @@ const BusinessesListingUI = (props: any) => {
21
21
  navigation,
22
22
  businessesList,
23
23
  handleBusinessClick,
24
- paginationProps,
25
24
  } = props;
26
25
 
27
26
  const theme = useTheme();
@@ -110,7 +110,6 @@ const CartUI = (props: any) => {
110
110
  <NavBar
111
111
  title={t('CONFIRM_YOUR_ORDER', 'Confirm your order')}
112
112
  onActionLeft={goToBack}
113
- style={{ height: orientationState?.dimensions?.height * 0.08 }}
114
113
  btnStyle={{ paddingLeft: 0 }}
115
114
  rightComponent={(
116
115
  <OButton
@@ -238,8 +237,8 @@ const CartUI = (props: any) => {
238
237
  </OSTable>
239
238
  )}
240
239
  {
241
- cart?.offers?.length > 0 && cart?.offers?.filter((offer: any) => offer?.target === 1)?.map((offer: any) => (
242
- <OSTable key={offer.id}>
240
+ cart?.offers?.length > 0 && cart?.offers?.filter((offer: any) => offer?.target === 1)?.map((offer: any, i: number) => (
241
+ <OSTable key={`${offer?.id}_${i}`}>
243
242
  <OSRow>
244
243
  <OText>{offer.name}</OText>
245
244
  {offer.rate_type === 1 && (
@@ -263,8 +262,8 @@ const CartUI = (props: any) => {
263
262
  </OSTable>
264
263
  )}
265
264
  {
266
- cart.taxes?.length > 0 && cart.taxes.filter((tax: any) => tax.type === 2 && tax?.rate !== 0).map((tax: any) => (
267
- <OSTable key={tax.id}>
265
+ cart.taxes?.length > 0 && cart.taxes.filter((tax: any) => tax.type === 2 && tax?.rate !== 0).map((tax: any, i: number) => (
266
+ <OSTable key={`${tax?.id}_${i}`}>
268
267
  <OSRow>
269
268
  <OText>
270
269
  {tax.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}{' '}
@@ -276,12 +275,12 @@ const CartUI = (props: any) => {
276
275
  ))
277
276
  }
278
277
  {
279
- cart?.fees?.length > 0 && cart?.fees?.filter((fee: any) => !(fee.fixed === 0 && fee.percentage === 0)).map((fee: any) => (
280
- <OSTable key={fee?.id}>
278
+ cart?.fees?.length > 0 && cart?.fees?.filter((fee: any) => !(fee.fixed === 0 && fee.percentage === 0)).map((fee: any, i: number) => (
279
+ <OSTable key={`${fee?.id}_${i}`}>
281
280
  <OSRow>
282
281
  <OText>
283
282
  {fee.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}{' '}
284
- ({fee?.fixed > 0 && `${parsePrice(fee?.fixed)} + `}{fee.percentage}%){' '}
283
+ ({fee?.fixed > 0 && `${parsePrice(fee?.fixed)}${fee.percentage > 0 ? ' + ' : ''}`}{fee.percentage > 0 && `${fee.percentage}%`}){' '}
285
284
  </OText>
286
285
  </OSRow>
287
286
  <OText>{parsePrice(fee?.summary?.fixed + (fee?.summary?.percentage_after_discount ?? fee?.summary?.percentage) ?? 0)}</OText>
@@ -289,8 +288,8 @@ const CartUI = (props: any) => {
289
288
  ))
290
289
  }
291
290
  {
292
- cart?.offers?.length > 0 && cart?.offers?.filter((offer: any) => offer?.target === 3)?.map((offer: any) => (
293
- <OSTable key={offer.id}>
291
+ cart?.offers?.length > 0 && cart?.offers?.filter((offer: any) => offer?.target === 3)?.map((offer: any, i: number) => (
292
+ <OSTable key={`${offer?.id}_${i}`}>
294
293
  <OSRow>
295
294
  <OText>{offer.name}</OText>
296
295
  {offer.rate_type === 1 && (
@@ -310,8 +309,8 @@ const CartUI = (props: any) => {
310
309
  </OSTable>
311
310
  )}
312
311
  {
313
- cart?.offers?.length > 0 && cart?.offers?.filter((offer: any) => offer?.target === 2)?.map((offer: any) => (
314
- <OSTable key={offer.id}>
312
+ cart?.offers?.length > 0 && cart?.offers?.filter((offer: any) => offer?.target === 2)?.map((offer: any, i: number) => (
313
+ <OSTable key={`${offer?.id}_${i}`}>
315
314
  <OSRow>
316
315
  <OText>{offer.name}</OText>
317
316
  {offer.rate_type === 1 && (
@@ -62,6 +62,10 @@ const CartBottomSheetUI = (props: CartBottomSheetUIProps): React.ReactElement |
62
62
  }
63
63
 
64
64
  const handleEditProduct = (product: any) => {
65
+ if (props.onEditProduct) {
66
+ props.onEditProduct(product)
67
+ return
68
+ }
65
69
  setCurProduct(product)
66
70
  setModalIsOpen(true)
67
71
  }
@@ -148,7 +152,7 @@ const CartBottomSheetUI = (props: CartBottomSheetUIProps): React.ReactElement |
148
152
  <StyledBottomContent
149
153
  style={{bottom:10}}
150
154
  minHeight={props.height * 0.01}
151
- >
155
+ >
152
156
  <OButton
153
157
  text={(cart?.subtotal >= cart?.minimum || !cart?.minimum) && cart?.valid_address ? (
154
158
  !openUpselling !== canOpenUpselling ? `${t('CHECKOUT', 'Checkout')} ${parsePrice(cart?.total)}`: t('LOADING', 'Loading')
@@ -198,6 +202,7 @@ const CartBottomSheetUI = (props: CartBottomSheetUIProps): React.ReactElement |
198
202
  canOpenUpselling={canOpenUpselling}
199
203
  setCanOpenUpselling={setCanOpenUpselling}
200
204
  onClose={onCloseUpselling}
205
+ onAddProduct={props.onAddProduct}
201
206
  resetInactivityTimeout={resetInactivityTimeout}
202
207
  />
203
208
  )}
@@ -231,7 +236,7 @@ const TopBar = (props:any) => {
231
236
  <OIconButton
232
237
  bgColor="transparent"
233
238
  borderColor="transparent"
234
- RenderIcon={() =>
239
+ RenderIcon={() =>
235
240
  <EvilIcons
236
241
  name={'close'}
237
242
  size={40}
@@ -260,6 +265,8 @@ interface CartBottomSheetUIProps {
260
265
  onNavigationRedirect: any,
261
266
  clearInactivityTimeout: any,
262
267
  resetInactivityTimeout: any,
268
+ onEditProduct: any,
269
+ onAddProduct: any,
263
270
  }
264
271
 
265
272
  export const CartBottomSheet = (props: any) => {
@@ -1,10 +1,7 @@
1
1
  import React, { useEffect, useState } from 'react';
2
- import { useLanguage } from 'ordering-components/native';
3
2
  import { useCartBottomSheet } from '../../providers/CartBottomSheetProvider';
4
- import { CCNotCarts } from './styles';
5
3
 
6
4
  import { Cart } from '../Cart';
7
- import { OText } from '../shared';
8
5
  import Spinner from 'react-native-loading-spinner-overlay';
9
6
  import { Cart as TypeCart } from '../../types';
10
7
 
@@ -20,7 +17,6 @@ export const CartContent = (props: any) => {
20
17
  resetInactivityTimeout,
21
18
  }: Props = props
22
19
 
23
- const [, t] = useLanguage()
24
20
  const [isCartsLoading, setIsCartsLoading] = useState(false)
25
21
  const [, { hideCartBottomSheet }] = useCartBottomSheet();
26
22
 
@@ -56,13 +52,6 @@ export const CartContent = (props: any) => {
56
52
  }
57
53
  </>
58
54
  )}
59
- {/* {(!cart && showNotFound) && (
60
- <CCNotCarts>
61
- <OText size={24} style={{ textAlign: 'center' }}>
62
- {t('CARTS_NOT_FOUND', 'You don\'t have carts available')}
63
- </OText>
64
- </CCNotCarts>
65
- )} */}
66
55
  <Spinner visible={isCartsLoading} />
67
56
  </>
68
57
  )
@@ -56,9 +56,10 @@ const CartItem = (props: CartItemProps) => {
56
56
  return product
57
57
  }
58
58
  const isProductIngredients = productInfo()?.ingredients.length > 0 || productInfo()?.options.length > 0 || product?.comment
59
- const getFormattedSubOptionName = ({ quantity, name, position, price }: { quantity: number, name: string, position: string, price: number }) => {
59
+ const getFormattedSubOptionName = ({ quantity, name, position, price }: { quantity: number, name: string, position: string, price: any }) => {
60
60
  const pos = position ? `(${position})` : ''
61
- return `${quantity} x ${name} ${pos} +${price}`
61
+ const str = `${quantity} x ${name} ${pos}`
62
+ return price ? `${str} ${price}` : str
62
63
  }
63
64
 
64
65
  return (
@@ -184,7 +185,7 @@ const CartItem = (props: CartItemProps) => {
184
185
  quantity: suboption.quantity,
185
186
  name: suboption.name,
186
187
  position: (suboption.position !== 'whole') ? t(suboption.position.toUpperCase(), suboption.position) : '',
187
- price: parsePrice(suboption.price)
188
+ price: suboption.price > 0 && `+${parsePrice(suboption.price)}`
188
189
  })}
189
190
  </OText>
190
191
  </ProductSubOption>