ordering-ui-react-native 0.12.55 → 0.12.56

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 (29) hide show
  1. package/package.json +1 -1
  2. package/src/components/Cart/index.tsx +50 -16
  3. package/src/components/OrderDetails/index.tsx +8 -0
  4. package/src/components/OrderSummary/index.tsx +38 -3
  5. package/src/layouts/Container.tsx +1 -1
  6. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +8 -0
  7. package/themes/business/src/layouts/Container.tsx +3 -1
  8. package/themes/doordash/src/components/Cart/index.tsx +36 -2
  9. package/themes/doordash/src/components/OrderDetails/index.tsx +8 -0
  10. package/themes/doordash/src/components/OrderSummary/index.tsx +36 -3
  11. package/themes/doordash/src/layouts/Container.tsx +1 -1
  12. package/themes/franchises/src/components/Cart/index.tsx +257 -223
  13. package/themes/franchises/src/components/OrderDetails/index.tsx +723 -715
  14. package/themes/franchises/src/components/OrderSummary/index.tsx +188 -154
  15. package/themes/franchises/src/layouts/Container.tsx +1 -1
  16. package/themes/instacart/src/components/Cart/index.tsx +37 -3
  17. package/themes/instacart/src/components/OrderDetails/index.tsx +8 -0
  18. package/themes/instacart/src/components/OrderSummary/index.tsx +37 -4
  19. package/themes/instacart/src/layouts/Container.tsx +1 -1
  20. package/themes/kiosk/src/layouts/Container.tsx +2 -1
  21. package/themes/original/src/components/Cart/index.tsx +268 -234
  22. package/themes/original/src/components/OrderDetails/index.tsx +723 -715
  23. package/themes/original/src/components/OrderSummary/index.tsx +37 -3
  24. package/themes/original/src/layouts/Container.tsx +1 -1
  25. package/themes/single-business/src/layouts/Container.tsx +1 -1
  26. package/themes/uber-eats/src/components/Cart/index.tsx +37 -3
  27. package/themes/uber-eats/src/components/OrderDetails/index.tsx +8 -0
  28. package/themes/uber-eats/src/components/OrderSummary/index.tsx +40 -6
  29. package/themes/uber-eats/src/layouts/Container.tsx +1 -1
@@ -1,11 +1,11 @@
1
1
  import React, { useState } from 'react';
2
2
  import {
3
- Cart as CartController,
4
- useOrder,
5
- useLanguage,
6
- useConfig,
7
- useUtils,
8
- useValidationFields,
3
+ Cart as CartController,
4
+ useOrder,
5
+ useLanguage,
6
+ useConfig,
7
+ useUtils,
8
+ useValidationFields,
9
9
  } from 'ordering-components/native';
10
10
  import { useTheme } from 'styled-components/native';
11
11
  import { CContainer, CheckoutAction } from './styles';
@@ -16,85 +16,87 @@ import { ProductItemAccordion } from '../ProductItemAccordion';
16
16
  import { BusinessItemAccordion } from '../BusinessItemAccordion';
17
17
  import { CouponControl } from '../CouponControl';
18
18
 
19
- import { OButton, OModal, OText } from '../shared';
19
+ import { OButton, OInput, OModal, OText } from '../shared';
20
20
  import { ProductForm } from '../ProductForm';
21
21
  import { UpsellingProducts } from '../UpsellingProducts';
22
22
  import { verifyDecimals } from '../../utils';
23
- import { TouchableOpacity } from 'react-native';
23
+ import { ActivityIndicator, TouchableOpacity, View } from 'react-native';
24
24
  import AntIcon from 'react-native-vector-icons/AntDesign'
25
25
  import { TaxInformation } from '../TaxInformation';
26
26
 
