ordering-ui-react-native 0.16.89 → 0.16.90-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 +5 -5
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/ActiveOrders/styles.tsx +8 -14
  4. package/src/components/BusinessInformation/index.tsx +19 -4
  5. package/src/components/BusinessInformation/styles.tsx +2 -2
  6. package/src/components/BusinessProductsList/index.tsx +1 -1
  7. package/src/components/BusinessesListing/index.tsx +1 -1
  8. package/src/components/OrderCreating/index.tsx +1 -21
  9. package/src/components/OrdersOption/index.tsx +54 -56
  10. package/src/components/PaymentOptionsWebView/index.tsx +119 -120
  11. package/src/components/SingleProductReview/index.tsx +7 -4
  12. package/src/components/VerifyPhone/styles.tsx +1 -2
  13. package/src/components/shared/OToast.tsx +4 -4
  14. package/src/utils/index.tsx +2 -1
  15. package/themes/business/index.tsx +2 -0
  16. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +265 -240
  17. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
  18. package/themes/business/src/components/BusinessController/index.tsx +2 -2
  19. package/themes/business/src/components/Chat/index.tsx +31 -31
  20. package/themes/business/src/components/DriverMap/index.tsx +22 -9
  21. package/themes/business/src/components/GoogleMap/index.tsx +58 -57
  22. package/themes/business/src/components/LoginForm/Otp/index.tsx +120 -0
  23. package/themes/business/src/components/LoginForm/Otp/styles.tsx +7 -0
  24. package/themes/business/src/components/LoginForm/index.tsx +239 -80
  25. package/themes/business/src/components/LoginForm/styles.tsx +10 -0
  26. package/themes/business/src/components/MapView/index.tsx +18 -7
  27. package/themes/business/src/components/MessagesOption/index.tsx +11 -1
  28. package/themes/business/src/components/NewOrderNotification/index.tsx +31 -41
  29. package/themes/business/src/components/OrderDetails/Delivery.tsx +4 -3
  30. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +96 -50
  31. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +59 -62
  32. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +195 -0
  33. package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
  34. package/themes/business/src/components/OrderMessage/index.tsx +18 -17
  35. package/themes/business/src/components/OrdersOption/index.tsx +79 -87
  36. package/themes/business/src/components/OrdersOption/styles.tsx +5 -1
  37. package/themes/business/src/components/OrdersOptionBusiness/index.tsx +15 -1
  38. package/themes/business/src/components/OrdersOptionCity/index.tsx +15 -1
  39. package/themes/business/src/components/OrdersOptionDate/index.tsx +19 -6
  40. package/themes/business/src/components/OrdersOptionDelivery/index.tsx +15 -1
  41. package/themes/business/src/components/OrdersOptionDriver/index.tsx +15 -1
  42. package/themes/business/src/components/OrdersOptionPaymethod/index.tsx +15 -1
  43. package/themes/business/src/components/OrdersOptionStatus/index.tsx +10 -1
  44. package/themes/business/src/components/PreviousMessages/index.tsx +17 -18
  45. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +250 -0
  46. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
  47. package/themes/business/src/components/PreviousOrders/index.tsx +447 -247
  48. package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
  49. package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
  50. package/themes/business/src/components/ReviewCustomer/index.tsx +54 -27
  51. package/themes/business/src/components/shared/ODropDown.tsx +42 -8
  52. package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
  53. package/themes/business/src/components/shared/OLink.tsx +33 -13
  54. package/themes/business/src/components/shared/OModal.tsx +16 -9
  55. package/themes/business/src/components/shared/OText.tsx +8 -2
  56. package/themes/business/src/types/index.tsx +35 -3
  57. package/themes/business/src/utils/index.tsx +53 -0
  58. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  59. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  60. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  61. package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
  62. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  63. package/themes/kiosk/src/components/LoginForm/Otp/index.tsx +92 -0
  64. package/themes/kiosk/src/components/LoginForm/Otp/styles.tsx +7 -0
  65. package/themes/kiosk/src/components/LoginForm/index.tsx +473 -151
  66. package/themes/kiosk/src/components/LoginForm/styles.tsx +14 -1
  67. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  68. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  69. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  70. package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +1 -0
  71. package/themes/kiosk/src/components/PhoneInputNumber/styles.tsx +1 -3
  72. package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
  73. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  74. package/themes/kiosk/src/components/shared/OModal.tsx +14 -11
  75. package/themes/kiosk/src/layouts/Container.tsx +7 -1
  76. package/themes/kiosk/src/types/index.d.ts +13 -0
  77. package/themes/kiosk/src/utils/index.tsx +15 -0
  78. package/themes/original/index.tsx +8 -0
  79. package/themes/original/src/components/AddressDetails/index.tsx +10 -8
  80. package/themes/original/src/components/AddressForm/index.tsx +155 -139
  81. package/themes/original/src/components/AddressList/index.tsx +27 -22
  82. package/themes/original/src/components/AddressList/styles.tsx +4 -2
  83. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  84. package/themes/original/src/components/BusinessBasicInformation/index.tsx +118 -76
  85. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -4
  86. package/themes/original/src/components/BusinessController/index.tsx +100 -47
  87. package/themes/original/src/components/BusinessController/styles.tsx +14 -9
  88. package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
  89. package/themes/original/src/components/BusinessItemAccordion/index.tsx +9 -3
  90. package/themes/original/src/components/BusinessListingSearch/index.tsx +86 -33
  91. package/themes/original/src/components/BusinessListingSearch/styles.tsx +6 -0
  92. package/themes/original/src/components/BusinessPreorder/index.tsx +96 -15
  93. package/themes/original/src/components/BusinessProductsList/index.tsx +10 -8
  94. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  95. package/themes/original/src/components/BusinessProductsListing/index.tsx +567 -495
  96. package/themes/original/src/components/BusinessProductsListing/styles.tsx +13 -12
  97. package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -2
  98. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +2 -1
  99. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +116 -81
  100. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
  101. package/themes/original/src/components/BusinessesListing/index.tsx +6 -6
  102. package/themes/original/src/components/Cart/index.tsx +87 -42
  103. package/themes/original/src/components/CartContent/index.tsx +77 -15
  104. package/themes/original/src/components/CartContent/styles.tsx +11 -1
  105. package/themes/original/src/components/Checkout/index.tsx +281 -174
  106. package/themes/original/src/components/Checkout/styles.tsx +4 -2
  107. package/themes/original/src/components/CitiesControl/index.tsx +89 -0
  108. package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
  109. package/themes/original/src/components/DriverTips/index.tsx +52 -37
  110. package/themes/original/src/components/DriverTips/styles.tsx +2 -1
  111. package/themes/original/src/components/Favorite/index.tsx +7 -4
  112. package/themes/original/src/components/Favorite/styles.tsx +1 -1
  113. package/themes/original/src/components/FavoriteList/index.tsx +70 -80
  114. package/themes/original/src/components/FloatingButton/index.tsx +1 -2
  115. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  116. package/themes/original/src/components/GPSButton/index.tsx +20 -19
  117. package/themes/original/src/components/GPSButton/styles.ts +3 -3
  118. package/themes/original/src/components/GoogleMap/index.tsx +10 -1
  119. package/themes/original/src/components/Help/index.tsx +8 -8
  120. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +11 -22
  121. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +6 -0
  122. package/themes/original/src/components/HelpGuide/index.tsx +12 -16
  123. package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
  124. package/themes/original/src/components/HelpOrder/index.tsx +12 -25
  125. package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
  126. package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
  127. package/themes/original/src/components/LastOrder/index.tsx +1 -34
  128. package/themes/original/src/components/LoginForm/Otp/index.tsx +89 -73
  129. package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
  130. package/themes/original/src/components/LoginForm/index.tsx +43 -19
  131. package/themes/original/src/components/LottieAnimation/index.tsx +78 -0
  132. package/themes/original/src/components/MessageListing/index.tsx +16 -42
  133. package/themes/original/src/components/Messages/index.tsx +31 -10
  134. package/themes/original/src/components/MomentOption/index.tsx +195 -88
  135. package/themes/original/src/components/MultiCart/index.tsx +50 -0
  136. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -93
  137. package/themes/original/src/components/MultiCheckout/index.tsx +204 -79
  138. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
  139. package/themes/original/src/components/MultiOrdersDetails/index.tsx +67 -20
  140. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
  141. package/themes/original/src/components/MyOrders/index.tsx +66 -17
  142. package/themes/original/src/components/NavBar/index.tsx +6 -11
  143. package/themes/original/src/components/NetworkError/index.tsx +5 -3
  144. package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
  145. package/themes/original/src/components/Notifications/index.tsx +144 -0
  146. package/themes/original/src/components/Notifications/styles.tsx +20 -0
  147. package/themes/original/src/components/OrderDetails/OrderEta.tsx +59 -0
  148. package/themes/original/src/components/OrderDetails/index.tsx +110 -221
  149. package/themes/original/src/components/OrderDetails/styles.tsx +10 -1
  150. package/themes/original/src/components/OrderItAgain/index.tsx +44 -42
  151. package/themes/original/src/components/OrderProgress/index.tsx +74 -112
  152. package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
  153. package/themes/original/src/components/OrderSummary/index.tsx +52 -17
  154. package/themes/original/src/components/OrderTypeSelector/index.tsx +9 -3
  155. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +29 -20
  156. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
  157. package/themes/original/src/components/OrdersOption/index.tsx +76 -83
  158. package/themes/original/src/components/PageBanner/index.tsx +146 -0
  159. package/themes/original/src/components/PageBanner/styles.tsx +11 -0
  160. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
  161. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  162. package/themes/original/src/components/PaymentOptions/index.tsx +2 -2
  163. package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
  164. package/themes/original/src/components/PlaceSpot/index.tsx +12 -6
  165. package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
  166. package/themes/original/src/components/ProductForm/index.tsx +240 -256
  167. package/themes/original/src/components/ProductForm/styles.tsx +5 -8
  168. package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
  169. package/themes/original/src/components/ProductOptionSubOption/index.tsx +18 -10
  170. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +1 -2
  171. package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
  172. package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -49
  173. package/themes/original/src/components/ProfessionalProfile/index.tsx +54 -14
  174. package/themes/original/src/components/Promotions/index.tsx +234 -220
  175. package/themes/original/src/components/Promotions/styles.tsx +7 -2
  176. package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
  177. package/themes/original/src/components/ReviewOrder/index.tsx +43 -11
  178. package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
  179. package/themes/original/src/components/ReviewProducts/index.tsx +8 -5
  180. package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
  181. package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
  182. package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
  183. package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
  184. package/themes/original/src/components/ServiceForm/index.tsx +377 -270
  185. package/themes/original/src/components/Sessions/index.tsx +11 -8
  186. package/themes/original/src/components/Sessions/styles.tsx +5 -0
  187. package/themes/original/src/components/SignupForm/index.tsx +79 -67
  188. package/themes/original/src/components/SingleOrderCard/index.tsx +126 -57
  189. package/themes/original/src/components/SingleOrderCard/styles.tsx +10 -8
  190. package/themes/original/src/components/SingleProductCard/index.tsx +104 -45
  191. package/themes/original/src/components/SingleProductCard/styles.tsx +14 -13
  192. package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
  193. package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
  194. package/themes/original/src/components/StripeCardsList/index.tsx +1 -1
  195. package/themes/original/src/components/StripeElementsForm/index.tsx +4 -1
  196. package/themes/original/src/components/UpsellingProducts/index.tsx +237 -218
  197. package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
  198. package/themes/original/src/components/UserDetails/index.tsx +8 -4
  199. package/themes/original/src/components/UserFormDetails/index.tsx +53 -54
  200. package/themes/original/src/components/UserProfile/index.tsx +58 -35
  201. package/themes/original/src/components/UserProfile/styles.ts +17 -0
  202. package/themes/original/src/components/UserProfileForm/index.tsx +21 -28
  203. package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
  204. package/themes/original/src/components/Wallets/index.tsx +96 -93
  205. package/themes/original/src/components/Wallets/styles.tsx +2 -0
  206. package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
  207. package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
  208. package/themes/original/src/components/shared/OBottomPopup.tsx +1 -1
  209. package/themes/original/src/components/shared/OButton.tsx +6 -2
  210. package/themes/original/src/components/shared/OIcon.tsx +8 -1
  211. package/themes/original/src/components/shared/OInput.tsx +10 -1
  212. package/themes/original/src/components/shared/OModal.tsx +3 -3
  213. package/themes/original/src/layouts/Container.tsx +13 -9
  214. package/themes/original/src/types/index.tsx +37 -5
  215. package/themes/original/src/utils/index.tsx +321 -58
  216. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -1,5 +1,5 @@
