ordering-ui-react-native 0.21.0 → 0.21.1-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 (239) hide show
  1. package/package.json +6 -5
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/BusinessInformation/index.tsx +10 -9
  4. package/src/components/BusinessesListing/index.tsx +1 -1
  5. package/src/components/PaymentOptionsWebView/index.tsx +1 -0
  6. package/src/components/StripeMethodForm/index.tsx +3 -3
  7. package/src/components/VerifyPhone/styles.tsx +1 -2
  8. package/src/components/shared/OToast.tsx +3 -2
  9. package/src/types/index.tsx +2 -1
  10. package/src/utils/index.tsx +2 -2
  11. package/themes/business/index.tsx +4 -0
  12. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +9 -2
  13. package/themes/business/src/components/BusinessController/index.tsx +19 -17
  14. package/themes/business/src/components/BusinessProductList/AccordionDropdown.tsx +63 -0
  15. package/themes/business/src/components/BusinessProductList/IterateCategories.tsx +108 -0
  16. package/themes/business/src/components/BusinessProductList/ProductList.tsx +196 -0
  17. package/themes/business/src/components/BusinessProductList/index.tsx +196 -0
  18. package/themes/business/src/components/BusinessProductList/styles.tsx +10 -0
  19. package/themes/business/src/components/Chat/index.tsx +41 -13
  20. package/themes/business/src/components/DriverMap/index.tsx +4 -2
  21. package/themes/business/src/components/DriverSchedule/index.tsx +5 -5
  22. package/themes/business/src/components/FloatingButton/index.tsx +34 -31
  23. package/themes/business/src/components/Home/index.tsx +5 -1
  24. package/themes/business/src/components/MapView/index.tsx +11 -7
  25. package/themes/business/src/components/MessagesOption/index.tsx +22 -94
  26. package/themes/business/src/components/NewOrderNotification/index.tsx +161 -106
  27. package/themes/business/src/components/OrderDetails/Delivery.tsx +21 -11
  28. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +88 -51
  29. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +36 -16
  30. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +6 -1
  31. package/themes/business/src/components/OrderSummary/index.tsx +42 -23
  32. package/themes/business/src/components/OrdersListManager/index.tsx +7 -2
  33. package/themes/business/src/components/OrdersListManager/utils.tsx +1 -1
  34. package/themes/business/src/components/OrdersOption/index.tsx +125 -48
  35. package/themes/business/src/components/PreviousMessages/FooterMessageComponent.tsx +103 -0
  36. package/themes/business/src/components/PreviousMessages/index.tsx +97 -55
  37. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +27 -35
  38. package/themes/business/src/components/PreviousOrders/OrderList.tsx +93 -0
  39. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +1 -1
  40. package/themes/business/src/components/PreviousOrders/index.tsx +192 -220
  41. package/themes/business/src/components/PreviousOrders/styles.tsx +10 -0
  42. package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
  43. package/themes/business/src/components/ReviewCustomer/index.tsx +2 -0
  44. package/themes/business/src/components/SearchBar/index.tsx +2 -1
  45. package/themes/business/src/components/Sessions/index.tsx +187 -0
  46. package/themes/business/src/components/Sessions/styles.tsx +20 -0
  47. package/themes/business/src/components/StoresList/index.tsx +5 -3
  48. package/themes/business/src/components/UserProfileForm/index.tsx +76 -41
  49. package/themes/business/src/components/WebsocketStatus/index.tsx +171 -0
  50. package/themes/business/src/components/WebsocketStatus/styles.tsx +28 -0
  51. package/themes/business/src/components/shared/OInput.tsx +2 -0
  52. package/themes/business/src/hooks/useLocation.tsx +5 -4
  53. package/themes/business/src/types/index.tsx +19 -0
  54. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  55. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  56. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  57. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  58. package/themes/kiosk/src/components/LoginForm/index.tsx +124 -96
  59. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  60. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  61. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  62. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  63. package/themes/original/index.tsx +9 -4
  64. package/themes/original/src/components/AddressDetails/index.tsx +20 -10
  65. package/themes/original/src/components/AddressForm/index.tsx +2 -2
  66. package/themes/original/src/components/AddressForm/styles.tsx +1 -1
  67. package/themes/original/src/components/AddressList/index.tsx +4 -7
  68. package/themes/original/src/components/AddressList/styles.tsx +4 -4
  69. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  70. package/themes/original/src/components/BusinessBasicInformation/index.tsx +4 -4
  71. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -1
  72. package/themes/original/src/components/BusinessController/index.tsx +18 -10
  73. package/themes/original/src/components/BusinessController/styles.tsx +8 -7
  74. package/themes/original/src/components/BusinessInformation/index.tsx +35 -3
  75. package/themes/original/src/components/BusinessInformation/styles.tsx +2 -2
  76. package/themes/original/src/components/BusinessItemAccordion/index.tsx +11 -7
  77. package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +317 -0
  78. package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +96 -0
  79. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +1 -1
  80. package/themes/original/src/components/BusinessListingSearch/index.tsx +56 -361
  81. package/themes/original/src/components/BusinessListingSearch/styles.tsx +1 -1
  82. package/themes/original/src/components/BusinessPreorder/index.tsx +3 -4
  83. package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -1
  84. package/themes/original/src/components/BusinessProductsList/index.tsx +3 -3
  85. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  86. package/themes/original/src/components/BusinessProductsListing/index.tsx +46 -22
  87. package/themes/original/src/components/BusinessProductsListing/styles.tsx +3 -4
  88. package/themes/original/src/components/BusinessReviews/index.tsx +1 -1
  89. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  90. package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -5
  91. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +69 -0
  92. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +406 -0
  93. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListing.tsx +76 -0
  94. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +29 -402
  95. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
  96. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  97. package/themes/original/src/components/Cart/index.tsx +32 -9
  98. package/themes/original/src/components/CartContent/index.tsx +98 -59
  99. package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
  100. package/themes/original/src/components/Checkout/index.tsx +219 -66
  101. package/themes/original/src/components/Checkout/styles.tsx +17 -0
  102. package/themes/original/src/components/CitiesControl/styles.tsx +1 -1
  103. package/themes/original/src/components/DatePicker/index.tsx +17 -0
  104. package/themes/original/src/components/DatePicker/styles.tsx +20 -0
  105. package/themes/original/src/components/Favorite/index.tsx +4 -9
  106. package/themes/original/src/components/Favorite/styles.tsx +0 -2
  107. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  108. package/themes/original/src/components/GPSButton/index.tsx +1 -1
  109. package/themes/original/src/components/GiftCard/GiftCardOrdersList/index.tsx +64 -0
  110. package/themes/original/src/components/GiftCard/GiftCardOrdersList/styles.tsx +8 -0
  111. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
  112. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +36 -3
  113. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +1 -1
  114. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +67 -4
  115. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +1 -1
  116. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +2 -2
  117. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +1 -1
  118. package/themes/original/src/components/GiftCard/SingleGiftCard/index.tsx +101 -0
  119. package/themes/original/src/components/GiftCard/SingleGiftCard/styles.tsx +4 -0
  120. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +83 -0
  121. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/styles.tsx +9 -0
  122. package/themes/original/src/components/GoogleMap/index.tsx +50 -5
  123. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +2 -2
  124. package/themes/original/src/components/HighestRatedBusinesses/styles.tsx +1 -1
  125. package/themes/original/src/components/Home/index.tsx +1 -1
  126. package/themes/original/src/components/LastOrder/index.tsx +2 -1
  127. package/themes/original/src/components/LastOrders/index.tsx +2 -1
  128. package/themes/original/src/components/LoginForm/Otp/index.tsx +53 -47
  129. package/themes/original/src/components/LoginForm/index.tsx +6 -1
  130. package/themes/original/src/components/Messages/index.tsx +9 -4
  131. package/themes/original/src/components/Messages/styles.tsx +1 -1
  132. package/themes/original/src/components/MomentOption/index.tsx +4 -4
  133. package/themes/original/src/components/MomentSelector/index.tsx +1 -1
  134. package/themes/original/src/components/MultiCart/index.tsx +1 -1
  135. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +13 -4
  136. package/themes/original/src/components/MultiCheckout/index.tsx +251 -53
  137. package/themes/original/src/components/MultiCheckout/styles.tsx +17 -0
  138. package/themes/original/src/components/MultiOrdersDetails/index.tsx +20 -15
  139. package/themes/original/src/components/MyOrders/index.tsx +24 -29
  140. package/themes/original/src/components/NavBar/index.tsx +3 -1
  141. package/themes/original/src/components/NetworkError/index.tsx +2 -3
  142. package/themes/original/src/components/NetworkError/styles.tsx +2 -2
  143. package/themes/original/src/components/Notifications/index.tsx +4 -8
  144. package/themes/original/src/components/Notifications/styles.tsx +0 -1
  145. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +7 -3
  146. package/themes/original/src/components/OrderDetails/index.tsx +716 -667
  147. package/themes/original/src/components/OrderDetails/styles.tsx +24 -8
  148. package/themes/original/src/components/OrderProgress/index.tsx +28 -9
  149. package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
  150. package/themes/original/src/components/OrderSummary/index.tsx +5 -3
  151. package/themes/original/src/components/OrderTypeSelector/index.tsx +5 -6
  152. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +1 -1
  153. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +1 -1
  154. package/themes/original/src/components/OrdersOption/index.tsx +5 -3
  155. package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
  156. package/themes/original/src/components/PageBanner/index.tsx +3 -0
  157. package/themes/original/src/components/PaymentOptionCard/index.tsx +4 -2
  158. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +3 -0
  159. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  160. package/themes/original/src/components/PaymentOptions/index.tsx +81 -33
  161. package/themes/original/src/components/PhoneInputNumber/index.tsx +15 -1
  162. package/themes/original/src/components/ProductForm/ActionButton.tsx +120 -0
  163. package/themes/original/src/components/ProductForm/ExtraOptions.tsx +56 -0
  164. package/themes/original/src/components/ProductForm/index.tsx +79 -167
  165. package/themes/original/src/components/ProductForm/styles.tsx +1 -1
  166. package/themes/original/src/components/ProductItemAccordion/index.tsx +12 -8
  167. package/themes/original/src/components/ProductOptionSubOption/index.tsx +120 -79
  168. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +10 -9
  169. package/themes/original/src/components/ProfessionalProfile/styles.tsx +3 -3
  170. package/themes/original/src/components/Promotions/index.tsx +4 -4
  171. package/themes/original/src/components/Promotions/styles.tsx +0 -2
  172. package/themes/original/src/components/ReviewDriver/styles.tsx +1 -1
  173. package/themes/original/src/components/ReviewOrder/styles.tsx +1 -1
  174. package/themes/original/src/components/ReviewProducts/styles.tsx +1 -1
  175. package/themes/original/src/components/ServiceForm/index.tsx +2 -2
  176. package/themes/original/src/components/ServiceForm/styles.tsx +4 -4
  177. package/themes/original/src/components/SingleOrderCard/index.tsx +5 -4
  178. package/themes/original/src/components/SingleProductCard/index.tsx +2 -2
  179. package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
  180. package/themes/original/src/components/StripeCardsList/index.tsx +23 -8
  181. package/themes/original/src/components/StripeElementsForm/index.tsx +9 -4
  182. package/themes/original/src/components/StripeElementsForm/naked.tsx +12 -1
  183. package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +170 -0
  184. package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +86 -0
  185. package/themes/original/src/components/UpsellingProducts/index.tsx +15 -199
  186. package/themes/original/src/components/UpsellingProducts/styles.tsx +19 -0
  187. package/themes/original/src/components/UserFormDetails/index.tsx +53 -7
  188. package/themes/original/src/components/UserProfile/index.tsx +3 -2
  189. package/themes/original/src/components/UserProfileForm/index.tsx +30 -36
  190. package/themes/original/src/components/UserVerification/index.tsx +55 -50
  191. package/themes/original/src/components/WalletTransactions/styles.tsx +1 -0
  192. package/themes/original/src/components/Wallets/index.tsx +8 -9
  193. package/themes/original/src/components/Wallets/styles.tsx +1 -1
  194. package/themes/original/src/components/WebsocketStatus/index.tsx +172 -0
  195. package/themes/original/src/components/WebsocketStatus/styles.tsx +28 -0
  196. package/themes/original/src/components/shared/HeaderTitle.tsx +1 -1
  197. package/themes/original/src/components/shared/OButton.tsx +5 -5
  198. package/themes/original/src/components/shared/OInput.tsx +1 -4
  199. package/themes/original/src/components/shared/OModal.tsx +12 -14
  200. package/themes/original/src/layouts/Container.tsx +5 -3
  201. package/themes/original/src/types/index.tsx +10 -2
  202. package/themes/original/src/utils/index.tsx +124 -0
  203. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
  204. package/src/navigators/BottomNavigator.tsx +0 -117
  205. package/src/navigators/CheckoutNavigator.tsx +0 -66
  206. package/src/navigators/HomeNavigator.tsx +0 -202
  207. package/src/navigators/NavigationRef.tsx +0 -7
  208. package/src/navigators/RootNavigator.tsx +0 -269
  209. package/src/pages/Account.tsx +0 -34
  210. package/src/pages/AddressForm.tsx +0 -62
  211. package/src/pages/AddressList.tsx +0 -24
  212. package/src/pages/BusinessProductsList.tsx +0 -81
  213. package/src/pages/BusinessesListing.tsx +0 -43
  214. package/src/pages/CartList.tsx +0 -49
  215. package/src/pages/Checkout.tsx +0 -101
  216. package/src/pages/ForgotPassword.tsx +0 -24
  217. package/src/pages/Help.tsx +0 -23
  218. package/src/pages/HelpAccountAndPayment.tsx +0 -23
  219. package/src/pages/HelpGuide.tsx +0 -23
  220. package/src/pages/HelpOrder.tsx +0 -23
  221. package/src/pages/Home.tsx +0 -36
  222. package/src/pages/IntroductoryTutorial.tsx +0 -170
  223. package/src/pages/Login.tsx +0 -47
  224. package/src/pages/MomentOption.tsx +0 -30
  225. package/src/pages/MultiCheckout.tsx +0 -31
  226. package/src/pages/MultiOrdersDetails.tsx +0 -27
  227. package/src/pages/MyOrders.tsx +0 -40
  228. package/src/pages/NetworkError.tsx +0 -24
  229. package/src/pages/NotFound.tsx +0 -22
  230. package/src/pages/OrderDetails.tsx +0 -25
  231. package/src/pages/ProductDetails.tsx +0 -55
  232. package/src/pages/Profile.tsx +0 -36
  233. package/src/pages/ReviewDriver.tsx +0 -30
  234. package/src/pages/ReviewOrder.tsx +0 -32
  235. package/src/pages/ReviewProducts.tsx +0 -30
  236. package/src/pages/Sessions.tsx +0 -22
  237. package/src/pages/Signup.tsx +0 -53
  238. package/src/pages/SpinnerLoader.tsx +0 -10
  239. package/src/pages/Splash.tsx +0 -21
