ordering-ui-react-native 0.16.14 → 0.16.17

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 (37) hide show
  1. package/package.json +1 -1
  2. package/src/components/OrderDetails/index.tsx +5 -1
  3. package/src/navigators/CheckoutNavigator.tsx +6 -0
  4. package/src/navigators/HomeNavigator.tsx +6 -0
  5. package/src/pages/MultiCheckout.tsx +31 -0
  6. package/src/pages/MultiOrdersDetails.tsx +27 -0
  7. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +2 -2
  8. package/themes/original/index.tsx +6 -0
  9. package/themes/original/src/components/BusinessItemAccordion/index.tsx +3 -2
  10. package/themes/original/src/components/BusinessItemAccordion/styles.tsx +0 -2
  11. package/themes/original/src/components/BusinessProductsList/index.tsx +4 -1
  12. package/themes/original/src/components/BusinessProductsListing/index.tsx +16 -7
  13. package/themes/original/src/components/BusinessesListing/index.tsx +1 -1
  14. package/themes/original/src/components/Cart/index.tsx +46 -33
  15. package/themes/original/src/components/FavoriteList/index.tsx +4 -4
  16. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +243 -0
  17. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/styles.tsx +46 -0
  18. package/themes/original/src/components/MultiCheckout/index.tsx +292 -0
  19. package/themes/original/src/components/MultiCheckout/styles.tsx +59 -0
  20. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +372 -0
  21. package/themes/original/src/components/MultiOrdersDetails/index.tsx +258 -0
  22. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +50 -0
  23. package/themes/original/src/components/MyOrders/index.tsx +120 -32
  24. package/themes/original/src/components/MyOrders/styles.tsx +8 -1
  25. package/themes/original/src/components/OrderDetails/index.tsx +9 -7
  26. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +150 -0
  27. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +6 -0
  28. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +51 -0
  29. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +6 -0
  30. package/themes/original/src/components/OrdersOption/index.tsx +102 -28
  31. package/themes/original/src/components/OrdersOption/styles.tsx +4 -1
  32. package/themes/original/src/components/SingleOrderCard/index.tsx +5 -3
  33. package/themes/original/src/components/SingleProductCard/index.tsx +8 -6
  34. package/themes/original/src/components/StripeElementsForm/index.tsx +10 -2
  35. package/themes/original/src/components/StripeElementsForm/naked.tsx +2 -2
  36. package/themes/original/src/components/UserDetails/index.tsx +1 -1
  37. package/themes/original/src/types/index.tsx +44 -19
