ordering-ui-react-native 0.12.5 → 0.12.9

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 (35) hide show
  1. package/package.json +1 -1
  2. package/src/components/BusinessBasicInformation/index.tsx +14 -8
  3. package/src/components/PreviousOrders/index.tsx +21 -9
  4. package/src/components/ProductItemAccordion/index.tsx +1 -1
  5. package/themes/instacart/src/components/BusinessProductsList/index.tsx +38 -30
  6. package/themes/instacart/src/components/BusinessProductsListing/index.tsx +44 -3
  7. package/themes/instacart/src/components/BusinessProductsListing/styles.tsx +1 -1
  8. package/themes/instacart/src/types/index.tsx +1 -0
  9. package/themes/kiosk/src/components/BusinessProductsListing/index.tsx +2 -2
  10. package/themes/kiosk/src/components/CategoriesMenu/index.tsx +2 -2
  11. package/themes/kiosk/src/components/NavBar/index.tsx +3 -2
  12. package/themes/kiosk/src/components/OrderDetails/index.tsx +8 -2
  13. package/themes/kiosk/src/components/UpsellingProducts/index.tsx +1 -1
  14. package/themes/single-business/index.tsx +4 -0
  15. package/themes/single-business/src/components/AddressForm/index.tsx +39 -44
  16. package/themes/single-business/src/components/BusinessInformation/styles.tsx +1 -1
  17. package/themes/single-business/src/components/Cart/index.tsx +301 -234
  18. package/themes/single-business/src/components/Cart/styles.tsx +34 -0
  19. package/themes/single-business/src/components/Messages/index.tsx +4 -4
  20. package/themes/single-business/src/components/Messages/styles.tsx +1 -1
  21. package/themes/single-business/src/components/PromotionCard/index.tsx +103 -0
  22. package/themes/single-business/src/components/PromotionCard/styles.tsx +28 -0
  23. package/themes/single-business/src/components/Promotions/index.tsx +78 -0
  24. package/themes/single-business/src/components/Promotions/styles.tsx +3 -0
  25. package/themes/single-business/src/components/UpsellingProducts/styles.tsx +2 -1
  26. package/themes/uber-eats/src/components/BusinessController/index.tsx +1 -1
  27. package/themes/uber-eats/src/components/BusinessProductsCategories/index.tsx +77 -9
  28. package/themes/uber-eats/src/components/BusinessProductsList/index.tsx +56 -10
  29. package/themes/uber-eats/src/components/BusinessProductsListing/index.tsx +50 -9
  30. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +4 -0
  31. package/themes/uber-eats/src/components/HighestRatedBusinesses/index.tsx +132 -0
  32. package/themes/uber-eats/src/components/HighestRatedBusinesses/styles.tsx +6 -0
  33. package/themes/uber-eats/src/components/Messages/index.tsx +1 -1
  34. package/themes/uber-eats/src/components/OrderDetails/index.tsx +4 -2
  35. package/themes/uber-eats/src/types/index.tsx +12 -1
@@ -1,266 +1,333 @@
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
- import { CContainer, CheckoutAction } from './styles';
12
-
13
- import { OSBill, OSTable, OSCoupon, OSTotal } from '../OrderSummary/styles';
11
+ import { ScrollView, View, useWindowDimensions } from 'react-native';
12
+ import {
13
+ CheckoutAction,
14
+ OSBill,
15
+ OSTable,
16
+ OSCoupon,
17
+ OSTotal,
18
+ Title,
19
+ LineDivider
20
+ } from './styles';
14
21
 
15
22
  import { ProductItemAccordion } from '../ProductItemAccordion';
16
- import { BusinessItemAccordion } from '../BusinessItemAccordion';
17
23
  import { CouponControl } from '../CouponControl';
18
24
 
19
25
  import { OButton, OModal, OText } from '../shared';
20
26
  import { ProductForm } from '../ProductForm';
21
27
  import { UpsellingProducts } from '../UpsellingProducts';
22
28
  import { verifyDecimals } from '../../utils';
