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