27
27
  const CartUI = (props: any) => {
28
- const {
29
- cart,
30
- clearCart,
31
- changeQuantity,
32
- getProductMax,
33
- offsetDisabled,
34
- removeProduct,
35
- handleCartOpen,
36
- setIsCartsLoading,
37
- hideUpselling
38
- // isFromCart
39
- } = props
28
+ const {
29
+ cart,
30
+ clearCart,
31
+ changeQuantity,
32
+ getProductMax,
33
+ offsetDisabled,
34
+ removeProduct,
35
+ handleCartOpen,
36
+ setIsCartsLoading,
37
+ hideUpselling,
38
+ handleChangeComment,
39
+ commentState
40
+ // isFromCart
41
+ } = props
40
42
 
41
- const theme = useTheme();
43
+ const theme = useTheme();
42
44
 
43
- const [, t] = useLanguage()
44
- const [orderState] = useOrder()
45
- const [{ configs }] = useConfig();
46
- const [{ parsePrice, parseNumber, parseDate }] = useUtils()
47
- const [validationFields] = useValidationFields()
45
+ const [, t] = useLanguage()
46
+ const [orderState] = useOrder()
47
+ const [{ configs }] = useConfig();
48
+ const [{ parsePrice, parseNumber, parseDate }] = useUtils()
49
+ const [validationFields] = useValidationFields()
48
50
 
49
- const [openProduct, setModalIsOpen] = useState(false)
50
- const [curProduct, setCurProduct] = useState<any>(null)
51
- const [openUpselling, setOpenUpselling] = useState(false)
52
- const [canOpenUpselling, setCanOpenUpselling] = useState(false)
51
+ const [openProduct, setModalIsOpen] = useState(false)
52
+ const [curProduct, setCurProduct] = useState<any>(null)
53
+ const [openUpselling, setOpenUpselling] = useState(false)
54
+ const [canOpenUpselling, setCanOpenUpselling] = useState(false)
53
55
  const [openTaxModal, setOpenTaxModal] = useState<any>({ open: false, data: null })
54
56
 
55
- const isCartPending = cart?.status === 2
56
- const isCouponEnabled = validationFields?.fields?.checkout?.coupon?.enabled
57
+ const isCartPending = cart?.status === 2
58
+ const isCouponEnabled = validationFields?.fields?.checkout?.coupon?.enabled
57
59
 
58
- const momentFormatted = !orderState?.option?.moment
59
- ? t('RIGHT_NOW', 'Right Now')
60
- : parseDate(orderState?.option?.moment, { outputFormat: 'YYYY-MM-DD HH:mm' })
60
+ const momentFormatted = !orderState?.option?.moment
61
+ ? t('RIGHT_NOW', 'Right Now')
62
+ : parseDate(orderState?.option?.moment, { outputFormat: 'YYYY-MM-DD HH:mm' })
61
63
 
62
- const handleDeleteClick = (product: any) => {
63
- removeProduct(product, cart)
64
- }
64
+ const handleDeleteClick = (product: any) => {
65
+ removeProduct(product, cart)
66
+ }
65
67
 
66
- const handleEditProduct = (product: any) => {
67
- setCurProduct(product)
68
- setModalIsOpen(true)
69
- }
68
+ const handleEditProduct = (product: any) => {
69
+ setCurProduct(product)
70
+ setModalIsOpen(true)
71
+ }
70
72
 
71
- const handlerProductAction = (product: any) => {
72
- if (Object.keys(product).length) {
73
- setModalIsOpen(false)
74
- }
75
- }
73
+ const handlerProductAction = (product: any) => {
74
+ if (Object.keys(product).length) {
75
+ setModalIsOpen(false)
76
+ }
77
+ }
76
78
 
77
- const handleClearProducts = async () => {
78
- try {
79
- setIsCartsLoading && setIsCartsLoading(true)
80
- const result = await clearCart(cart?.uuid)
81
- setIsCartsLoading && setIsCartsLoading(false)
82
- } catch (error) {
83
- setIsCartsLoading && setIsCartsLoading(false)
84
- }
85
- }
79
+ const handleClearProducts = async () => {
80
+ try {
81
+ setIsCartsLoading && setIsCartsLoading(true)
82
+ const result = await clearCart(cart?.uuid)
83
+ setIsCartsLoading && setIsCartsLoading(false)
84
+ } catch (error) {
85
+ setIsCartsLoading && setIsCartsLoading(false)
86
+ }
87
+ }
86
88
 
87
- const handleUpsellingPage = () => {
88
- setOpenUpselling(false)
89
- setCanOpenUpselling(false)
90
- props.onNavigationRedirect('CheckoutNavigator', {
91
- screen: 'CheckoutPage',
92
- cartUuid: cart?.uuid,
93
- businessLogo: cart?.business?.logo,
94
- businessName: cart?.business?.name,
95
- cartTotal: cart?.total
96
- })
97
- }
89
+ const handleUpsellingPage = () => {
90
+ setOpenUpselling(false)
91
+ setCanOpenUpselling(false)
92
+ props.onNavigationRedirect('CheckoutNavigator', {
93
+ screen: 'CheckoutPage',
94
+ cartUuid: cart?.uuid,
95
+ businessLogo: cart?.business?.logo,
96
+ businessName: cart?.business?.name,
97
+ cartTotal: cart?.total
98
+ })
99
+ }
98
100
 
99
101
  const getIncludedTaxes = () => {
100
102
  if (cart?.taxes === null) {
@@ -106,51 +108,51 @@ const CartUI = (props: any) => {
106
108
  }
107
109
  }
108
110
 
109
- return (
110
- <CContainer>
111
- <BusinessItemAccordion
112
- cart={cart}
113
- moment={momentFormatted}
114
- handleClearProducts={handleClearProducts}
115
- handleCartOpen={handleCartOpen}
116
- onNavigationRedirect={props.onNavigationRedirect}
117
- >
118
- {cart?.products?.length > 0 && cart?.products.map((product: any) => (
119
- <ProductItemAccordion
120
- key={product.code}
121
- isCartPending={isCartPending}
122
- isCartProduct
123
- product={product}
124
- changeQuantity={changeQuantity}
125
- getProductMax={getProductMax}
126
- offsetDisabled={offsetDisabled}
127
- onDeleteProduct={handleDeleteClick}
128
- onEditProduct={handleEditProduct}
129
- />
130
- ))}
111
+ return (
112
+ <CContainer>
113
+ <BusinessItemAccordion
114
+ cart={cart}
115
+ moment={momentFormatted}
116
+ handleClearProducts={handleClearProducts}
117
+ handleCartOpen={handleCartOpen}
118
+ onNavigationRedirect={props.onNavigationRedirect}
119
+ >
120
+ {cart?.products?.length > 0 && cart?.products.map((product: any) => (
121
+ <ProductItemAccordion
122
+ key={product.code}
123
+ isCartPending={isCartPending}
124
+ isCartProduct
125
+ product={product}
126
+ changeQuantity={changeQuantity}
127
+ getProductMax={getProductMax}
128
+ offsetDisabled={offsetDisabled}
129
+ onDeleteProduct={handleDeleteClick}
130
+ onEditProduct={handleEditProduct}
131
+ />
132
+ ))}
131
133
 
132
- {cart?.valid_products && (
133
- <OSBill>
134
- <OSTable>
135
- <OText size={12} lineHeight={18}>{t('SUBTOTAL', 'Subtotal')}</OText>
136
- <OText size={12} lineHeight={18}>
134
+ {cart?.valid_products && (
135
+ <OSBill>
136
+ <OSTable>
137
+ <OText size={12} lineHeight={18}>{t('SUBTOTAL', 'Subtotal')}</OText>
138
+ <OText size={12} lineHeight={18}>
137
139
  {parsePrice(cart?.subtotal + getIncludedTaxes())}
138
- </OText>
139
- </OSTable>
140
- {cart?.discount > 0 && cart?.total >= 0 && (
141
- <OSTable>
142
- {cart?.discount_type === 1 ? (
143
- <OText size={12} lineHeight={18}>
144
- {t('DISCOUNT', 'Discount')}
145
- <OText size={12} lineHeight={18}>{`(${verifyDecimals(cart?.discount_rate, parsePrice)}%)`}</OText>
146
- </OText>
147
- ) : (
148
- <OText size={12} lineHeight={18}>{t('DISCOUNT', 'Discount')}</OText>
149
- )}
150
- <OText size={12} lineHeight={18}>- {parsePrice(cart?.discount || 0)}</OText>
151
- </OSTable>
152
- )}
153
- {
140
+ </OText>
141
+ </OSTable>
142
+ {cart?.discount > 0 && cart?.total >= 0 && (
143
+ <OSTable>
144
+ {cart?.discount_type === 1 ? (
145
+ <OText size={12} lineHeight={18}>
146
+ {t('DISCOUNT', 'Discount')}
147
+ <OText size={12} lineHeight={18}>{`(${verifyDecimals(cart?.discount_rate, parsePrice)}%)`}</OText>
148
+ </OText>
149
+ ) : (
150
+ <OText size={12} lineHeight={18}>{t('DISCOUNT', 'Discount')}</OText>
151
+ )}
152
+ <OText size={12} lineHeight={18}>- {parsePrice(cart?.discount || 0)}</OText>
153
+ </OSTable>
154
+ )}
155
+ {
154
156
  cart.taxes?.length > 0 && cart.taxes.filter((tax: any) => tax.type === 2 && tax?.rate !== 0).map((tax: any) => (
155
157
  <OSTable key={tax.id}>
156
158
  <OSRow>
@@ -167,126 +169,158 @@ const CartUI = (props: any) => {
167
169
  ))
168
170
  }
169
171
  {
170
- cart?.fees?.length > 0 && cart?.fees?.filter((fee : any) => !(fee.fixed === 0 && fee.percentage === 0)).map((fee: any) => (
171
- <OSTable key={fee?.id}>
172
- <OSRow>
173
- <OText numberOfLines={1}>
174
- {fee.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}{' '}
175
- ({parsePrice(fee?.fixed)} + {fee?.percentage}%){' '}
176
- </OText>
177
- <TouchableOpacity onPress={() => setOpenTaxModal({ open: true, data: fee })} >
178
- <AntIcon name='exclamationcircleo' size={18} color={theme.colors.primary} />
179
- </TouchableOpacity>
180
- </OSRow>
181
- <OText>{parsePrice(fee?.summary?.fixed + fee?.summary?.percentage || 0)}</OText>
182
- </OSTable>
172
+ cart?.fees?.length > 0 && cart?.fees?.filter((fee: any) => !(fee.fixed === 0 && fee.percentage === 0)).map((fee: any) => (
173
+ <OSTable key={fee?.id}>
174
+ <OSRow>
175
+ <OText numberOfLines={1}>
176
+ {fee.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}{' '}
177
+ ({parsePrice(fee?.fixed)} + {fee?.percentage}%){' '}
178
+ </OText>
179
+ <TouchableOpacity onPress={() => setOpenTaxModal({ open: true, data: fee })} >
180
+ <AntIcon name='exclamationcircleo' size={18} color={theme.colors.primary} />
181
+ </TouchableOpacity>
182
+ </OSRow>
183
+ <OText>{parsePrice(fee?.summary?.fixed + fee?.summary?.percentage || 0)}</OText>
184
+ </OSTable>
183
185
  ))
184
186
  }
185
- {orderState?.options?.type === 1 && cart?.delivery_price > 0 && (
186
- <OSTable>
187
- <OText size={12} lineHeight={18}>{t('DELIVERY_FEE', 'Delivery Fee')}</OText>
188
- <OText size={12} lineHeight={18}>{parsePrice(cart?.delivery_price)}</OText>
189
- </OSTable>
190
- )}
191
- {cart?.driver_tip > 0 && (
192
- <OSTable>
193
- <OText size={12} lineHeight={18}>
194
- {t('DRIVER_TIP', 'Driver tip')}
195
- {cart?.driver_tip_rate > 0 &&
196
- parseInt(configs?.driver_tip_type?.value, 10) === 2 &&
197
- !parseInt(configs?.driver_tip_use_custom?.value, 10) &&
198
- (
199
- `(${verifyDecimals(cart?.driver_tip_rate, parseNumber)}%)`
200
- )}
201
- </OText>
202
- <OText size={12} lineHeight={18}>{parsePrice(cart?.driver_tip)}</OText>
203
- </OSTable>
204
- )}
205
- {cart?.service_fee > 0 && (
206
- <OSTable>
207
- <OText size={12} lineHeight={18}>
208
- {t('SERVICE_FEE', 'Service Fee')}
209
- {`(${verifyDecimals(cart?.business?.service_fee, parseNumber)}%)`}
210
- </OText>
211
- <OText size={12} lineHeight={18}>{parsePrice(cart?.service_fee)}</OText>
212
- </OSTable>
213
- )}
214
- {isCouponEnabled && !isCartPending && (
215
- <OSTable>
216
- <OSCoupon>
217
- <CouponControl
218
- businessId={cart.business_id}
219
- price={cart.total}
220
- />
221
- </OSCoupon>
222
- </OSTable>
223
- )}
187
+ {orderState?.options?.type === 1 && cart?.delivery_price > 0 && (
188
+ <OSTable>
189
+ <OText size={12} lineHeight={18}>{t('DELIVERY_FEE', 'Delivery Fee')}</OText>
190
+ <OText size={12} lineHeight={18}>{parsePrice(cart?.delivery_price)}</OText>
191
+ </OSTable>
192
+ )}
193
+ {cart?.driver_tip > 0 && (
194
+ <OSTable>
195
+ <OText size={12} lineHeight={18}>
196
+ {t('DRIVER_TIP', 'Driver tip')}
197
+ {cart?.driver_tip_rate > 0 &&
198
+ parseInt(configs?.driver_tip_type?.value, 10) === 2 &&
199
+ !parseInt(configs?.driver_tip_use_custom?.value, 10) &&
200
+ (
201
+ `(${verifyDecimals(cart?.driver_tip_rate, parseNumber)}%)`
202
+ )}
203
+ </OText>
204
+ <OText size={12} lineHeight={18}>{parsePrice(cart?.driver_tip)}</OText>
205
+ </OSTable>
206
+ )}
207
+ {cart?.service_fee > 0 && (
208
+ <OSTable>
209
+ <OText size={12} lineHeight={18}>
210
+ {t('SERVICE_FEE', 'Service Fee')}
211
+ {`(${verifyDecimals(cart?.business?.service_fee, parseNumber)}%)`}
212
+ </OText>
213
+ <OText size={12} lineHeight={18}>{parsePrice(cart?.service_fee)}</OText>
214
+ </OSTable>
215
+ )}
216
+ {isCouponEnabled && !isCartPending && (
217
+ <OSTable>
218
+ <OSCoupon>
219
+ <CouponControl
220
+ businessId={cart.business_id}
221
+ price={cart.total}
222
+ />
223
+ </OSCoupon>
224
+ </OSTable>
225
+ )}
224
226
 
225
- <OSTotal>
226
- <OSTable style={{ marginTop: 15 }}>
227
- <OText size={14} lineHeight={21} weight={'600'}>
228
- {t('TOTAL', 'Total')}
229
- </OText>
230
- <OText size={14} lineHeight={21} weight={'600'}>
231
- {cart?.total >= 1 && parsePrice(cart?.total)}
232
- </OText>
233
- </OSTable>
234
- </OSTotal>
235
- </OSBill>
236
- )}
237
- {cart?.valid_products && (
238
- <CheckoutAction>
239
- <OButton
240
- text={(cart?.subtotal >= cart?.minimum || !cart?.minimum) && cart?.valid_address ? (
241
- !openUpselling !== canOpenUpselling ? t('CHECKOUT', 'Checkout') : t('LOADING', 'Loading')
242
- ) : !cart?.valid_address ? (
243
- `${t('OUT_OF_COVERAGE', 'Out of Coverage')}`
244
- ) : (
245
- `${t('MINIMUN_SUBTOTAL_ORDER', 'Minimum subtotal order:')} ${parsePrice(cart?.minimum)}`
246
- )}
247
- bgColor={(cart?.subtotal < cart?.minimum || !cart?.valid_address) ? theme.colors.secundary : theme.colors.primary}
248
- isDisabled={(openUpselling && !canOpenUpselling) || cart?.subtotal < cart?.minimum || !cart?.valid_address}
249
- borderColor={theme.colors.primary}
250
- imgRightSrc={null}
251
- textStyle={{ color: 'white', textAlign: 'center', flex: 1 }}
252
- onClick={() => setOpenUpselling(true)}
253
- style={{ width: '100%', flexDirection: 'row', justifyContent: 'center', borderRadius: 7.6, shadowOpacity: 0 }}
254
- />
255
- </CheckoutAction>
256
- )}
257
- </BusinessItemAccordion>
258
- <OModal
259
- open={openProduct}
260
- entireModal
261
- customClose
262
- onClose={() => setModalIsOpen(false)}
263
- >
264
- <ProductForm
265
- isCartProduct
266
- productCart={curProduct}
267
- businessSlug={cart?.business?.slug}
268
- businessId={cart?.business_id}
269
- categoryId={curProduct?.category_id}
270
- productId={curProduct?.id}
271
- onSave={handlerProductAction}
272
- onClose={() => setModalIsOpen(false)}
273
- />
227
+ <OSTotal>
228
+ <OSTable style={{ marginTop: 15 }}>
229
+ <OText size={14} lineHeight={21} weight={'600'}>
230
+ {t('TOTAL', 'Total')}
231
+ </OText>
232
+ <OText size={14} lineHeight={21} weight={'600'}>
233
+ {cart?.total >= 1 && parsePrice(cart?.total)}
234
+ </OText>
235
+ </OSTable>
236
+ </OSTotal>
237
+ {cart?.status !== 2 && (
238
+ <OSTable>
239
+ <View style={{ width: '100%', marginTop: 20 }}>
240
+ <OText size={12} lineHeight={18}>{t('COMMENTS', 'Comments')}</OText>
241
+ <View style={{ flex: 1, width: '100%' }}>
242
+ <OInput
243
+ value={cart?.comment}
244
+ placeholder={t('SPECIAL_COMMENTS', 'Special Comments')}
245
+ onChange={(value: string) => handleChangeComment(value)}
246
+ style={{
247
+ alignItems: 'flex-start',
248
+ width: '100%',
249
+ height: 100,
250
+ borderColor: theme.colors.textSecondary,
251
+ paddingRight: 50,
252
+ marginTop: 10
253
+ }}
254
+ multiline
255
+ />
256
+ {commentState?.loading && (
257
+ <View style={{ position: 'absolute', right: 20 }}>
258
+ <ActivityIndicator
259
+ size='large'
260
+ style={{ height: 100 }}
261
+ color={theme.colors.primary}
262
+ />
263
+ </View>
264
+ )}
265
+ </View>
266
+ </View>
267
+ </OSTable>
268
+ )}
269
+ </OSBill>
270
+ )}
271
+ {cart?.valid_products && (
272
+ <CheckoutAction>
273
+ <OButton
274
+ text={(cart?.subtotal >= cart?.minimum || !cart?.minimum) && cart?.valid_address ? (
275
+ !openUpselling !== canOpenUpselling ? t('CHECKOUT', 'Checkout') : t('LOADING', 'Loading')
276
+ ) : !cart?.valid_address ? (
277
+ `${t('OUT_OF_COVERAGE', 'Out of Coverage')}`
278
+ ) : (
279
+ `${t('MINIMUN_SUBTOTAL_ORDER', 'Minimum subtotal order:')} ${parsePrice(cart?.minimum)}`
280
+ )}
281
+ bgColor={(cart?.subtotal < cart?.minimum || !cart?.valid_address) ? theme.colors.secundary : theme.colors.primary}
282
+ isDisabled={(openUpselling && !canOpenUpselling) || cart?.subtotal < cart?.minimum || !cart?.valid_address}
283
+ borderColor={theme.colors.primary}
284
+ imgRightSrc={null}
285
+ textStyle={{ color: 'white', textAlign: 'center', flex: 1 }}
286
+ onClick={() => setOpenUpselling(true)}
287
+ style={{ width: '100%', flexDirection: 'row', justifyContent: 'center', borderRadius: 7.6, shadowOpacity: 0 }}
288
+ />
289
+ </CheckoutAction>
290
+ )}
291
+ </BusinessItemAccordion>
292
+ <OModal
293
+ open={openProduct}
294
+ entireModal
295
+ customClose
296
+ onClose={() => setModalIsOpen(false)}
297
+ >
298
+ <ProductForm
299
+ isCartProduct
300
+ productCart={curProduct}
301
+ businessSlug={cart?.business?.slug}
302
+ businessId={cart?.business_id}
303
+ categoryId={curProduct?.category_id}
304
+ productId={curProduct?.id}
305
+ onSave={handlerProductAction}
306
+ onClose={() => setModalIsOpen(false)}
307
+ />
274
308
 
275
- </OModal>
309
+ </OModal>
276
310
 
277
- {openUpselling && (
278
- <UpsellingProducts
279
- handleUpsellingPage={handleUpsellingPage}
280
- openUpselling={openUpselling}
281
- businessId={cart?.business_id}
282
- business={cart?.business}
283
- cartProducts={cart?.products}
284
- canOpenUpselling={canOpenUpselling}
285
- setCanOpenUpselling={setCanOpenUpselling}
286
- handleCloseUpsellingPage={() => { }}
287
- isFromCart
288
- />
289
- )}
311
+ {openUpselling && (
312
+ <UpsellingProducts
313
+ handleUpsellingPage={handleUpsellingPage}
314
+ openUpselling={openUpselling}
315
+ businessId={cart?.business_id}
316
+ business={cart?.business}
317
+ cartProducts={cart?.products}
318
+ canOpenUpselling={canOpenUpselling}
319
+ setCanOpenUpselling={setCanOpenUpselling}
320
+ handleCloseUpsellingPage={() => { }}
321
+ isFromCart
322
+ />
323
+ )}
290
324
  <OModal
291
325
  open={openTaxModal.open}
292
326
  onClose={() => setOpenTaxModal({ open: false, data: null })}
@@ -294,17 +328,17 @@ const CartUI = (props: any) => {
294
328
  >
295
329
  <TaxInformation data={openTaxModal.data} products={cart.products} />
296
330
  </OModal>
297
- </CContainer>
298
- )
331
+ </CContainer>
332
+ )
299
333
  }
300
334
 
301
335
  export const Cart = (props: any) => {
302
- const cartProps = {
303
- ...props,
304
- UIComponent: CartUI
305
- }
336
+ const cartProps = {
337
+ ...props,
338
+ UIComponent: CartUI
339
+ }
306
340
 
307
- return (
308
- <CartController {...cartProps} />
309
- )
341
+ return (
342
+ <CartController {...cartProps} />
343
+ )
310
344
  }