29
+ import { Container } from '../../layouts/Container';
30
+ import { NotFoundSource } from '../NotFoundSource'
23
31
 
24
32
  const CartUI = (props: any) => {
25
- const {
26
- cart,
27
- clearCart,
28
- changeQuantity,
29
- getProductMax,
30
- offsetDisabled,
31
- removeProduct,
32
- handleCartOpen,
33
- setIsCartsLoading,
34
- // isFromCart
35
- } = props
36
-
37
- const theme = useTheme();
38
-
39
- const [, t] = useLanguage()
40
- const [orderState] = useOrder()
41
- const [{ configs }] = useConfig();
42
- const [{ parsePrice, parseNumber, parseDate }] = useUtils()
43
- const [validationFields] = useValidationFields()
33
+ const {
34
+ cart,
35
+ clearCart,
36
+ changeQuantity,
37
+ getProductMax,
38
+ offsetDisabled,
39
+ removeProduct,
40
+ handleCartOpen,
41
+ setIsCartsLoading,
42
+ } = props
44
43
 
45
- const [openProduct, setModalIsOpen] = useState(false)
46
- const [curProduct, setCurProduct] = useState<any>(null)
47
- const [openUpselling, setOpenUpselling] = useState(false)
48
- const [canOpenUpselling, setCanOpenUpselling] = useState(false)
44
+ const theme = useTheme();
45
+ const { height } = useWindowDimensions()
49
46
 
50
- const isCartPending = cart?.status === 2
51
- const isCouponEnabled = validationFields?.fields?.checkout?.coupon?.enabled
47
+ const [, t] = useLanguage()
48
+ const [orderState] = useOrder()
49
+ const [{ configs }] = useConfig();
50
+ const [{ parsePrice, parseNumber, parseDate }] = useUtils()
51
+ const [validationFields] = useValidationFields()
52
52
 
53
- const momentFormatted = !orderState?.option?.moment
54
- ? t('RIGHT_NOW', 'Right Now')
55
- : parseDate(orderState?.option?.moment, { outputFormat: 'YYYY-MM-DD HH:mm' })
53
+ const [openProduct, setModalIsOpen] = useState(false)
54
+ const [curProduct, setCurProduct] = useState<any>(null)
55
+ const [openUpselling, setOpenUpselling] = useState(false)
56
+ const [canOpenUpselling, setCanOpenUpselling] = useState(false)
56
57
 
57
- const handleDeleteClick = (product: any) => {
58
- removeProduct(product, cart)
59
- }
58
+ const isCartPending = cart?.status === 2
59
+ const isCouponEnabled = validationFields?.fields?.checkout?.coupon?.enabled
60
60
 
61
- const handleEditProduct = (product: any) => {
62
- setCurProduct(product)
63
- setModalIsOpen(true)
64
- }
61
+ const handleDeleteClick = (product: any) => {
62
+ removeProduct(product, cart)
63
+ }
65
64
 
66
- const handlerProductAction = (product: any) => {
67
- if (Object.keys(product).length) {
68
- setModalIsOpen(false)
69
- }
70
- }
65
+ const handleEditProduct = (product: any) => {
66
+ setCurProduct(product)
67
+ setModalIsOpen(true)
68
+ }
71
69
 
72
- const handleClearProducts = async () => {
73
- try {
74
- setIsCartsLoading && setIsCartsLoading(true)
75
- const result = await clearCart(cart?.uuid)
76
- setIsCartsLoading && setIsCartsLoading(false)
77
- } catch (error) {
78
- setIsCartsLoading && setIsCartsLoading(false)
79
- }
80
- }
70
+ const handlerProductAction = (product: any) => {
71
+ if (Object.keys(product).length) {
72
+ setModalIsOpen(false)
73
+ }
74
+ }
81
75
 
82
- const handleUpsellingPage = () => {
83
- setOpenUpselling(false)
84
- setCanOpenUpselling(false)
85
- props.onNavigationRedirect('CheckoutNavigator', {
86
- screen: 'CheckoutPage',
87
- cartUuid: cart?.uuid,
88
- businessLogo: cart?.business?.logo,
89
- businessName: cart?.business?.name,
90
- cartTotal: cart?.total
91
- })
92
- }
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
+ // }
93
85
 
94
- return (
95
- <CContainer>
96
- <BusinessItemAccordion
97
- cart={cart}
98
- moment={momentFormatted}
99
- handleClearProducts={handleClearProducts}
100
- handleCartOpen={handleCartOpen}
101
- onNavigationRedirect={props.onNavigationRedirect}
102
- >
103
- {cart?.products?.length > 0 && cart?.products.map((product: any) => (
104
- <ProductItemAccordion
105
- key={product.code}
106
- isCartPending={isCartPending}
107
- isCartProduct
108
- product={product}
109
- changeQuantity={changeQuantity}
110
- getProductMax={getProductMax}
111
- offsetDisabled={offsetDisabled}
112
- onDeleteProduct={handleDeleteClick}
113
- onEditProduct={handleEditProduct}
114
- />
115
- ))}
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
+ }
116
97
 
117
- {cart?.valid_products && (
118
- <OSBill>
119
- <OSTable>
120
- <OText size={12} lineHeight={18}>{t('SUBTOTAL', 'Subtotal')}</OText>
121
- <OText size={12} lineHeight={18}>
122
- {cart.business.tax_type === 1
123
- ? parsePrice((cart?.subtotal + cart?.tax) || 0)
124
- : parsePrice(cart?.subtotal || 0)}
125
- </OText>
126
- </OSTable>
127
- {cart?.discount > 0 && cart?.total >= 0 && (
128
- <OSTable>
129
- {cart?.discount_type === 1 ? (
130
- <OText size={12} lineHeight={18}>
131
- {t('DISCOUNT', 'Discount')}
132
- <OText size={12} lineHeight={18}>{`(${verifyDecimals(cart?.discount_rate, parsePrice)}%)`}</OText>
133
- </OText>
134
- ) : (
135
- <OText size={12} lineHeight={18}>{t('DISCOUNT', 'Discount')}</OText>
136
- )}
137
- <OText size={12} lineHeight={18}>- {parsePrice(cart?.discount || 0)}</OText>
138
- </OSTable>
139
- )}
140
- {cart.business.tax_type !== 1 && (
141
- <OSTable>
142
- <OText size={12} lineHeight={18}>
143
- {t('TAX', 'Tax')}
144
- {`(${verifyDecimals(cart?.business?.tax, parseNumber)}%)`}
145
- </OText>
146
- <OText size={12} lineHeight={18}>{parsePrice(cart?.tax || 0)}</OText>
147
- </OSTable>
148
- )}
149
- {orderState?.options?.type === 1 && cart?.delivery_price > 0 && (
150
- <OSTable>
151
- <OText size={12} lineHeight={18}>{t('DELIVERY_FEE', 'Delivery Fee')}</OText>
152
- <OText size={12} lineHeight={18}>{parsePrice(cart?.delivery_price)}</OText>
153
- </OSTable>
154
- )}
155
- {cart?.driver_tip > 0 && (
156
- <OSTable>
157
- <OText size={12} lineHeight={18}>
158
- {t('DRIVER_TIP', 'Driver tip')}
159
- {cart?.driver_tip_rate > 0 &&
160
- parseInt(configs?.driver_tip_type?.value, 10) === 2 &&
161
- !parseInt(configs?.driver_tip_use_custom?.value, 10) &&
162
- (
163
- `(${verifyDecimals(cart?.driver_tip_rate, parseNumber)}%)`
164
- )}
165
- </OText>
166
- <OText size={12} lineHeight={18}>{parsePrice(cart?.driver_tip)}</OText>
167
- </OSTable>
168
- )}
169
- {cart?.service_fee > 0 && (
170
- <OSTable>
171
- <OText size={12} lineHeight={18}>
172
- {t('SERVICE_FEE', 'Service Fee')}
173
- {`(${verifyDecimals(cart?.business?.service_fee, parseNumber)}%)`}
174
- </OText>
175
- <OText size={12} lineHeight={18}>{parsePrice(cart?.service_fee)}</OText>
176
- </OSTable>
177
- )}
178
- {isCouponEnabled && !isCartPending && (
179
- <OSTable>
180
- <OSCoupon>
181
- <CouponControl
182
- businessId={cart.business_id}
183
- price={cart.total}
184
- />
185
- </OSCoupon>
186
- </OSTable>
187
- )}
98
+ return (
99
+ cart?.products?.length > 0 ? (
100
+ <ScrollView
101
+ showsVerticalScrollIndicator={false}
102
+ showsHorizontalScrollIndicator={false}
103
+ >
104
+ <Container>
105
+ <Title>
106
+ <OText
107
+ size={20}
108
+ weight='bold'
109
+ >
110
+ {t('YOUR_CART', 'Your cart')}
111
+ </OText>
112
+ </Title>
188
113
 
189
- <OSTotal>
190
- <OSTable style={{ marginTop: 15 }}>
191
- <OText size={14} lineHeight={21} weight={'600'}>
192
- {t('TOTAL', 'Total')}
193
- </OText>
194
- <OText size={14} lineHeight={21} weight={'600'}>
195
- {cart?.total >= 1 && parsePrice(cart?.total)}
196
- </OText>
197
- </OSTable>
198
- </OSTotal>
199
- </OSBill>
200
- )}
201
- {cart?.valid_products && (
202
- <CheckoutAction>
203
- <OButton
204
- text={(cart?.subtotal >= cart?.minimum || !cart?.minimum) && cart?.valid_address ? (
205
- !openUpselling !== canOpenUpselling ? t('CHECKOUT', 'Checkout') : t('LOADING', 'Loading')
206
- ) : !cart?.valid_address ? (
207
- `${t('OUT_OF_COVERAGE', 'Out of Coverage')}`
208
- ) : (
209
- `${t('MINIMUN_SUBTOTAL_ORDER', 'Minimum subtotal order:')} ${parsePrice(cart?.minimum)}`
210
- )}
211
- bgColor={(cart?.subtotal < cart?.minimum || !cart?.valid_address) ? theme.colors.secundary : theme.colors.primary}
212
- isDisabled={(openUpselling && !canOpenUpselling) || cart?.subtotal < cart?.minimum || !cart?.valid_address}
213
- borderColor={theme.colors.primary}
214
- imgRightSrc={null}
215
- textStyle={{ color: 'white', textAlign: 'center', flex: 1 }}
216
- onClick={() => setOpenUpselling(true)}
217
- style={{ width: '100%', flexDirection: 'row', justifyContent: 'center', borderRadius: 7.6, shadowOpacity: 0 }}
218
- />
219
- </CheckoutAction>
220
- )}
221
- </BusinessItemAccordion>
222
- <OModal
223
- open={openProduct}
224
- entireModal
225
- customClose
226
- onClose={() => setModalIsOpen(false)}
227
- >
228
- <ProductForm
229
- isCartProduct
230
- productCart={curProduct}
231
- businessSlug={cart?.business?.slug}
232
- businessId={cart?.business_id}
233
- categoryId={curProduct?.category_id}
234
- productId={curProduct?.id}
235
- onSave={handlerProductAction}
236
- onClose={() => setModalIsOpen(false)}
237
- />
114
+ {cart?.products?.length > 0 && (
115
+ <View>
116
+ {cart?.products?.map((product: any) => (
117
+ <ProductItemAccordion
118
+ key={product.code}
119
+ isCartPending={isCartPending}
120
+ isCartProduct
121
+ product={product}
122
+ changeQuantity={changeQuantity}
123
+ getProductMax={getProductMax}
124
+ offsetDisabled={offsetDisabled}
125
+ onDeleteProduct={handleDeleteClick}
126
+ onEditProduct={handleEditProduct}
127
+ />
128
+ ))}
129
+
130
+ {cart?.valid_products && (
131
+ <OSBill>
132
+ <OSTable>
133
+ <OText size={12} lineHeight={18}>{t('SUBTOTAL', 'Subtotal')}</OText>
134
+ <OText size={12} lineHeight={18}>
135
+ {cart.business.tax_type === 1
136
+ ? parsePrice((cart?.subtotal + cart?.tax) || 0)
137
+ : parsePrice(cart?.subtotal || 0)}
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
+ {cart.business.tax_type !== 1 && (
154
+ <OSTable>
155
+ <OText size={12} lineHeight={18}>
156
+ {t('TAX', 'Tax')}
157
+ {`(${verifyDecimals(cart?.business?.tax, parseNumber)}%)`}
158
+ </OText>
159
+ <OText size={12} lineHeight={18}>{parsePrice(cart?.tax || 0)}</OText>
160
+ </OSTable>
161
+ )}
162
+ {orderState?.options?.type === 1 && cart?.delivery_price > 0 && (
163
+ <OSTable>
164
+ <OText size={12} lineHeight={18}>{t('DELIVERY_FEE', 'Delivery Fee')}</OText>
165
+ <OText size={12} lineHeight={18}>{parsePrice(cart?.delivery_price)}</OText>
166
+ </OSTable>
167
+ )}
168
+ {cart?.driver_tip > 0 && (
169
+ <OSTable>
170
+ <OText size={12} lineHeight={18}>
171
+ {t('DRIVER_TIP', 'Driver tip')}
172
+ {cart?.driver_tip_rate > 0 &&
173
+ parseInt(configs?.driver_tip_type?.value, 10) === 2 &&
174
+ !parseInt(configs?.driver_tip_use_custom?.value, 10) &&
175
+ (
176
+ `(${verifyDecimals(cart?.driver_tip_rate, parseNumber)}%)`
177
+ )}
178
+ </OText>
179
+ <OText size={12} lineHeight={18}>{parsePrice(cart?.driver_tip)}</OText>
180
+ </OSTable>
181
+ )}
182
+ {cart?.service_fee > 0 && (
183
+ <OSTable>
184
+ <OText size={12} lineHeight={18}>
185
+ {t('SERVICE_FEE', 'Service Fee')}
186
+ {`(${verifyDecimals(cart?.business?.service_fee, parseNumber)}%)`}
187
+ </OText>
188
+ <OText size={12} lineHeight={18}>{parsePrice(cart?.service_fee)}</OText>
189
+ </OSTable>
190
+ )}
191
+ {isCouponEnabled && !isCartPending && (
192
+ <OSTable>
193
+ <OSCoupon>
194
+ <CouponControl
195
+ businessId={cart.business_id}
196
+ price={cart.total}
197
+ />
198
+ </OSCoupon>
199
+ </OSTable>
200
+ )}
201
+
202
+ <OSTotal>
203
+ <OSTable style={{ marginTop: 15 }}>
204
+ <OText size={14} lineHeight={21} weight={'600'}>
205
+ {t('TOTAL', 'Total')}
206
+ </OText>
207
+ <OText size={14} lineHeight={21} weight={'600'}>
208
+ {cart?.total >= 1 && parsePrice(cart?.total)}
209
+ </OText>
210
+ </OSTable>
211
+ </OSTotal>
212
+ </OSBill>
213
+ )}
214
+ </View>
215
+ )}
216
+ </Container>
238
217
 
239
- </OModal>
218
+ {cart?.products?.length > 0 && (
219
+ <>
220
+ <LineDivider />
221
+
222
+ <Container>
223
+ <ScrollView
224
+ showsVerticalScrollIndicator={false}
225
+ showsHorizontalScrollIndicator={false}
226
+ >
227
+ <View
228
+ style={{
229
+ paddingTop: 20,
230
+ overflow: 'visible'
231
+ }}
232
+ >
233
+ <OText
234
+ size={16}
235
+ lineHeight={24}
236
+ weight={'500'}
237
+ >
238
+ {t('WANT_SOMETHING_ELSE', 'Do you want something else?')}
239
+ </OText>
240
+ <UpsellingProducts
241
+ isCustomMode
242
+ openUpselling={openUpselling}
243
+ businessId={cart?.business_id}
244
+ business={cart?.business}
245
+ cartProducts={cart?.products}
246
+ canOpenUpselling={canOpenUpselling}
247
+ setCanOpenUpselling={setCanOpenUpselling}
248
+ handleUpsellingPage={handleUpsellingPage}
249
+ handleCloseUpsellingPage={() => { }}
250
+ />
251
+ </View>
252
+ </ScrollView>
253
+
254
+ {cart?.valid_products && (
255
+ <CheckoutAction>
256
+ <OButton
257
+ text={(cart?.subtotal >= cart?.minimum || !cart?.minimum) && cart?.valid_address ? (
258
+ !openUpselling !== canOpenUpselling ? t('CHECKOUT', 'Checkout') : t('LOADING', 'Loading')
259
+ ) : !cart?.valid_address ? (
260
+ `${t('OUT_OF_COVERAGE', 'Out of Coverage')}`
261
+ ) : (
262
+ `${t('MINIMUN_SUBTOTAL_ORDER', 'Minimum subtotal order:')} ${parsePrice(cart?.minimum)}`
263
+ )}
264
+ bgColor={(cart?.subtotal < cart?.minimum || !cart?.valid_address) ? theme.colors.secundary : theme.colors.primary}
265
+ isDisabled={(openUpselling && !canOpenUpselling) || cart?.subtotal < cart?.minimum || !cart?.valid_address}
266
+ borderColor={theme.colors.primary}
267
+ imgRightSrc={null}
268
+ textStyle={{ color: 'white', textAlign: 'center', flex: 1 }}
269
+ onClick={() => props.onNavigationRedirect('CheckoutNavigator', {
270
+ screen: 'CheckoutPage',
271
+ cartUuid: cart?.uuid,
272
+ businessLogo: cart?.business?.logo,
273
+ businessName: cart?.business?.name,
274
+ cartTotal: cart?.total
275
+ })}
276
+ style={{ width: '100%', flexDirection: 'row', justifyContent: 'center', borderRadius: 7.6, shadowOpacity: 0 }}
277
+ />
278
+ </CheckoutAction>
279
+ )}
280
+ </Container>
281
+ </>
282
+ )}
240
283
 
241
- {openUpselling && (
242
- <UpsellingProducts
243
- handleUpsellingPage={handleUpsellingPage}
244
- openUpselling={openUpselling}
245
- businessId={cart?.business_id}
246
- business={cart?.business}
247
- cartProducts={cart?.products}
248
- canOpenUpselling={canOpenUpselling}
249
- setCanOpenUpselling={setCanOpenUpselling}
250
- handleCloseUpsellingPage={() => { }}
251
- />
252
- )}
253
- </CContainer>
254
- )
284
+ <OModal
285
+ open={openProduct}
286
+ entireModal
287
+ customClose
288
+ onClose={() => setModalIsOpen(false)}
289
+ >
290
+ <ProductForm
291
+ isCartProduct
292
+ productCart={curProduct}
293
+ businessSlug={cart?.business?.slug}
294
+ businessId={cart?.business_id}
295
+ categoryId={curProduct?.category_id}
296
+ productId={curProduct?.id}
297
+ onSave={handlerProductAction}
298
+ onClose={() => setModalIsOpen(false)}
299
+ />
300
+
301
+ </OModal>
302
+ </ScrollView>
303
+ ) : (
304
+ <Container>
305
+ <Title>
306
+ <OText
307
+ size={20}
308
+ weight='bold'
309
+ >
310
+ {t('YOUR_CART', 'Your cart')}
311
+ </OText>
312
+ </Title>
313
+ <View style={{ height: height * 0.7, justifyContent: 'center' }}>
314
+ <NotFoundSource
315
+ content={t('NO_PRODUCTS_FOUND', 'Sorry, no products found')}
316
+ image={theme.images.general.notFound}
317
+ />
318
+ </View>
319
+ </Container>
320
+ )
321
+ )
255
322
  }