1
1
  import React, { useState, useEffect } from 'react';
2
- import { View, StyleSheet, TouchableOpacity, Platform, I18nManager } from 'react-native';
2
+ import { View, StyleSheet, TouchableOpacity, Platform, I18nManager, Vibration, ScrollView } from 'react-native';
3
3
  import { initStripe, useConfirmPayment } from '@stripe/stripe-react-native';
4
4
  import Picker from 'react-native-country-picker-modal';
5
5
  import MaterialIcons from 'react-native-vector-icons/MaterialIcons'
@@ -16,7 +16,7 @@ import {
16
16
  ToastType,
17
17
  } from 'ordering-components/native';
18
18
  import { useTheme } from 'styled-components/native';
19
- import { OText, OIcon, OModal } from '../shared';
19
+ import { OText, OIcon, OModal, OButton } from '../shared';
20
20
 
21
21
  import { AddressDetails } from '../AddressDetails';
22
22
  import { PaymentOptions } from '../PaymentOptions';
@@ -25,6 +25,8 @@ import { NotFoundSource } from '../NotFoundSource';
25
25
  import { UserDetails } from '../UserDetails';
26
26
  import { PaymentOptionWallet } from '../PaymentOptionWallet';
27
27
  import { PlaceSpot } from '../PlaceSpot'
