ordering-ui-react-native 0.12.53 → 0.12.57

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