256
323
 
257
324
  export const Cart = (props: any) => {
258
- const cartProps = {
259
- ...props,
260
- UIComponent: CartUI
261
- }
325
+ const cartProps = {
326
+ ...props,
327
+ UIComponent: CartUI
328
+ }
262
329
 
263
- return (
264
- <CartController {...cartProps} />
265
- )
330
+ return (
331
+ <CartController {...cartProps} />
332
+ )
266
333
  }
@@ -4,6 +4,15 @@ export const CContainer = styled.View`
4
4
  /* border-bottom: 1px solid #F0F0F0; */
5
5
  `
6
6
 
7
+ export const Title = styled.View`
8
+ margin: 20px 0;
9
+ `
10
+
11
+ export const LineDivider = styled.View`
12
+ height: 8px;
13
+ background-color: ${(props: any) => props.theme.colors.backgroundGray100};
14
+ `
15
+
7
16
  export const OrderBill = styled.View`
8
17
  display: flex;
9
18
  align-items: center;
@@ -26,3 +35,28 @@ export const CheckoutAction = styled.View`
26
35
  margin-top: 10px;
27
36
  margin-bottom: 10px;
28
37
  `
38
+
39
+ export const OSBill = styled.View`
40
+ padding: 14px 0px 20px;
41
+ border-top-width: 1px;
42
+ border-top-color: ${(props: any) => props.theme.colors.border};
43
+ margin-top: 20px;
44
+ `
45
+
46
+ export const OSTable = styled.View`
47
+ flex-direction: row;
48
+ justify-content: space-between;
49
+ align-items: center;
50
+ padding-vertical: 5px;
51
+ `
52
+
53
+ export const OSTotal = styled.View`
54
+ border-top-width: 1px;
55
+ border-top-color: #d9d9d9;
56
+ margin-top: 15px;
57
+ `
58
+
59
+ export const OSCoupon = styled.View`
60
+ width: 100%;
61
+ padding: 5px 0px;
62
+ `
@@ -172,7 +172,7 @@ const MessagesUI = (props: MessagesParams) => {
172
172
  )
173
173
  }
174
174
 
175
- const renderInputToolbar = (props: typeof InputToolbarProps) => (
175
+ const renderInputToolbar = (props: any) => (
176
176
  <InputToolbar
177
177
  {...props}
178
178
  containerStyle={{
@@ -183,7 +183,7 @@ const MessagesUI = (props: MessagesParams) => {
183
183
  />
184
184
  )
185
185
 
186
- const renderComposer = (props: typeof ComposerProps) => (
186
+ const renderComposer = (props: any) => (
187
187
  <View style={{
188
188
  flexDirection: 'row', width: '80%', alignItems: 'center', backgroundColor: theme.colors.backgroundGray100,
189
189
  borderRadius: 7.6,
@@ -274,10 +274,10 @@ const MessagesUI = (props: MessagesParams) => {
274
274
  )
275
275
 
276
276
  return (
277
- <View style={{ height: height - top - bottom, width: '100%' }}>
277
+ <View style={{ height: '100%', width: '100%' }}>
278
278
  <Wrapper>
279
279
  <Header>
280
- <OIconButton icon={theme.images.general.arrow_left} style={{ paddingStart: 10, borderColor: theme.colors.clear }} onClick={onClose} />
280
+ <OIconButton icon={theme.images.general.arrow_left} style={{ borderColor: theme.colors.clear }} onClick={onClose} />
281
281
  <View style={{ marginRight: 10, shadowColor: theme.colors.black, shadowOpacity: 0.1, shadowOffset: { width: 0, height: 1 }, shadowRadius: 2 }}>
282
282
  <OIcon
283
283
  url={type === USER_TYPE.DRIVER ? order?.driver?.photo : order?.business?.logo}
@@ -8,11 +8,11 @@ export const Wrapper = styled.View`
8
8
  export const Header = styled.View`
9
9
  flex-direction: row;
10
10
  align-items: center;
11
+ justify-content: flex-start;
11
12
  background-color: ${(props: any) => props.theme.colors.white};
12
13
  box-shadow: 0 2px 2px #0000001A;
13
14
  padding-bottom: 10px;
14
15
  padding-top: 14px;
15
- padding-horizontal: 30px;
16
16
  `
17
17
 
18
18
  export const TitleHeader = styled.View`