28
+ import { SignupForm } from '../SignupForm'
29
+ import { LoginForm } from '../LoginForm'
28
30
 
29
31
  import {
30
32
  ChContainer,
@@ -78,6 +80,7 @@ const CheckoutUI = (props: any) => {
78
80
  placing,
79
81
  cartState,
80
82
  cartUuid,
83
+ loyaltyPlansState,
81
84
  businessDetails,
82
85
  paymethodSelected,
83
86
  handlePaymethodChange,
@@ -87,7 +90,9 @@ const CheckoutUI = (props: any) => {
87
90
  instructionsOptions,
88
91
  handleChangeDeliveryOption,
89
92
  currency,
90
- merchantId
93
+ merchantId,
94
+ setPlaceSpotNumber,
95
+ maxDate
91
96
  } = props
92
97
 
93
98
  const theme = useTheme();
@@ -118,14 +123,16 @@ const CheckoutUI = (props: any) => {
118
123
  paddingHorizontal: 40,
119
124
  width: '100%'
120
125
  },
121
- wrapperNavbar: Platform.OS === 'ios'
122
- ? { paddingVertical: 0, paddingHorizontal: 40 }
123
- : { paddingVertical: 20, paddingHorizontal: 40 }
126
+ wrapperNavbar: {
127
+ paddingVertical: 0,
128
+ paddingHorizontal: 40,
129
+ marginVertical: 2
130
+ }
124
131
  })
125
132
 
126
133
  const [, { showToast }] = useToast();
127
134
  const [, t] = useLanguage();
128
- const [{ user, token }] = useSession();
135
+ const [{ user, token }, { login }] = useSession();
129
136
  const [ordering] = useApi()
130
137
  const [{ configs }] = useConfig();
131
138
  const [{ parsePrice, parseDate }] = useUtils();