@@ -0,0 +1,372 @@
1
+ import React, { useState, useEffect } from 'react'
2
+ import {
3
+ useLanguage,
4
+ useEvent,
5
+ useUtils,
6
+ OrderDetails as OrderDetailsController
7
+ } from 'ordering-components/native'
8
+ import { View, StyleSheet, TouchableOpacity, Linking } from 'react-native'
9
+ import { useTheme } from 'styled-components/native'
10
+ import { OText, OButton, OIcon } from '../shared'
11
+ import LinearGradient from 'react-native-linear-gradient'
12
+
13
+ import {
14
+ SingleOrderContainer,
15
+ StaturBar,
16
+ Icons
17
+ } from './styles'
18
+
19
+ const SingleOrderCardUI = (props: any) => {
20
+ const {
21
+ navigation,
22
+ orderTypes,
23
+ readMessages,
24
+ messages,
25
+ setMessages,
26
+ handleGoToOrderDetails
27
+ } = props
28
+
29
+ const { order } = props.order
30
+ const theme = useTheme()
31
+ const [, t] = useLanguage()
32
+ const [{ parseDate, parsePrice }] = useUtils()
33
+
34
+ const styles = StyleSheet.create({
35
+ statusBar: {
36
+ height: 12,
37
+ }
38
+ })
39
+
40
+ const getOrderStatus = (s: string) => {
41
+ const status = parseInt(s);
42
+ const orderStatus = [
43
+ {
44
+ key: 0,
45
+ value: t('PENDING', 'Pending'),
46
+ slug: 'PENDING',
47
+ percentage: 0.25,
48
+ image: theme.images.order.status0,
49
+ },
50
+ {
51
+ key: 1,
52
+ value: t('COMPLETED', 'Completed'),
53
+ slug: 'COMPLETED',
54
+ percentage: 1,
55
+ image: theme.images.order.status1,
56
+ },
57
+ {
58
+ key: 2,
59
+ value: t('REJECTED', 'Rejected'),
60
+ slug: 'REJECTED',
61
+ percentage: 0,
62
+ image: theme.images.order.status2,
63
+ },
64
+ {
65
+ key: 3,
66
+ value: t('DRIVER_IN_BUSINESS', 'Driver in business'),
67
+ slug: 'DRIVER_IN_BUSINESS',
68
+ percentage: 0.6,
69
+ image: theme.images.order.status3,
70
+ },
71
+ {
72
+ key: 4,
73
+ value: t('PREPARATION_COMPLETED', 'Preparation Completed'),
74
+ slug: 'PREPARATION_COMPLETED',
75
+ percentage: 0.7,
76
+ image: theme.images.order.status4,
77
+ },
78
+ {
79
+ key: 5,
80
+ value: t('REJECTED_BY_BUSINESS', 'Rejected by business'),
81
+ slug: 'REJECTED_BY_BUSINESS',
82
+ percentage: 0,
83
+ image: theme.images.order.status5,
84
+ },
85
+ {
86
+ key: 6,
87
+ value: t('REJECTED_BY_DRIVER', 'Rejected by Driver'),
88
+ slug: 'REJECTED_BY_DRIVER',
89
+ percentage: 0,
90
+ image: theme.images.order.status6,
91
+ },
92
+ {
93
+ key: 7,
94
+ value: t('ACCEPTED_BY_BUSINESS', 'Accepted by business'),
95
+ slug: 'ACCEPTED_BY_BUSINESS',
96
+ percentage: 0.35,
97
+ image: theme.images.order.status7,
98
+ },
99
+ {
100
+ key: 8,
101
+ value: t('ACCEPTED_BY_DRIVER', 'Accepted by driver'),
102
+ slug: 'ACCEPTED_BY_DRIVER',
103
+ percentage: 0.45,
104
+ image: theme.images.order.status8,
105
+ },
106
+ {
107
+ key: 9,
108
+ value: t('PICK_UP_COMPLETED_BY_DRIVER', 'Pick up completed by driver'),
109
+ slug: 'PICK_UP_COMPLETED_BY_DRIVER',
110
+ percentage: 0.8,
111
+ image: theme.images.order.status9,
112
+ },
113
+ {
114
+ key: 10,
115
+ value: t('PICK_UP_FAILED_BY_DRIVER', 'Pick up Failed by driver'),
116
+ slug: 'PICK_UP_FAILED_BY_DRIVER',
117
+ percentage: 0,
118
+ image: theme.images.order.status10,
119
+ },
120
+ {
121
+ key: 11,
122
+ value: t(
123
+ 'DELIVERY_COMPLETED_BY_DRIVER',
124
+ 'Delivery completed by driver',
125
+ ),
126
+ slug: 'DELIVERY_COMPLETED_BY_DRIVER',
127
+ percentage: 1,
128
+ image: theme.images.order.status11,
129
+ },
130
+ {
131
+ key: 12,
132
+ value: t('DELIVERY_FAILED_BY_DRIVER', 'Delivery Failed by driver'),
133
+ slug: 'DELIVERY_FAILED_BY_DRIVER',
134
+ percentage: 0,
135
+ image: theme.images.order.status12,
136
+ },
137
+ {
138
+ key: 13,
139
+ value: t('PREORDER', 'PreOrder'),
140
+ slug: 'PREORDER',
141
+ percentage: 0,
142
+ image: theme.images.order.status13,
143
+ },
144
+ {
145
+ key: 14,
146
+ value: t('ORDER_NOT_READY', 'Order not ready'),
147
+ slug: 'ORDER_NOT_READY',
148
+ percentage: 0,
149
+ image: theme.images.order.status13,
150
+ },
151
+ {
152
+ key: 15,
153
+ value: t(
154
+ 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
155
+ 'Order picked up completed by customer',
156
+ ),
157
+ slug: 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
158
+ percentage: 100,
159
+ image: theme.images.order.status1,
160
+ },
161
+ {
162
+ key: 16,
163
+ value: t('CANCELLED_BY_CUSTOMER', 'Cancelled by customer'),
164
+ slug: 'CANCELLED_BY_CUSTOMER',
165
+ percentage: 0,
166
+ image: theme.images.order.status2,
167
+ },
168
+ {
169
+ key: 17,
170
+ value: t(
171
+ 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
172
+ 'Order not picked up by customer',
173
+ ),
174
+ slug: 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
175
+ percentage: 0,
176
+ image: theme.images.order.status2,
177
+ },
178
+ {
179
+ key: 18,
180
+ value: t(
181
+ 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
182
+ 'Driver almost arrived to business',
183
+ ),
184
+ slug: 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
185
+ percentage: 0.15,
186
+ image: theme.images.order.status3,
187
+ },
188
+ {
189
+ key: 19,
190
+ value: t(
191
+ 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER',
192
+ 'Driver almost arrived to customer',
193
+ ),
194
+ slug: 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER',
195
+ percentage: 0.9,
196
+ image: theme.images.order.status11,
197
+ },
198
+ {
199
+ key: 20,
200
+ value: t(
201
+ 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
202
+ 'Customer almost arrived to business',
203
+ ),
204
+ slug: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
205
+ percentage: 90,
206
+ image: theme.images.order.status7,
207
+ },
208
+ {
209
+ key: 21,
210
+ value: t(
211
+ 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
212
+ 'Customer arrived to business',
213
+ ),
214
+ slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
215
+ percentage: 95,
216
+ image: theme.images.order.status7,
217
+ },
218
+ {
219
+ key: 22,
220
+ value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver'),
221
+ slug: 'ORDER_LOOKING_FOR_DRIVER',
222
+ percentage: 35,
223
+ image: theme.images.order.status8
224
+ },
225
+ {
226
+ key: 23,
227
+ value: t('ORDER_DRIVER_ON_WAY', 'Driver on way'),
228
+ slug: 'ORDER_DRIVER_ON_WAY',
229
+ percentage: 45,
230
+ image: theme.images.order.status8
231
+ }
232
+ ];
233
+
234
+ const objectStatus = orderStatus.find((o) => o.key === status);
235
+
236
+ return objectStatus && objectStatus;
237
+ };
238
+
239
+ const handleGoToMessages = (type: string) => {
240
+ readMessages && readMessages();
241
+ navigation.navigate(
242
+ 'MessageDetails',
243
+ {
244
+ type,
245
+ order,
246
+ messages,
247
+ setMessages,
248
+ orderId: order?.id,
249
+ business: type === 'business',
250
+ driver: type === 'driver',
251
+ onClose: () => navigation?.canGoBack()
252
+ ? navigation.goBack()
253
+ : navigation.navigate('BottomTab', { screen: 'MyOrders' }),
254
+ }
255
+ )
256
+ }
257
+
258
+ return (
259
+ <SingleOrderContainer>
260
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between', marginBottom: 35 }}>
261
+ <View style={{ flex: 1, marginRight: 10 }}>
262
+ <OText size={16} lineHeight={24} mBottom={5} weight={'500'} color={theme.colors.textNormal}>
263
+ {t('ORDER', 'Order')} #{order.id}
264
+ </OText>
265
+ <View style={{ flexDirection: 'row' }}>
266
+ <OText size={12} lineHeight={18} color={theme.colors.textNormal}>{orderTypes?.find((type: any) => order?.delivery_type === type?.value)?.text}:</OText>
267
+ <View style={{ flex: 1 }}>
268
+ <OText mLeft={5} size={12} lineHeight={18} color={theme.colors.textNormal}>
269
+ {
270
+ order?.delivery_datetime_utc
271
+ ? parseDate(order?.delivery_datetime_utc)
272
+ : parseDate(order?.delivery_datetime, { utc: false })
273
+ }
274
+ </OText>
275
+ </View>
276
+ </View>
277
+ </View>
278
+ <OButton
279
+ onClick={() => handleGoToOrderDetails(order?.uuid)}
280
+ textStyle={{ color: theme.colors.primary, textAlign: 'center', fontSize: 14 }}
281
+ style={{ flexDirection: 'row', justifyContent: 'center', borderRadius: 7.6, shadowOpacity: 0, paddingLeft: 5, paddingRight: 5, height: 44 }}
282
+ text={t('ORDER_DETAILS', 'Order Details')}
283
+ bgColor={theme.colors.white}
284
+ borderColor={theme.colors.primary}
285
+ />
286
+ </View>
287
+ <OText size={16} lineHeight={24} mBottom={17} weight={'500'} color={theme.colors.textNormal}>
288
+ {t('FROM', 'From')}
289
+ </OText>
290
+ <View style={{ flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between' }}>
291
+ <OText size={12} lineHeight={18} color={theme.colors.textNormal}>
292
+ {order?.business?.name}
293
+ </OText>
294
+ <Icons>
295
+ {!!order?.business?.cellphone && (
296
+ <TouchableOpacity
297
+ onPress={() => order?.business?.cellphone &&
298
+ Linking.openURL(`tel:${order?.business?.cellphone}`)
299
+ }
300
+ style={{ paddingEnd: 5 }}
301
+ >
302
+ <OIcon
303
+ src={theme.images.general.phone}
304
+ width={16}
305
+ color={theme.colors.disabled}
306
+ />
307
+ </TouchableOpacity>
308
+ )}
309
+ <TouchableOpacity
310
+ style={{ paddingStart: 5 }}
311
+ onPress={() => handleGoToMessages('business')}>
312
+ <OIcon
313
+ src={theme.images.general.chat}
314
+ width={16}
315
+ color={theme.colors.disabled}
316
+ />
317
+ </TouchableOpacity>
318
+ </Icons>
319
+ </View>
320
+ <OText size={12} lineHeight={18} color={theme.colors.textNormal}>
321
+ {order?.business?.email}
322
+ </OText>
323
+ {!!order?.business?.cellphone && (
324
+ <OText size={12} lineHeight={18} color={theme.colors.textNormal}>
325
+ {order?.business?.cellphone}
326
+ </OText>
327
+ )}
328
+ <OText size={12} lineHeight={18} color={theme.colors.textNormal}>
329
+ {order?.business?.address}
330
+ </OText>
331
+ <StaturBar>
332
+ <LinearGradient
333
+ start={{ x: 0.0, y: 0.0 }}
334
+ end={{
335
+ x: getOrderStatus(order?.status)?.percentage || 0,
336
+ y: 0,
337
+ }}
338
+ locations={[0.9999, 0.9999]}
339
+ colors={[theme.colors.primary, theme.colors.backgroundGray100]}
340
+ style={styles.statusBar}
341
+ />
342
+ </StaturBar>
343
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
344
+ {getOrderStatus(order?.status)?.value}
345
+ </OText>
346
+ <View style={{ flexDirection: 'row', justifyContent: 'flex-end', marginTop: 20 }}>
347
+ <OText size={16} lineHeight={24} weight={'600'} color={theme.colors.textNormal}>
348
+ {t('EXPORT_ORDER_TOTAL', 'Order total')}: {parsePrice(order?.summary?.total ?? order?.total)}
349
+ </OText>
350
+ </View>
351
+ </SingleOrderContainer>
352
+ )
353
+ }
354
+
355
+ export const SingleOrderCard = (props: any) => {
356
+ const [, t] = useLanguage()
357
+ const orderDetailsProps = {
358
+ ...props,
359
+ orderTypes: props.orderTypes || [
360
+ { value: 1, text: t('DELIVERY', 'Delivery') },
361
+ { value: 2, text: t('PICKUP', 'Pickup') },
362
+ { value: 3, text: t('EAT_IN', 'Eat in') },
363
+ { value: 4, text: t('CURBSIDE', 'Curbside') },
364
+ { value: 5, text: t('DRIVE_THRU', 'Drive thru') }
365
+ ],
366
+ UIComponent: SingleOrderCardUI
367
+ }
368
+
369
+ return (
370
+ <OrderDetailsController {...orderDetailsProps} />
371
+ )
372
+ }
@@ -0,0 +1,258 @@
1
+ import React, { useEffect } from 'react'
2
+ import { useLanguage, useUtils, useToast, ToastType, MultiOrdersDetails as MultiOrdersDetailsController } from 'ordering-components/native'
3
+ import { View, StyleSheet, BackHandler } from 'react-native'
4
+ import { useTheme } from 'styled-components/native'
5
+ import { OText, OButton } from '../shared'
6
+ import { Container } from '../../layouts/Container'
7
+ import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder'
8
+ import { SingleOrderCard } from './SingleOrderCard'
9
+
10
+ import {
11
+ OrdersDetailsContainer,
12
+ Header,
13
+ Divider,
14
+ Section,
15
+ Customer,
16
+ InfoBlock,
17
+ Row,
18
+ OrdersSummary,
19
+ BorderLine
20
+ } from './styles'
21
+
22
+ export const MultiOrdersDetailsUI = (props: any) => {
23
+ const {
24
+ navigation,
25
+ customer,
26
+ paymentEvents,
27
+ ordersSummary,
28
+ isFromMultiCheckout
29
+ } = props
30
+
31
+ const theme = useTheme()
32
+ const styles = StyleSheet.create({
33
+ btnBackArrow: {
34
+ borderWidth: 0,
35
+ backgroundColor: theme.colors.clear,
36
+ shadowColor: theme.colors.clear,
37
+ padding: 0,
38
+ marginLeft: -20
39
+ },
40
+ })
41
+
42
+ const { loading, orders, error } = props.ordersList
43
+ const [, t] = useLanguage()
44
+ const [{ parsePrice, parseNumber, parseDate }] = useUtils();
45
+ const [, { showToast }] = useToast();
46
+
47
+ const walletName: any = {
48
+ cash: {
49
+ name: t('PAY_WITH_CASH_WALLET', 'Pay with Cash Wallet')
50
+ },
51
+ credit_point: {
52
+ name: t('PAY_WITH_CREDITS_POINTS_WALLET', 'Pay with Credit Points Wallet')
53
+ }
54
+ }
55
+
56
+ const handleArrowBack: any = () => {
57
+ if (!isFromMultiCheckout) {
58
+ navigation?.canGoBack() && navigation.goBack();
59
+ return;
60
+ }
61
+ navigation.navigate('BottomTab');
62
+ return true
63
+ }
64
+
65
+ const handleGoToOrderDetails = (uuid: any) => {
66
+ navigation.navigate('OrderDetails', { orderId: uuid })
67
+ }
68
+
69
+ useEffect(() => {
70
+ if (error) {
71
+ showToast(ToastType.Error, error)
72
+ }
73
+ }, [error])
74
+
75
+ useEffect(() => {
76
+ BackHandler.addEventListener('hardwareBackPress', handleArrowBack)
77
+ return () => {
78
+ BackHandler.removeEventListener('hardwareBackPress', handleArrowBack)
79
+ }
80
+ }, [])
81
+
82
+ return (
83
+ <OrdersDetailsContainer keyboardShouldPersistTaps="handled" contentContainerStyle={{ paddingHorizontal: 40 }}>
84
+ <View style={{ flexDirection: 'row' }}>
85
+ <OButton
86
+ imgLeftSrc={theme.images.general.arrow_left}
87
+ imgRightSrc={null}
88
+ style={styles.btnBackArrow}
89
+ onClick={() => handleArrowBack()}
90
+ imgLeftStyle={{ tintColor: theme.colors.textNormal, width: 16 }}
91
+ />
92
+ </View>
93
+ <Header>
94
+ {loading ? (
95
+ <Placeholder Animation={Fade}>
96
+ <PlaceholderLine
97
+ width={20}
98
+ height={30}
99
+ noMargin
100
+ style={{ borderRadius: 10, marginBottom: 8 }}
101
+ />
102
+ <PlaceholderLine
103
+ height={18}
104
+ noMargin
105
+ style={{ borderRadius: 10 }}
106
+ />
107
+ </Placeholder>
108
+ ) : (
109
+ <>
110
+ <OText size={20} lineHeight={30} mBottom={8} color={theme.colors.textNormal}>
111
+ {t('HEY', 'Hey')} <OText size={20} lineHeight={30} weight={700} mLeft={10} color={theme.colors.textNormal}>{customer?.name} {customer?.lastname}</OText>
112
+ </OText>
113
+ <OText size={12} lineHeight={18} color={theme.colors.textNormal}>{t('ORDER_MESSAGE_HEADER_TEXT', 'Once business accepts your order, we will send you an email, thank you!')}</OText>
114
+ </>
115
+ )}
116
+ </Header>
117
+ <Divider />
118
+ <Section>
119
+ <OText size={16} lineHeight={24} weight={'500'} color={theme.colors.textNormal} mBottom={16}>
120
+ {t('CUSTOMER_DETAILS', 'Customer Details')}
121
+ </OText>
122
+ {loading ? (
123
+ <Customer>
124
+ <PlaceholderLine height={18} noMargin style={{ borderRadius: 2 }} />
125
+ <PlaceholderLine height={18} noMargin style={{ borderRadius: 2 }} />
126
+ <PlaceholderLine height={18} noMargin style={{ borderRadius: 2 }} />
127
+ </Customer>
128
+ ) : (
129
+ <Customer>
130
+ <InfoBlock>
131
+ <OText size={12} lineHeight={18} color={theme.colors.textNormal} mBottom={2}>
132
+ {customer?.name} {customer?.lastname}
133
+ </OText>
134
+ <OText size={12} lineHeight={18} color={theme.colors.textNormal} mBottom={2}>
135
+ {customer?.address}
136
+ </OText>
137
+ <OText size={12} lineHeight={18} color={theme.colors.textNormal} mBottom={2}>
138
+ {customer?.cellphone}
139
+ </OText>
140
+ </InfoBlock>
141
+ </Customer>
142
+ )}
143
+ </Section>
144
+ <Divider />
145
+ <Section>
146
+ <OText size={16} lineHeight={24} weight={'500'} color={theme.colors.textNormal} mBottom={16}>
147
+ {t('PAYMETHOD', 'Payment method')}
148
+ </OText>
149
+ {paymentEvents.map((event: any) => (
150
+ <OText key={event.id} size={12} lineHeight={18} color={theme.colors.textNormal}>
151
+ {event?.wallet_event
152
+ ? walletName[event?.wallet_event?.wallet?.type]?.name
153
+ : event?.paymethod?.name}
154
+ </OText>
155
+ ))}
156
+ </Section>
157
+ <Divider />
158
+ <Section>
159
+ <OText size={16} lineHeight={24} weight={'500'} color={theme.colors.textNormal} mBottom={20}>
160
+ {t('DELIVERYA_V21', 'Delivery address')}
161
+ </OText>
162
+ {loading ? (
163
+ <PlaceholderLine height={18} noMargin style={{ borderRadius: 2 }} />
164
+ ) : (
165
+ <OText size={12} lineHeight={18} color={theme.colors.textNormal} mBottom={2}>
166
+ {customer?.address}
167
+ </OText>
168
+ )}
169
+ </Section>
170
+ <Divider />
171
+ {loading ? (
172
+ <Placeholder Animation={Fade}>
173
+ <PlaceholderLine
174
+ height={300}
175
+ noMargin
176
+ style={{ borderRadius: 10, marginBottom: 8 }}
177
+ />
178
+ </Placeholder>
179
+ ) : (
180
+ <OrdersSummary>
181
+ <OText size={16} lineHeight={24} weight={'500'} color={theme.colors.textNormal} mBottom={20}>
182
+ {t('ORDER_SUMMARY', 'Order summary')}
183
+ </OText>
184
+ {orders.map((order: any) => (
185
+ <Row key={order.id}>
186
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
187
+ {t('ORDER', 'Order')} #{order.id}
188
+ </OText>
189
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
190
+ {parsePrice(order?.summary?.total ?? order?.total)}
191
+ </OText>
192
+ </Row>
193
+ ))}
194
+ <BorderLine />
195
+ <Row>
196
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
197
+ {t('TOTAL_BEFORE_TAX', 'Total before tax')}:
198
+ </OText>
199
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
200
+ {parsePrice(ordersSummary?.subtotal)}
201
+ </OText>
202
+ </Row>
203
+ <Row>
204
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
205
+ {t('ESTIMATED_TAX_TO_BE_COLLECTED', 'Estimated tax to be collected')}:
206
+ </OText>
207
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
208
+ {parsePrice(ordersSummary?.tax)}
209
+ </OText>
210
+ </Row>
211
+ <BorderLine />
212
+ <Row style={{ marginTop: 10 }}>
213
+ <OText size={14} lineHeight={18} weight={'500'} color={theme.colors.textNormal}>
214
+ {t('PAYMENT_TOTAL', 'Payment total')}:
215
+ </OText>
216
+ <OText size={14} lineHeight={18} weight={'500'} color={theme.colors.textNormal}>
217
+ {parsePrice(ordersSummary?.total)}
218
+ </OText>
219
+ </Row>
220
+ </OrdersSummary>
221
+ )}
222
+
223
+ {loading ? (
224
+ [...Array(3).keys()].map(i => (
225
+ <Placeholder Animation={Fade} key={i}>
226
+ <PlaceholderLine
227
+ height={300}
228
+ noMargin
229
+ style={{ borderRadius: 10, marginBottom: 8 }}
230
+ />
231
+ </Placeholder>
232
+ ))
233
+ ) : (
234
+ <>
235
+ {orders.map((order: any) => (
236
+ <React.Fragment key={order.id}>
237
+ <SingleOrderCard
238
+ navigation={navigation}
239
+ order={order}
240
+ handleGoToOrderDetails={handleGoToOrderDetails}
241
+ />
242
+ <Divider />
243
+ </React.Fragment>
244
+ ))}
245
+ </>
246
+ )}
247
+ <Divider />
248
+ </OrdersDetailsContainer>
249
+ )
250
+ }
251
+
252
+ export const MultiOrdersDetails = (props: any) => {
253
+ const MultiOrdersDetails = {
254
+ ...props,
255
+ UIComponent: MultiOrdersDetailsUI
256
+ }
257
+ return <MultiOrdersDetailsController {...MultiOrdersDetails} />
258
+ }
@@ -0,0 +1,50 @@
1
+ import styled from 'styled-components/native'
2
+
3
+ export const OrdersDetailsContainer = styled.ScrollView`
4
+ `
5
+ export const Header = styled.View`
6
+ padding: 10px 0 24px 0;
7
+ `
8
+ export const Divider = styled.View`
9
+ height: 8px;
10
+ background-color: ${(props: any) => props.theme.colors.backgroundGray100};
11
+ margin-horizontal: -40px;
12
+ `
13
+ export const Section = styled.View`
14
+ padding: 24px 0px;
15
+ `
16
+ export const Customer = styled.View`
17
+ flex-direction: row;
18
+ align-items: center;
19
+ `
20
+ export const InfoBlock = styled.View`
21
+ width: 100%;
22
+ `
23
+ export const Row = styled.View`
24
+ flex-direction: row;
25
+ justify-content: space-between;
26
+ flex: 1;
27
+ align-items: center;
28
+ padding-bottom: 10px;
29
+ `
30
+ export const OrdersSummary = styled.View`
31
+ background-color: ${(props: any) => props.theme.colors.backgroundGray100};
32
+ margin-horizontal: -40px;
33
+ padding: 25px 40px;
34
+ `
35
+ export const BorderLine = styled.View`
36
+ height: 1px;
37
+ background-color: ${(props: any) => props.theme.colors.backgroundGray200};
38
+ margin-vertical: 6px;
39
+ `
40
+ export const SingleOrderContainer = styled.View`
41
+ padding: 40px 0;
42
+ `
43
+ export const StaturBar = styled.View`
44
+ margin-top: 30px;
45
+ margin-bottom: 10px;
46
+ `
47
+ export const Icons = styled.View`
48
+ flex-direction: row;
49
+ align-items: center;
50
+ `