ordering-ui-react-native 0.12.52 → 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.
- package/package.json +1 -1
- package/src/components/Cart/index.tsx +50 -16
- package/src/components/OrderDetails/index.tsx +8 -0
- package/src/components/OrderSummary/index.tsx +38 -3
- package/src/layouts/Container.tsx +1 -1
- package/themes/business/src/components/GoogleMap/index.tsx +78 -4
- package/themes/business/src/components/OrderDetails/Business.tsx +11 -3
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +11 -9
- package/themes/business/src/layouts/Container.tsx +3 -1
- package/themes/doordash/src/components/Cart/index.tsx +36 -2
- package/themes/doordash/src/components/OrderDetails/index.tsx +8 -0
- package/themes/doordash/src/components/OrderSummary/index.tsx +36 -3
- package/themes/doordash/src/layouts/Container.tsx +1 -1
- package/themes/franchises/src/components/Cart/index.tsx +257 -223
- package/themes/franchises/src/components/OrderDetails/index.tsx +723 -715
- package/themes/franchises/src/components/OrderSummary/index.tsx +188 -154
- package/themes/franchises/src/layouts/Container.tsx +1 -1
- package/themes/instacart/src/components/Cart/index.tsx +37 -3
- package/themes/instacart/src/components/OrderDetails/index.tsx +8 -0
- package/themes/instacart/src/components/OrderSummary/index.tsx +37 -4
- package/themes/instacart/src/layouts/Container.tsx +1 -1
- package/themes/kiosk/src/layouts/Container.tsx +2 -1
- package/themes/original/src/components/Cart/index.tsx +268 -234
- package/themes/original/src/components/OrderDetails/index.tsx +723 -715
- package/themes/original/src/components/OrderSummary/index.tsx +37 -3
- package/themes/original/src/layouts/Container.tsx +1 -1
- package/themes/single-business/src/components/Cart/index.tsx +1 -1
- package/themes/single-business/src/components/PhoneInputNumber/index.tsx +103 -112
- package/themes/single-business/src/components/UserDetails/index.tsx +107 -111
- package/themes/single-business/src/components/UserDetails/styles.tsx +3 -8
- package/themes/single-business/src/components/UserFormDetails/index.tsx +279 -326
- package/themes/single-business/src/components/UserFormDetails/styles.tsx +7 -5
- package/themes/single-business/src/layouts/Container.tsx +1 -1
- package/themes/uber-eats/src/components/Cart/index.tsx +37 -3
- package/themes/uber-eats/src/components/OrderDetails/index.tsx +8 -0
- package/themes/uber-eats/src/components/OrderSummary/index.tsx +40 -6
- 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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
|
|
42
|
+
const theme = useTheme();
|
|
41
43
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
|
|
55
|
-
|
|
56
|
+
const isCartPending = cart?.status === 2
|
|
57
|
+
const isCouponEnabled = validationFields?.fields?.checkout?.coupon?.enabled
|
|
56
58
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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
|
-
|
|
62
|
-
|
|
63
|
-
|
|
63
|
+
const handleDeleteClick = (product: any) => {
|
|
64
|
+
removeProduct(product, cart)
|
|
65
|
+
}
|
|
64
66
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
const handleEditProduct = (product: any) => {
|
|
68
|
+
setCurProduct(product)
|
|
69
|
+
setModalIsOpen(true)
|
|
70
|
+
}
|
|
69
71
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
const handlerProductAction = (product: any) => {
|
|
73
|
+
if (Object.keys(product).length) {
|
|
74
|
+
setModalIsOpen(false)
|
|
75
|
+
}
|
|
76
|
+
}
|
|
75
77
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
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
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
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
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
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
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
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
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
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
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
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
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
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
|
-
|
|
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
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
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
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
324
|
+
const cartProps = {
|
|
325
|
+
...props,
|
|
326
|
+
UIComponent: CartUI
|
|
327
|
+
}
|
|
294
328
|
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
329
|
+
return (
|
|
330
|
+
<CartController {...cartProps} />
|
|
331
|
+
)
|
|
298
332
|
}
|