@@ -142,19 +149,31 @@ const CheckoutUI = (props: any) => {
142
149
  const [webviewPaymethod, setWebviewPaymethod] = useState<any>(null)
143
150
  const [isOpen, setIsOpen] = useState(false)
144
151
  const [requiredFields, setRequiredFields] = useState<any>([])
152
+ const [openModal, setOpenModal] = useState({ login: false, signup: false })
153
+ const [allowedGuest, setAllowedGuest] = useState(false)
145
154
 
146
155
  const placeSpotTypes = [3, 4, 5]
147
156
  const placeSpotsEnabled = placeSpotTypes.includes(options?.type)
157
+ const isGiftCardCart = !cart?.business_id
148
158
  const businessConfigs = businessDetails?.business?.configs ?? []
149
159
  const isWalletCashEnabled = businessConfigs.find((config: any) => config.key === 'wallet_cash_enabled')?.value === '1'
150
160
  const isWalletCreditPointsEnabled = businessConfigs.find((config: any) => config.key === 'wallet_credit_point_enabled')?.value === '1'
151
161
  const isWalletEnabled = configs?.cash_wallet?.value && configs?.wallet_enabled?.value === '1' && (isWalletCashEnabled || isWalletCreditPointsEnabled)
152
162
  const isBusinessChangeEnabled = configs?.cart_change_business_validation?.value === '1'
163
+ const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
164
+ const hideBusinessAddress = theme?.checkout?.components?.business?.components?.address?.hidden
165
+ const hideBusinessDetails = theme?.checkout?.components?.business?.hidden
166
+ const hideBusinessMap = theme?.checkout?.components?.business?.components?.map?.hidden
167
+ const hideCustomerDetails = theme?.checkout?.components?.customer?.hidden
153
168
 
154
169
  const isPreOrder = configs?.preorder_status_enabled?.value === '1'
170
+ const subtotalWithTaxes = cart?.taxes?.reduce((acc: any, item: any) => {
171
+ if (item?.type === 1)
172
+ return acc = acc + item?.summary?.tax
173
+ return acc = acc
174
+ }, cart?.subtotal)
155
175
  const isDisabledButtonPlace = loading || !cart?.valid || (!paymethodSelected && cart?.balance > 0) ||
156
- placing || errorCash || cart?.subtotal < cart?.minimum ||
157
- // (placeSpotTypes.includes(options?.type) && !cart?.place) ||
176
+ placing || errorCash || subtotalWithTaxes < cart?.minimum ||
158
177
  (options.type === 1 &&
159
178
  validationFields?.fields?.checkout?.driver_tip?.enabled &&
160
179
  validationFields?.fields?.checkout?.driver_tip?.required &&
@@ -180,8 +199,21 @@ const CheckoutUI = (props: any) => {
180
199
  }
181
200
  }
182
201
 
183
- const handlePlaceOrder = (confirmPayment: any) => {
184
- if (!userErrors.length && !requiredFields?.length) {
202
+ const handleSuccessSignup = (user: any) => {
203
+ login({
204
+ user,
205
+ token: user?.session?.access_token
206
+ })
207
+ setOpenModal({ ...openModal, signup: false })
208
+ }
209
+
210
+ const handleSuccessLogin = (user: any) => {
211
+ if (user) setOpenModal({ ...openModal, login: false })
212
+ }
213
+
214
+ const handlePlaceOrder = (confirmPayment: any, forcePlace: boolean = false) => {
215
+ if (!userErrors.length && (!requiredFields?.length || allowedGuest) || forcePlace) {
216
+ Vibration.vibrate()
185
217
  handlerClickPlaceOrder && handlerClickPlaceOrder(null, null, confirmPayment)
186
218
  return
187
219
  }
@@ -197,6 +229,11 @@ const CheckoutUI = (props: any) => {
197
229
  setIsUserDetailsEdit(true)
198
230
  }
199
231
 
232
+ const handlePlaceOrderAsGuest = () => {
233
+ setIsOpen(false)
234
+ handlerClickPlaceOrder && handlerClickPlaceOrder()
235
+ }
236
+
200
237
  const handlePaymentMethodClick = (paymethod: any) => {
201
238
  setShowGateway({ closedByUser: false, open: true })
202
239
  setWebviewPaymethod(paymethod)
@@ -260,13 +297,13 @@ const CheckoutUI = (props: any) => {
260
297
  }
261
298
  }, [errors])
262
299
 
263
- // useEffect(() => {
264
- // handlePaymethodChange(null)
265
- // }, [cart?.total])
266
-
267
300
  useEffect(() => {
268
301
  if (cart?.products?.length === 0) {
269
- onNavigationRedirect('Business', { store: cart?.business?.slug, header: null, logo: null })
302
+ if (cart?.business?.slug) {
303
+ onNavigationRedirect('Business', { store: cart?.business?.slug, header: null, logo: null })
304
+ } else {
305
+ onNavigationRedirect('Wallets')
306
+ }
270
307
  }
271
308
  }, [cart?.products])
272
309
 
@@ -274,6 +311,21 @@ const CheckoutUI = (props: any) => {
274
311
  onFailPaypal()
275
312
  }, [showGateway.closedByUser])
276
313
 
314
+ const HeaderTitle = (props: any) => {
315
+ const { text } = props
316
+ return (
317
+ <OText
318
+ size={16}
319
+ lineHeight={24}
320
+ weight={'500'}
321
+ mBottom={props.mb ?? 10}
322
+ color={theme.colors.textNormal}
323
+ >
324
+ {text}
325
+ </OText>
326
+ )
327
+ }
328
+
277
329
  return (
278
330
  <>
279
331
  <Container noPadding>
@@ -281,10 +333,9 @@ const CheckoutUI = (props: any) => {
281
333
  <NavBar
282
334
  title={t('CHECKOUT', 'Checkout')}
283
335
  titleAlign={'center'}
284
- onActionLeft={() => navigation?.canGoBack() && navigation.goBack()}
336
+ onActionLeft={() => onNavigationRedirect('BottomTab', { screen: 'Cart' }, !props.fromMulti)}
285
337
  showCall={false}
286
- btnStyle={{ paddingLeft: 0 }}
287
- style={{ marginTop: Platform.OS === 'ios' ? 0 : 30 }}
338
+ btnStyle={{ paddingLeft: 0, paddingTop: Platform.OS == 'ios' ? 0 : 2 }}
288
339
  titleWrapStyle={{ paddingHorizontal: 0 }}
289
340
  titleStyle={{ marginRight: 0, marginLeft: 0 }}
290
341
  />
@@ -292,13 +343,20 @@ const CheckoutUI = (props: any) => {
292
343
  <ChContainer style={styles.pagePadding}>
293
344
  <ChSection style={{ paddingTop: 0 }}>
294
345
  <ChHeader>
295
- {/* <OrderTypeSelector configTypes={configTypes} /> */}
296
- <CHMomentWrapper onPress={() => navigation.navigate('OrderTypes', { configTypes: configTypes })}>
297
- <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textSecondary}>{t(getTypesText(options?.type || 1), 'Delivery')}</OText>
346
+ <CHMomentWrapper isCustomColor={isChewLayout} onPress={() => navigation.navigate('OrderTypes', { configTypes: configTypes })}>
347
+ <OText
348
+ size={12}
349
+ numberOfLines={1}
350
+ ellipsizeMode={'tail'}
351
+ color={theme.colors?.[isChewLayout ? 'white' : 'textSecondary']}
352
+ >
353
+ {t(getTypesText(options?.type || 1), 'Delivery')}
354
+ </OText>
298
355
  <OIcon
299
356
  src={theme.images.general.arrow_down}
300
357
  width={10}
301
358
  style={{ marginStart: 8 }}
359
+ {...(isChewLayout && { color: 'white' })}
302
360
  />
303
361
  </CHMomentWrapper>
304
362
  <CHMomentWrapper
@@ -322,85 +380,116 @@ const CheckoutUI = (props: any) => {
322
380
  <View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginTop: 18, marginHorizontal: -40 }} />
323
381
  </ChSection>
324
382
 
325
- <ChSection>
326
- <ChBusinessDetails>
327
- {
328
- (businessDetails?.loading || cartState.loading || !businessDetails?.business || Object.values(businessDetails?.business).length === 0) &&
329
- !businessDetails?.error &&
330
- (
383
+ {!isGiftCardCart && !hideBusinessDetails && (
384
+ <ChSection>
385
+ <ChBusinessDetails>
386
+ {
387
+ (businessDetails?.loading || cartState.loading || !businessDetails?.business || Object.values(businessDetails?.business).length === 0) &&
388
+ !businessDetails?.error &&
389
+ (
390
+ <Placeholder Animation={Fade}>
391
+ <PlaceholderLine height={20} />
392
+ <PlaceholderLine height={12} />
393
+ <PlaceholderLine height={12} />
394
+ <PlaceholderLine height={12} style={{ marginBottom: 20 }} />
395
+ </Placeholder>
396
+ )}
397
+ {
398
+ !cartState.loading &&
399
+ businessDetails?.business &&
400
+ Object.values(businessDetails?.business).length > 0 &&
401
+ (
402
+ <>
403
+ <HeaderTitle text={t('BUSINESS_DETAILS', 'Business Details')} />
404
+ <View>
405
+ <OText size={12} lineHeight={18} weight={'400'}>
406
+ {businessDetails?.business?.name}
407
+ </OText>
408
+ <OText size={12} lineHeight={18} weight={'400'}>
409
+ {businessDetails?.business?.email}
410
+ </OText>
411
+ <OText size={12} lineHeight={18} weight={'400'}>
412
+ {businessDetails?.business?.cellphone}
413
+ </OText>
414
+ {!hideBusinessAddress && (
415
+ <OText size={12} lineHeight={18} weight={'400'}>
416
+ {businessDetails?.business?.address}
417
+ </OText>
418
+ )}
419
+ </View>
420
+ </>
421
+ )}
422
+ {businessDetails?.error && businessDetails?.error?.length > 0 && (
423
+ <View>
424
+ <HeaderTitle text={t('BUSINESS_DETAILS', 'Business Details')} />
425
+ <NotFoundSource
426
+ content={businessDetails?.error[0]?.message || businessDetails?.error[0]}
427
+ />
428
+ </View>
429
+ )}
430
+ </ChBusinessDetails>
431
+ <View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginHorizontal: -40 }} />
432
+ </ChSection>
433
+ )}
434
+ {!hideCustomerDetails && (
435
+
436
+ <ChSection>
437
+ <ChUserDetails>
438
+ {cartState.loading ? (
331
439
  <Placeholder Animation={Fade}>
332
440
  <PlaceholderLine height={20} />
333
441
  <PlaceholderLine height={12} />
334
442
  <PlaceholderLine height={12} />
335
443
  <PlaceholderLine height={12} style={{ marginBottom: 20 }} />
336
444
  </Placeholder>
337
- )}
338
- {
339
- !cartState.loading &&
340
- businessDetails?.business &&
341
- Object.values(businessDetails?.business).length > 0 &&
342
- (
343
- <>
344
- <OText size={16} lineHeight={24} weight={'500'} mBottom={10}>
345
- {t('BUSINESS_DETAILS', 'Business Details')}
346
- </OText>
445
+ ) : (
446
+ (user?.guest_id && !allowedGuest) ? (
347
447
  <View>
348
- <OText size={12} lineHeight={18} weight={'400'}>
349
- {businessDetails?.business?.name}
350
- </OText>
351
- <OText size={12} lineHeight={18} weight={'400'}>
352
- {businessDetails?.business?.email}
353
- </OText>
354
- <OText size={12} lineHeight={18} weight={'400'}>
355
- {businessDetails?.business?.cellphone}
356
- </OText>
357
- <OText size={12} lineHeight={18} weight={'400'}>
358
- {businessDetails?.business?.address}
359
- </OText>
448
+ <HeaderTitle text={t('CUSTOMER_DETAILS', 'Customer details')} />
449
+ <OButton
450
+ text={t('SIGN_UP', 'Sign up')}
451
+ textStyle={{ color: theme.colors.white }}
452
+ style={{ borderRadius: 7.6, marginTop: 20 }}
453
+ onClick={() => setOpenModal({ ...openModal, signup: true })}
454
+ />
455
+ <OButton
456
+ text={t('LOGIN', 'Login')}
457
+ textStyle={{ color: theme.colors.primary }}
458
+ bgColor={theme.colors.white}
459
+ borderColor={theme.colors.primary}
460
+ style={{ borderRadius: 7.6, marginTop: 20 }}
461
+ onClick={() => setOpenModal({ ...openModal, login: true })}
462
+ />
463
+ <OButton
464
+ text={t('CONTINUE_AS_GUEST', 'Continue as guest')}
465
+ textStyle={{ color: theme.colors.black }}
466
+ bgColor={theme.colors.white}
467
+ borderColor={theme.colors.black}
468
+ style={{ borderRadius: 7.6, marginTop: 20 }}
469
+ onClick={() => setAllowedGuest(true)}
470
+ />
360
471
  </View>
361
- </>
472
+ ) : (
473
+ <UserDetails
474
+ isUserDetailsEdit={isUserDetailsEdit}
475
+ HeaderTitle={<HeaderTitle text={t('CUSTOMER_DETAILS', 'Customer Details')} mb={0} />}
476
+ cartStatus={cart?.status}
477
+ businessId={cart?.business_id}
478
+ useValidationFields
479
+ useDefualtSessionManager
480
+ useSessionUser
481
+ isCheckout
482
+ phoneUpdate={phoneUpdate}
483
+ togglePhoneUpdate={togglePhoneUpdate}
484
+ />
485
+ )
362
486
  )}
363
- {businessDetails?.error && businessDetails?.error?.length > 0 && (
364
- <View>
365
- <OText size={16} lineHeight={24} weight={'500'}>
366
- {t('BUSINESS_DETAILS', 'Business Details')}
367
- </OText>
368
- <NotFoundSource
369
- content={businessDetails?.error[0]?.message || businessDetails?.error[0]}
370
- />
371
- </View>
372
- )}
373
- </ChBusinessDetails>
374
- <View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginHorizontal: -40 }} />
375
- </ChSection>
376
-
377
- <ChSection>
378
- <ChUserDetails>
379
- {cartState.loading ? (
380
- <Placeholder Animation={Fade}>
381
- <PlaceholderLine height={20} />
382
- <PlaceholderLine height={12} />
383
- <PlaceholderLine height={12} />
384
- <PlaceholderLine height={12} style={{ marginBottom: 20 }} />
385
- </Placeholder>
386
- ) : (
387
- <UserDetails
388
- isUserDetailsEdit={isUserDetailsEdit}
389
- cartStatus={cart?.status}
390
- businessId={cart?.business_id}
391
- useValidationFields
392
- useDefualtSessionManager
393
- useSessionUser
394
- isCheckout
395
- phoneUpdate={phoneUpdate}
396
- togglePhoneUpdate={togglePhoneUpdate}
397
- />
398
- )}
399
- </ChUserDetails>
400
- <View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginHorizontal: -40 }} />
401
- </ChSection>
487
+ </ChUserDetails>
488
+ <View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginHorizontal: -40 }} />
489
+ </ChSection>
490
+ )}
402
491
 