@@ -1,6 +1,6 @@
1
- import React, { useState } from 'react';
1
+ import React, { useCallback, useEffect, useState } from 'react';
2
2
  import { View } from 'react-native';
3
- import { useLanguage, useConfig, useUtils } from 'ordering-components/native';
3
+ import { useLanguage, useConfig, useUtils, useOrder } from 'ordering-components/native';
4
4
  import { useTheme } from 'styled-components/native';
5
5
  import { CCContainer, CCNotCarts, CCList, CheckoutAction, ChCartsTotal } from './styles';
6
6
 
@@ -11,9 +11,10 @@ import { NotFoundSource } from '../NotFoundSource';
11
11
 
12
12
  export const CartContent = (props: any) => {
13
13
  const {
14
- carts,
15
- isOrderStateCarts,
16
- onNavigationRedirect
14
+ onNavigationRedirect,
15
+ singleBusiness,
16
+ businessSlug,
17
+ navigation
17
18
  } = props
18
19
 
19
20
  const theme = useTheme();
@@ -21,16 +22,22 @@ export const CartContent = (props: any) => {
21
22
  const [{ configs }] = useConfig()
22
23
  const [{ parsePrice }] = useUtils();
23
24
  const [isCartsLoading, setIsCartsLoading] = useState(false)
24
-
25
- const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
25
+ const [cartsOpened, setCartsOpened] = useState([])
26
+ const [{ carts: cartsContext }, { confirmCart }] = useOrder();
27
+ const cartsList =
28
+ (cartsContext &&
29
+ Object.values(cartsContext).filter((cart: any) => cart.products.length > 0)) ??
30
+ [];
31
+ const carts = businessSlug
32
+ ? cartsList.filter((cart: any) => cart?.business?.slug === businessSlug || parseInt(businessSlug) === cart?.business_id)
33
+ : cartsList
34
+ const isOrderStateCarts = !!carts
26
35
  const isMultiCheckout = configs?.checkout_multi_business_enabled?.value === '1'
27
- const cartsAvailable: any = Object.values(carts)?.filter((cart: any) => cart?.valid && cart?.status !== 2)
28
-
36
+ const cartsAvailable: any = Object.values(carts || {})?.filter((cart: any) => cart?.valid && cart?.status !== 2 && cart?.business_id)
29
37
  const totalCartsPrice = cartsAvailable?.length && cartsAvailable.reduce((total: any, cart: any) => { return total + cart?.total }, 0)
30
38
  const totalCartsFee = cartsAvailable?.length && cartsAvailable
31
39
  ?.filter((cart: any) => cart?.status !== 1 && cart?.valid && cart?.products?.length)
32
40
  ?.reduce((total: any, cart: any) => { return total + (cart?.delivery_price_with_discount) }, 0)
33
-
34
41
  const handleCheckoutRedirect = () => {
35
42
  if (cartsAvailable.length === 1) {
36
43
  onNavigationRedirect('CheckoutNavigator', {
@@ -65,9 +72,35 @@ export const CartContent = (props: any) => {
65
72
  }
66
73
  }
67
74
 
75
+ const changeActiveState = useCallback((isClosed: boolean, uuid: string) => {
76
+ const isActive = cartsOpened?.includes?.(uuid) || !!singleBusiness
77
+ if (isActive || !isClosed) {
78
+ setCartsOpened(cartsOpened?.filter?.((_uuid) => _uuid !== uuid))
79
+ } else {
80
+ setCartsOpened([
81
+ ...cartsOpened,
82
+ uuid
83
+ ])
84
+ }
85
+ }, [cartsOpened])
86
+
87
+ useEffect(() => {
88
+ const unsuscribe = navigation.addListener('focus', () => {
89
+ const cartsListBlockedByPaypal = carts?.filter((cart: any) => cart?.status === 2 && cart?.paymethod_data?.gateway === 'paypal')
90
+ if (cartsListBlockedByPaypal?.length > 0) {
91
+ cartsListBlockedByPaypal.map(async (cart: any) => {
92
+ await confirmCart(cart?.uuid)
93
+ })
94
+ }
95
+ })
96
+ return () => {
97
+ return unsuscribe()
98
+ }
99
+ }, [carts, navigation])
100
+
68
101
  return (
69
102
  <CCContainer
70
- style={{ paddingHorizontal: isChewLayout ? 20 : 40 }}
103
+ style={{ paddingHorizontal: 20 }}
71
104
  >
72
105
  {isOrderStateCarts && carts?.length > 0 && (
73
106
  <>
@@ -87,8 +120,12 @@ export const CartContent = (props: any) => {
87
120
  hideUpselling
88
121
  businessConfigs={cart?.business?.configs}
89
122
  hideCouponInput={configs?.multi_business_checkout_coupon_input_style?.value === 'group'}
90
- hideDeliveryFee={configs?.multi_business_checkout_show_combined_delivery_fee?.value === '1'}
123
+ hideDeliveryFee={configs?.multi_business_checkout_show_combined_delivery_fee?.value === '1'}
91
124
  hideDriverTip={configs?.multi_business_checkout_show_combined_driver_tip?.value === '1'}
125
+ cartsOpened={cartsOpened}
126
+ setCartsOpened={setCartsOpened}
127
+ changeActiveState={changeActiveState}
128
+ isActive={cartsOpened?.includes?.(cart?.uuid) || !!singleBusiness}
92
129
  />
93
130
  <View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginHorizontal: -40, marginTop: 20 }} />
94
131
  </>
@@ -98,53 +135,55 @@ export const CartContent = (props: any) => {
98
135
  {isMultiCheckout && (
99
136
  <>
100
137
  {!!cartsAvailable.length && (
101
- <ChCartsTotal>
102
- {!!totalCartsFee && configs?.multi_business_checkout_show_combined_delivery_fee?.value === '1' && (
103
- <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
104
- <OText size={14} lineHeight={24} color={theme.colors.textNormal} weight={'400'}>
105
- {t('TOTAL_DELIVERY_FEE', 'Total delivery fee')}
106
- </OText>
107
- <OText size={14} lineHeight={24} color={theme.colors.textNormal} weight={'400'}>
108
- {parsePrice(totalCartsFee)}
109
- </OText>
110
- </View>
111
- )}
112
- {cartsAvailable.reduce((sum: any, cart: any) => sum + cart?.driver_tip, 0) > 0 &&
113
- configs?.multi_business_checkout_show_combined_driver_tip?.value === '1' && (
114
- <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
115
- <OText size={14} lineHeight={24} color={theme.colors.textNormal} weight={'400'}>
116
- {t('DRIVER_TIP', 'Driver tip')}
117
- </OText>
118
- <OText size={14} lineHeight={24} color={theme.colors.textNormal} weight={'400'}>
119
- {parsePrice(cartsAvailable.reduce((sum: any, cart: any) => sum + cart?.driver_tip, 0))}
120
- </OText>
121
- </View>
122
- )}
123
- <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
124
- <OText size={16} lineHeight={24} color={theme.colors.textNormal} weight={'500'}>
125
- {t('TOTAL_FOR_ALL_CARTS', 'Total for all Carts')}
126
- </OText>
127
- <OText size={16} lineHeight={24} color={theme.colors.textNormal} weight={'500'}>{parsePrice(totalCartsPrice)}</OText>
128
- </View>
129
- <View style={{ flexDirection: 'row', justifyContent: 'center', marginVertical: 20 }}>
130
- <OText size={14} color={theme.colors.textNormal} weight={'300'} style={{ textAlign: 'center' }}>
131
- {t('CART_GROUP_MESSAGE_ALERT', 'Discounts may be applied at the time of payment for this group.')}
132
- </OText>
133
- </View>
134
- </ChCartsTotal>
138
+ <>
139
+ <ChCartsTotal>
140
+ {!!totalCartsFee && configs?.multi_business_checkout_show_combined_delivery_fee?.value === '1' && (
141
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
142
+ <OText size={14} lineHeight={24} color={theme.colors.textNormal} weight={'400'}>
143
+ {t('TOTAL_DELIVERY_FEE', 'Total delivery fee')}
144
+ </OText>
145
+ <OText size={14} lineHeight={24} color={theme.colors.textNormal} weight={'400'}>
146
+ {parsePrice(totalCartsFee)}
147
+ </OText>
148
+ </View>
149
+ )}
150
+ {cartsAvailable.reduce((sum: any, cart: any) => sum + cart?.driver_tip, 0) > 0 &&
151
+ configs?.multi_business_checkout_show_combined_driver_tip?.value === '1' && (
152
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
153
+ <OText size={14} lineHeight={24} color={theme.colors.textNormal} weight={'400'}>
154
+ {t('DRIVER_TIP', 'Driver tip')}
155
+ </OText>
156
+ <OText size={14} lineHeight={24} color={theme.colors.textNormal} weight={'400'}>
157
+ {parsePrice(cartsAvailable.reduce((sum: any, cart: any) => sum + cart?.driver_tip, 0))}
158
+ </OText>
159
+ </View>
160
+ )}
161
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
162
+ <OText size={16} lineHeight={24} color={theme.colors.textNormal} weight={'500'}>
163
+ {t('TOTAL_FOR_ALL_CARTS', 'Total for all Carts')}
164
+ </OText>
165
+ <OText size={16} lineHeight={24} color={theme.colors.textNormal} weight={'500'}>{parsePrice(totalCartsPrice)}</OText>
166
+ </View>
167
+ <View style={{ flexDirection: 'row', justifyContent: 'center', marginVertical: 20 }}>
168
+ <OText size={14} color={theme.colors.textNormal} weight={'300'} style={{ textAlign: 'center' }}>
169
+ {t('CART_GROUP_MESSAGE_ALERT', 'Discounts may be applied at the time of payment for this group.')}
170
+ </OText>
171
+ </View>
172
+ </ChCartsTotal>
173
+ <CheckoutAction style={{ marginTop: 0 }}>
174
+ <OButton
175
+ text={t('CHECKOUT', 'Checkout')}
176
+ bgColor={!cartsAvailable.length ? theme.colors.secundary : theme.colors.primary}
177
+ isDisabled={!cartsAvailable.length}
178
+ borderColor={theme.colors.primary}
179
+ imgRightSrc={null}
180
+ textStyle={{ color: 'white', textAlign: 'center', flex: 1 }}
181
+ onClick={() => handleCheckoutRedirect()}
182
+ style={{ width: '100%', flexDirection: 'row', justifyContent: 'center', borderRadius: 7.6, shadowOpacity: 0 }}
183
+ />
184
+ </CheckoutAction>
185
+ </>
135
186
  )}
136
- <CheckoutAction style={{ marginTop: 0 }}>
137
- <OButton
138
- text={t('CHECKOUT', 'Checkout')}
139
- bgColor={!cartsAvailable.length ? theme.colors.secundary : theme.colors.primary}
140
- isDisabled={!cartsAvailable.length}
141
- borderColor={theme.colors.primary}
142
- imgRightSrc={null}
143
- textStyle={{ color: 'white', textAlign: 'center', flex: 1 }}
144
- onClick={() => handleCheckoutRedirect()}
145
- style={{ width: '100%', flexDirection: 'row', justifyContent: 'center', borderRadius: 7.6, shadowOpacity: 0 }}
146
- />
147
- </CheckoutAction>
148
187
  </>
149
188
  )}
150
189
  </>
@@ -156,7 +195,7 @@ export const CartContent = (props: any) => {
156
195
  btnStyle={{ borderRadius: 8 }}
157
196
  content={t('CARTS_NOT_FOUND', 'You don\'t have carts available')}
158
197
  btnTitle={t('START_SHOPPING', 'Start shopping')}
159
- onClickButton={() => onNavigationRedirect('BusinessList')}
198
+ onClickButton={() => singleBusiness ? onNavigationRedirect('Business') : onNavigationRedirect('BusinessList')}
160
199
  />
161
200
  </CCNotCarts>
162
201
  )}
@@ -9,7 +9,7 @@ export const Container = styled.View`
9
9
  `
10
10
 
11
11
  export const ItemListing = styled.ScrollView`
12
- padding: 0 40px;
12
+ padding: 0 20px;
13
13
  margin: 0 0 140px;
14
14
  `
15
15
 
@@ -19,7 +19,7 @@ export const TopHeader = styled.View`
19
19
  align-items: center;
20
20
  justify-content: space-between;
21
21
  z-index: 1;
22
- padding: 0 40px;
22
+ padding: 0 20px;
23
23
  `
24
24
 
25
25
  export const HeaderItem = styled.TouchableOpacity`