403
- {options?.type === 1 && (
492
+ {options?.type === 1 && !isGiftCardCart && (
404
493
  <DeliveryOptionsContainer>
405
494
  {cartState.loading || deliveryOptionSelected === undefined ? (
406
495
  <View style={{ height: 110 }}>
@@ -410,8 +499,8 @@ const CheckoutUI = (props: any) => {
410
499
  </Placeholder>
411
500
  </View>
412
501
  ) : (
413
- <>
414
- <OText size={16}>{t('DELIVERY_OPTIONS', 'Delivery options')}</OText>
502
+ <ChSection>
503
+ <HeaderTitle text={t('DELIVERY_OPTIONS', 'Delivery options')} />
415
504
  <View
416
505
  style={{
417
506
  backgroundColor: theme.colors.inputDisabled,
@@ -430,7 +519,7 @@ const CheckoutUI = (props: any) => {
430
519
  <OText
431
520
  size={14}
432
521
  >
433
- {deliveryOptions.find((option: any) => option.value === deliveryOptionSelected).label}
522
+ {deliveryOptions.find((option: any) => option.value === deliveryOptionSelected)?.label}
434
523
  </OText>
435
524
  <MaterialIcons name='keyboard-arrow-down' style={styles.icon} />
436
525
  </DeliveryOptionItem>
@@ -457,7 +546,7 @@ const CheckoutUI = (props: any) => {
457
546
  />
458
547
  </View>
459
548
  <View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginHorizontal: -40 }} />
460
- </>
549
+ </ChSection>
461
550
  )}
462
551
 
463
552
  </DeliveryOptionsContainer>
@@ -479,50 +568,30 @@ const CheckoutUI = (props: any) => {
479
568
  </ChSection>
480
569
  )}
481
570
 
482
- {/* <ChSection>
483
- <ChTotal>
484
- {
485
- (
486
- <>
487
- <OIcon
488
- url={businessLogo || businessDetails?.business?.logo}
489
- width={80}
490
- height={80}
491
- borderRadius={80}
492
- />
493
- <View style={{ marginLeft: 10, width: '85%' }}>
494
- <OText size={22} numberOfLines={2} ellipsizeMode='tail' style={{ width: '85%' }}>
495
- {businessName || businessDetails?.business?.name}
496
- </OText>
497
- <OText size={22}>
498
- {cart?.total >= 1 && parsePrice(cart?.total) || cartTotal >= 1 && parsePrice(cartTotal)}
499
- </OText>
500
- </View>
501
- </>
502
- )}
503
- </ChTotal>
504
- </ChSection> */}
505
- <ChSection>
506
- <ChAddress>
507
- {(businessDetails?.loading || cartState.loading) ? (
508
- <Placeholder Animation={Fade}>
509
- <PlaceholderLine height={20} style={{ marginBottom: 50 }} />
510
- <PlaceholderLine height={100} />
511
- </Placeholder>
512
- ) : (
513
- <AddressDetails
514
- navigation={navigation}
515
- location={businessDetails?.business?.location}
516
- businessLogo={businessDetails?.business?.logo}
517
- isCartPending={cart?.status === 2}
518
- uuid={cartUuid}
519
- apiKey={configs?.google_maps_api_key?.value}
520
- mapConfigs={mapConfigs}
521
- />
522
- )}
523
- </ChAddress>
524
- <View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginTop: 13, marginHorizontal: -40 }} />
525
- </ChSection>
571
+ {!isGiftCardCart && !hideBusinessMap && (
572
+ <ChSection>
573
+ <ChAddress>
574
+ {(businessDetails?.loading || cartState.loading) ? (
575
+ <Placeholder Animation={Fade}>
576
+ <PlaceholderLine height={20} style={{ marginBottom: 50 }} />
577
+ <PlaceholderLine height={100} />
578
+ </Placeholder>
579
+ ) : (
580
+ <AddressDetails
581
+ navigation={navigation}
582
+ location={businessDetails?.business?.location}
583
+ businessLogo={businessDetails?.business?.logo}
584
+ isCartPending={cart?.status === 2}
585
+ uuid={cartUuid}
586
+ apiKey={configs?.google_maps_api_key?.value}
587
+ mapConfigs={mapConfigs}
588
+ HeaderTitle={<HeaderTitle text={t('DELIVERY_ADDRESS', 'Delivery address')} mb={0} />}
589
+ />
590
+ )}
591
+ </ChAddress>
592
+ <View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginTop: 13, marginHorizontal: -40 }} />
593
+ </ChSection>
594
+ )}
526
595
 
527
596
  {!cartState.loading &&
528
597
  cart &&
@@ -531,22 +600,22 @@ const CheckoutUI = (props: any) => {
531
600
  cart?.status !== 2 &&
532
601
  validationFields?.fields?.checkout?.driver_tip?.enabled &&
533
602
  driverTipsOptions && driverTipsOptions?.length > 0 &&
603
+ !isGiftCardCart &&
534
604
  (
535
605
  <ChSection>
536
606
  <ChDriverTips>
537
- <OText size={16} lineHeight={24} color={theme.colors.textNormal}>
538
- {t('DRIVER_TIPS', 'Driver Tips')}
539
- </OText>
607
+ <HeaderTitle text={t('DRIVER_TIPS', 'Driver Tips')} mb={0} />
540
608
  <DriverTips
541
609
  uuid={cartUuid}
542
610
  businessId={cart?.business_id}
543
- driverTipsOptions={driverTipsOptions}
544
- isFixedPrice={parseInt(configs?.driver_tip_type?.value, 10) === 1 || !!parseInt(configs?.driver_tip_use_custom?.value, 10)}
611
+ driverTipsOptions={!driverTipsOptions.includes(0) ? [0, ...driverTipsOptions] : driverTipsOptions}
612
+ isFixedPrice={parseInt(configs?.driver_tip_type?.value, 10) === 1}
545
613
  isDriverTipUseCustom={!!parseInt(configs?.driver_tip_use_custom?.value, 10)}
546
- driverTip={parseInt(configs?.driver_tip_type?.value, 10) === 1 || !!parseInt(configs?.driver_tip_use_custom?.value, 10)
614
+ driverTip={parseInt(configs?.driver_tip_type?.value, 10) === 1
547
615
  ? cart?.driver_tip
548
616
  : cart?.driver_tip_rate}
549
617
  useOrderContext
618
+ cart={cart}
550
619
  />
551
620
  </ChDriverTips>
552
621
  </ChSection>
@@ -555,9 +624,7 @@ const CheckoutUI = (props: any) => {
555
624
  {!cartState.loading && cart && cart?.status !== 2 && cart?.valid && (
556
625
  <ChSection>
557
626
  <ChPaymethods>
558
- <OText size={16} lineHeight={24} color={theme.colors.textNormal}>
559
- {t('PAYMENT_METHOD', 'Payment Method')}
560
- </OText>
627
+ <HeaderTitle text={t('PAYMENT_METHOD', 'Payment Method')} mb={0} />
561
628
  {!cartState.loading && cart?.status === 4 && (
562
629
  <OText
563
630
  style={{ textAlign: 'center', marginTop: 20 }}
@@ -570,8 +637,8 @@ const CheckoutUI = (props: any) => {
570
637
  <PaymentOptions
571
638
  cart={cart}
572
639
  isDisabled={cart?.status === 2}
573
- businessId={businessDetails?.business?.id}
574
- isLoading={businessDetails.loading}
640
+ businessId={!isGiftCardCart ? businessDetails?.business?.id : -1}
641
+ isLoading={!isGiftCardCart ? businessDetails.loading : false}
575
642
  paymethods={businessDetails?.business?.paymethods}
576
643
  onPaymentChange={handlePaymethodChange}
577
644
  errorCash={errorCash}
@@ -590,6 +657,7 @@ const CheckoutUI = (props: any) => {
590
657
  <WalletPaymentOptionContainer>
591
658
  <PaymentOptionWallet
592
659
  cart={cart}
660
+ loyaltyPlansState={loyaltyPlansState}
593
661
  businessId={cart?.business_id}
594
662
  businessConfigs={businessDetails?.business?.configs}
595
663
  />
@@ -597,7 +665,7 @@ const CheckoutUI = (props: any) => {
597
665
  )}
598
666
 
599
667
 
600
- {!cartState.loading && placeSpotsEnabled && (
668
+ {!cartState.loading && placeSpotsEnabled && !isGiftCardCart && (
601
669
  <>
602
670
  <View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginTop: 30, marginHorizontal: -40 }} />
603
671
  <PlaceSpot
@@ -605,6 +673,7 @@ const CheckoutUI = (props: any) => {
605
673
  isInputMode
606
674
  cart={cart}
607
675
  spotNumberDefault={cartState?.cart?.spot_number ?? cart?.spot_number}
676
+ setPlaceSpotNumber={setPlaceSpotNumber}
608
677
  vehicleDefault={cart?.vehicle}
609
678
  />
610
679
  <View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginHorizontal: -40 }} />
@@ -622,26 +691,21 @@ const CheckoutUI = (props: any) => {
622
691
  ) : (
623
692
  <>
624
693
  <CartHeader>
625
- <OText
626
- size={16}
627
- lineHeight={24}
628
- color={theme.colors.textNormal}
629
- style={{ fontWeight: '500' }}
630
- >
631
- {t('MOBILE_FRONT_YOUR_ORDER', 'Your order')}
632
- </OText>
633
- <TouchableOpacity
634
- onPress={() => onNavigationRedirect('Business', { store: cart?.business?.slug })}
635
- >
636
- <OText
637
- size={10}
638
- lineHeight={15}
639
- color={theme.colors.primary}
640
- style={{ textDecorationLine: 'underline' }}
694
+ <HeaderTitle text={t('MOBILE_FRONT_YOUR_ORDER', 'Your order')} mb={0} />
695
+ {!isGiftCardCart && (
696
+ <TouchableOpacity
697
+ onPress={() => onNavigationRedirect('Business', { store: cart?.business?.slug })}
641
698
  >
642
- {t('ADD_PRODUCTS', 'Add products')}
643
- </OText>
644
- </TouchableOpacity>
699
+ <OText
700
+ size={12}
701
+ lineHeight={15}
702
+ color={theme.colors.primary}
703
+ style={{ textDecorationLine: 'underline' }}
704
+ >
705
+ {t('ADD_PRODUCTS', 'Add products')}
706
+ </OText>
707
+ </TouchableOpacity>
708
+ )}
645
709
  </CartHeader>
646
710
  {isBusinessChangeEnabled && (
647
711
  <TouchableOpacity
@@ -651,7 +715,7 @@ const CheckoutUI = (props: any) => {
651
715
  <OText
652
716
  size={12}
653
717
  lineHeight={18}
654
- color={theme.colors.textSecondary}
718
+ color={theme.colors.primary}
655
719
  style={{ textDecorationLine: 'underline' }}
656
720
  >
657
721
  {t('CHANGE_STORE', 'Change store')}
@@ -663,6 +727,9 @@ const CheckoutUI = (props: any) => {
663
727
  isCartPending={cart?.status === 2}
664
728
  onNavigationRedirect={onNavigationRedirect}
665
729
  placeSpotTypes={placeSpotTypes}
730
+ businessConfigs={businessConfigs}
731
+ maxDate={maxDate}
732
+ loyaltyRewardRate={loyaltyPlansState?.result?.find((loyal: any) => loyal.type === 'credit_point')?.accumulation_rate ?? 0}
666
733
  />
667
734
  </>
668
735
  )}
@@ -699,6 +766,14 @@ const CheckoutUI = (props: any) => {
699
766
  {t('WARNING_INVALID_PRODUCTS_CHECKOUT', 'To continue with your checkout, please remove from your cart the products that are not available.')}
700
767
  </OText>
701
768
  )}
769
+ {!cart?.valid_preorder && (
770
+ <OText
771
+ color={theme.colors.error}
772
+ size={12}
773
+ >
774
+ {t('INVALID_CART_MOMENT', 'Selected schedule time is invalid, please select a schedule into the business schedule interval.')}
775
+ </OText>
776
+ )}
702
777
  {options.type === 1 &&
703
778
  validationFields?.fields?.checkout?.driver_tip?.enabled &&
704
779
  validationFields?.fields?.checkout?.driver_tip?.required &&
@@ -742,18 +817,50 @@ const CheckoutUI = (props: any) => {
742
817
  togglePhoneUpdate={togglePhoneUpdate}
743
818
  requiredFields={requiredFields}
744
819
  hideUpdateButton
745
- onClose={() => setIsOpen(false)}
820
+ handlePlaceOrderAsGuest={handlePlaceOrderAsGuest}
821
+ onClose={() => {
822
+ setIsOpen(false)
823
+ handlePlaceOrder(null, true)
824
+ }}
825
+ setIsOpen={setIsOpen}
746
826
  />
747
827
  </View>
748
828
  </OModal>
829
+ <OModal
830
+ open={openModal.signup}
831
+ onClose={() => setOpenModal({ ...openModal, signup: false })}
832
+ >
833
+ <ScrollView style={{ paddingHorizontal: 20, width: '100%'}}>
834
+ <SignupForm
835
+ handleSuccessSignup={handleSuccessSignup}
836
+ isGuest
837
+ signupButtonText={t('SIGNUP', 'Signup')}
838
+ useSignupByEmail
839
+ useChekoutFileds
840
+ />
841
+ </ScrollView>
842
+ </OModal>
843
+ <OModal
844
+ open={openModal.login}
845
+ onClose={() => setOpenModal({ ...openModal, login: false })}
846
+ >
847
+ <ScrollView style={{ paddingHorizontal: 20, width: '100%'}}>
848
+ <LoginForm
849
+ handleSuccessLogin={handleSuccessLogin}
850
+ isGuest
851
+ loginButtonText={t('LOGIN', 'Login')}
852
+ loginButtonBackground={theme.colors.primary}
853
+ />
854
+ </ScrollView>
855
+ </OModal>
749
856
  </ChContainer>
750
857
  </Container>
751
858
  {!cartState.loading && cart && cart?.status !== 2 && (
752
859
  <FloatingButton
753
- handleClick={() => handlePlaceOrder(null)}
860
+ handleClick={isDisabledButtonPlace ? () => Vibration.vibrate() : () => handlePlaceOrder(null)}
754
861
  isSecondaryBtn={isDisabledButtonPlace}
755
862
  disabled={isDisabledButtonPlace}
756
- btnText={cart?.subtotal >= cart?.minimum
863
+ btnText={subtotalWithTaxes >= cart?.minimum
757
864
  ? (
758
865
  placing
759
866
  ? t('PLACING', 'Placing')