ordering-ui-react-native 0.12.14 → 0.12.18
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/AddressList/index.tsx +3 -1
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +168 -156
- package/themes/business/src/components/NewOrderNotification/index.tsx +14 -1
- package/themes/business/src/components/OrderDetails/Delivery.tsx +3 -1
- package/themes/business/src/components/OrdersOption/index.tsx +19 -15
- package/themes/business/src/components 2/AcceptOrRejectOrder/index.tsx +389 -0
- package/themes/business/src/components 2/AcceptOrRejectOrder/styles.tsx +36 -0
- package/themes/business/src/components 2/BusinessController/index.tsx +155 -0
- package/themes/business/src/components 2/BusinessController/styles.tsx +19 -0
- package/themes/business/src/components 2/Chat/index.tsx +1152 -0
- package/themes/business/src/components 2/Chat/styles.tsx +12 -0
- package/themes/business/src/components 2/Contacts/index.tsx +299 -0
- package/themes/business/src/components 2/Contacts/styles.tsx +42 -0
- package/themes/business/src/components 2/DriverMap/index.tsx +525 -0
- package/themes/business/src/components 2/FloatingButton/index.tsx +141 -0
- package/themes/business/src/components 2/FloatingButton/styles.tsx +35 -0
- package/themes/business/src/components 2/ForgotPasswordForm/index.tsx +204 -0
- package/themes/business/src/components 2/ForgotPasswordForm/styles.tsx +11 -0
- package/themes/business/src/components 2/GoogleMap/index.tsx +347 -0
- package/themes/business/src/components 2/Home/index.tsx +111 -0
- package/themes/business/src/components 2/Home/styles.tsx +27 -0
- package/themes/business/src/components 2/LanguageSelector/index.tsx +124 -0
- package/themes/business/src/components 2/LanguageSelector/lang_country.json +152 -0
- package/themes/business/src/components 2/LanguageSelector/styles.tsx +17 -0
- package/themes/business/src/components 2/LoginForm/index.tsx +663 -0
- package/themes/business/src/components 2/LoginForm/styles.tsx +48 -0
- package/themes/business/src/components 2/LogoutButton/index.tsx +63 -0
- package/themes/business/src/components 2/MapView/index.tsx +317 -0
- package/themes/business/src/components 2/MessagesOption/index.tsx +337 -0
- package/themes/business/src/components 2/MessagesOption/styles.tsx +27 -0
- package/themes/business/src/components 2/NewOrderNotification/index.tsx +167 -0
- package/themes/business/src/components 2/NewOrderNotification/styles.tsx +8 -0
- package/themes/business/src/components 2/NotFoundSource/index.tsx +52 -0
- package/themes/business/src/components 2/NotFoundSource/styles.tsx +17 -0
- package/themes/business/src/components 2/OrderDetails/Business.tsx +683 -0
- package/themes/business/src/components 2/OrderDetails/Delivery.tsx +454 -0
- package/themes/business/src/components 2/OrderDetails/OrderContentComponent.tsx +391 -0
- package/themes/business/src/components 2/OrderDetails/OrderHeaderComponent.tsx +148 -0
- package/themes/business/src/components 2/OrderDetails/styles.tsx +84 -0
- package/themes/business/src/components 2/OrderMessage/index.tsx +344 -0
- package/themes/business/src/components 2/OrderMessage/styles.tsx +5 -0
- package/themes/business/src/components 2/OrderSummary/index.tsx +700 -0
- package/themes/business/src/components 2/OrderSummary/styles.tsx +61 -0
- package/themes/business/src/components 2/OrdersOption/index.tsx +755 -0
- package/themes/business/src/components 2/OrdersOption/styles.tsx +54 -0
- package/themes/business/src/components 2/OrdersOptionBusiness/index.tsx +51 -0
- package/themes/business/src/components 2/OrdersOptionBusiness/styles.tsx +8 -0
- package/themes/business/src/components 2/OrdersOptionCity/index.tsx +52 -0
- package/themes/business/src/components 2/OrdersOptionCity/styles.tsx +8 -0
- package/themes/business/src/components 2/OrdersOptionDate/index.tsx +52 -0
- package/themes/business/src/components 2/OrdersOptionDate/styles.tsx +8 -0
- package/themes/business/src/components 2/OrdersOptionDelivery/index.tsx +35 -0
- package/themes/business/src/components 2/OrdersOptionDelivery/styles.tsx +8 -0
- package/themes/business/src/components 2/OrdersOptionDriver/index.tsx +50 -0
- package/themes/business/src/components 2/OrdersOptionDriver/styles.tsx +8 -0
- package/themes/business/src/components 2/OrdersOptionPaymethod/index.tsx +49 -0
- package/themes/business/src/components 2/OrdersOptionPaymethod/styles.tsx +8 -0
- package/themes/business/src/components 2/OrdersOptionStatus/index.tsx +46 -0
- package/themes/business/src/components 2/OrdersOptionStatus/styles.tsx +8 -0
- package/themes/business/src/components 2/PhoneInputNumber/index.tsx +160 -0
- package/themes/business/src/components 2/PhoneInputNumber/styles.tsx +3 -0
- package/themes/business/src/components 2/PreviousMessages/index.tsx +304 -0
- package/themes/business/src/components 2/PreviousMessages/styles.tsx +32 -0
- package/themes/business/src/components 2/PreviousOrders/index.tsx +180 -0
- package/themes/business/src/components 2/PreviousOrders/styles.tsx +38 -0
- package/themes/business/src/components 2/ProductItemAccordion/index.tsx +301 -0
- package/themes/business/src/components 2/ProductItemAccordion/styles.tsx +61 -0
- package/themes/business/src/components 2/SearchBar/index.tsx +112 -0
- package/themes/business/src/components 2/SignupForm/index.tsx +530 -0
- package/themes/business/src/components 2/SignupForm/styles.tsx +16 -0
- package/themes/business/src/components 2/StoresList/index.tsx +208 -0
- package/themes/business/src/components 2/StoresList/styles.tsx +26 -0
- package/themes/business/src/components 2/UserFormDetails/index.tsx +513 -0
- package/themes/business/src/components 2/UserFormDetails/styles.tsx +40 -0
- package/themes/business/src/components 2/UserProfileForm/index.tsx +496 -0
- package/themes/business/src/components 2/UserProfileForm/styles.tsx +36 -0
- package/themes/business/src/components 2/VerifyPhone/index.tsx +201 -0
- package/themes/business/src/components 2/VerifyPhone/styles.tsx +43 -0
- package/themes/business/src/components 2/shared/OAlert.tsx +52 -0
- package/themes/business/src/components 2/shared/OButton.tsx +149 -0
- package/themes/business/src/components 2/shared/OChatBubble.tsx +100 -0
- package/themes/business/src/components 2/shared/ODropDown.tsx +195 -0
- package/themes/business/src/components 2/shared/ODropDownCalendar.tsx +328 -0
- package/themes/business/src/components 2/shared/OFab.tsx +54 -0
- package/themes/business/src/components 2/shared/OIcon.tsx +67 -0
- package/themes/business/src/components 2/shared/OIconButton.tsx +127 -0
- package/themes/business/src/components 2/shared/OInput.tsx +144 -0
- package/themes/business/src/components 2/shared/OLink.tsx +76 -0
- package/themes/business/src/components 2/shared/OModal.tsx +275 -0
- package/themes/business/src/components 2/shared/OSegment.tsx +86 -0
- package/themes/business/src/components 2/shared/OText.tsx +55 -0
- package/themes/business/src/components 2/shared/OTextarea.tsx +46 -0
- package/themes/business/src/components 2/shared/OToast.tsx +92 -0
- package/themes/business/src/components 2/shared/index.tsx +27 -0
- package/themes/business/src/types/index.tsx +4 -1
- package/themes/kiosk/src/components/CategoriesMenu/index.tsx +128 -83
- package/themes/kiosk/src/components/DrawerView/index.tsx +57 -0
- package/themes/kiosk/src/components/DrawerView/styles.tsx +30 -0
- package/themes/kiosk/src/components/LanguageSelector/index.tsx +78 -58
- package/themes/kiosk/src/components/OrderDetails/index.tsx +3 -1
- package/themes/kiosk/src/components/ProductForm/index.tsx +129 -127
- package/themes/kiosk/src/components/ProductForm/styles.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/index.tsx +9 -6
- package/themes/original/src/components/OrderProgress/index.tsx +32 -18
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import { Platform, StyleSheet, View } from 'react-native';
|
|
4
|
+
|
|
5
|
+
import { OText, OLink } from '../shared'
|
|
6
|
+
import {
|
|
7
|
+
OrderContent,
|
|
8
|
+
OrderBusiness,
|
|
9
|
+
OrderCustomer,
|
|
10
|
+
OrderProducts,
|
|
11
|
+
Table,
|
|
12
|
+
OrderBill,
|
|
13
|
+
Total,
|
|
14
|
+
} from './styles';
|
|
15
|
+
|
|
16
|
+
import { ProductItemAccordion } from '../ProductItemAccordion';
|
|
17
|
+
|
|
18
|
+
import { verifyDecimals } from '../../utils';
|
|
19
|
+
|
|
20
|
+
import {
|
|
21
|
+
useLanguage,
|
|
22
|
+
useUtils,
|
|
23
|
+
useConfig,
|
|
24
|
+
} from 'ordering-components/native';
|
|
25
|
+
import { useTheme } from 'styled-components/native';
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
interface OrderContent {
|
|
29
|
+
order: any
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const OrderContentComponent = (props: OrderContent) => {
|
|
33
|
+
const [, t] = useLanguage();
|
|
34
|
+
const theme = useTheme()
|
|
35
|
+
|
|
36
|
+
const { order } = props;
|
|
37
|
+
|
|
38
|
+
const [{ parsePrice, parseNumber }] = useUtils();
|
|
39
|
+
const [{ configs }] = useConfig();
|
|
40
|
+
|
|
41
|
+
const styles = StyleSheet.create({
|
|
42
|
+
linkWithIcons: {
|
|
43
|
+
flexDirection: 'row',
|
|
44
|
+
alignItems: 'center',
|
|
45
|
+
justifyContent: 'space-between',
|
|
46
|
+
marginBottom: 5,
|
|
47
|
+
flex: 1,
|
|
48
|
+
},
|
|
49
|
+
textBold: {
|
|
50
|
+
fontWeight: '600',
|
|
51
|
+
},
|
|
52
|
+
textLink: {
|
|
53
|
+
color: '#365CC7'
|
|
54
|
+
}
|
|
55
|
+
})
|
|
56
|
+
return (
|
|
57
|
+
<OrderContent>
|
|
58
|
+
<OrderBusiness>
|
|
59
|
+
<OText style={{ marginBottom: 5 }} size={16} weight="600">
|
|
60
|
+
{t('BUSINESS_DETAILS', 'Business details')}
|
|
61
|
+
</OText>
|
|
62
|
+
|
|
63
|
+
<OText numberOfLines={1} mBottom={4} ellipsizeMode="tail">
|
|
64
|
+
{order?.business?.name}
|
|
65
|
+
</OText>
|
|
66
|
+
|
|
67
|
+
{!!order?.business?.email && (
|
|
68
|
+
<View style={styles.linkWithIcons}>
|
|
69
|
+
<OLink
|
|
70
|
+
PressStyle={styles.linkWithIcons}
|
|
71
|
+
url={`mailto:${order?.business?.email}`}
|
|
72
|
+
shorcut={order?.business?.email}
|
|
73
|
+
TextStyle={styles.textLink}
|
|
74
|
+
/>
|
|
75
|
+
</View>
|
|
76
|
+
)}
|
|
77
|
+
|
|
78
|
+
{!!order?.business?.cellphone && (
|
|
79
|
+
<View style={styles.linkWithIcons}>
|
|
80
|
+
<OLink
|
|
81
|
+
PressStyle={styles.linkWithIcons}
|
|
82
|
+
url={`tel:${order?.business?.cellphone}`}
|
|
83
|
+
shorcut={`${order?.business?.cellphone}`}
|
|
84
|
+
TextStyle={styles.textLink}
|
|
85
|
+
/>
|
|
86
|
+
</View>
|
|
87
|
+
)}
|
|
88
|
+
|
|
89
|
+
{!!order?.business?.phone && (
|
|
90
|
+
<View style={styles.linkWithIcons}>
|
|
91
|
+
<OLink
|
|
92
|
+
PressStyle={styles.linkWithIcons}
|
|
93
|
+
url={`tel:${order?.business?.phone}`}
|
|
94
|
+
shorcut={order?.business?.phone}
|
|
95
|
+
TextStyle={styles.textLink}
|
|
96
|
+
/>
|
|
97
|
+
</View>
|
|
98
|
+
)}
|
|
99
|
+
|
|
100
|
+
{!!order?.business?.address && (
|
|
101
|
+
<View style={styles.linkWithIcons}>
|
|
102
|
+
<OLink
|
|
103
|
+
PressStyle={styles.linkWithIcons}
|
|
104
|
+
url={Platform.select({
|
|
105
|
+
ios: `maps:0,0?q=${order?.business?.address}`,
|
|
106
|
+
android: `geo:0,0?q=${order?.business?.address}`,
|
|
107
|
+
})}
|
|
108
|
+
shorcut={order?.business?.address}
|
|
109
|
+
TextStyle={styles.textLink}
|
|
110
|
+
/>
|
|
111
|
+
</View>
|
|
112
|
+
)}
|
|
113
|
+
|
|
114
|
+
{!!order?.business?.address_notes && (
|
|
115
|
+
<View style={styles.linkWithIcons}>
|
|
116
|
+
<OLink
|
|
117
|
+
PressStyle={styles.linkWithIcons}
|
|
118
|
+
url={Platform.select({
|
|
119
|
+
ios: `maps:0,0?q=${order?.business?.address_notes}`,
|
|
120
|
+
android: `geo:0,0?q=${order?.business?.address_notes}`,
|
|
121
|
+
})}
|
|
122
|
+
shorcut={order?.business?.address_notes}
|
|
123
|
+
TextStyle={styles.textLink}
|
|
124
|
+
/>
|
|
125
|
+
</View>
|
|
126
|
+
)}
|
|
127
|
+
</OrderBusiness>
|
|
128
|
+
|
|
129
|
+
<OrderCustomer>
|
|
130
|
+
<OText style={{ marginBottom: 5 }} size={16} weight="600">
|
|
131
|
+
{t('CUSTOMER_DETAILS', 'Customer details')}
|
|
132
|
+
</OText>
|
|
133
|
+
|
|
134
|
+
<View style={{ flexDirection: 'row' }}>
|
|
135
|
+
<OText numberOfLines={2} mBottom={4}>
|
|
136
|
+
<OText
|
|
137
|
+
numberOfLines={1}
|
|
138
|
+
mBottom={4}
|
|
139
|
+
ellipsizeMode="tail"
|
|
140
|
+
space>
|
|
141
|
+
{order?.customer?.name}
|
|
142
|
+
</OText>
|
|
143
|
+
|
|
144
|
+
<OText
|
|
145
|
+
numberOfLines={1}
|
|
146
|
+
mBottom={4}
|
|
147
|
+
ellipsizeMode="tail"
|
|
148
|
+
space>
|
|
149
|
+
{order?.customer?.middle_name}
|
|
150
|
+
</OText>
|
|
151
|
+
|
|
152
|
+
<OText
|
|
153
|
+
numberOfLines={1}
|
|
154
|
+
mBottom={4}
|
|
155
|
+
ellipsizeMode="tail"
|
|
156
|
+
space>
|
|
157
|
+
{order?.customer?.lastname}
|
|
158
|
+
</OText>
|
|
159
|
+
|
|
160
|
+
<OText
|
|
161
|
+
numberOfLines={1}
|
|
162
|
+
mBottom={4}
|
|
163
|
+
ellipsizeMode="tail"
|
|
164
|
+
space>
|
|
165
|
+
{order?.customer?.second_lastname}
|
|
166
|
+
</OText>
|
|
167
|
+
</OText>
|
|
168
|
+
</View>
|
|
169
|
+
|
|
170
|
+
{!!order?.customer?.email && (
|
|
171
|
+
<View style={styles.linkWithIcons}>
|
|
172
|
+
<OLink
|
|
173
|
+
PressStyle={styles.linkWithIcons}
|
|
174
|
+
url={`mailto:${order?.customer?.email}`}
|
|
175
|
+
shorcut={order?.customer?.email}
|
|
176
|
+
TextStyle={styles.textLink}
|
|
177
|
+
|
|
178
|
+
/>
|
|
179
|
+
</View>
|
|
180
|
+
)}
|
|
181
|
+
|
|
182
|
+
{!!order?.customer?.cellphone && (
|
|
183
|
+
<View style={styles.linkWithIcons}>
|
|
184
|
+
<OLink
|
|
185
|
+
PressStyle={styles.linkWithIcons}
|
|
186
|
+
url={`tel:${order?.customer?.cellphone}`}
|
|
187
|
+
shorcut={order?.customer?.cellphone}
|
|
188
|
+
TextStyle={styles.textLink}
|
|
189
|
+
/>
|
|
190
|
+
</View>
|
|
191
|
+
)}
|
|
192
|
+
|
|
193
|
+
{!!order?.customer?.phone && (
|
|
194
|
+
<View style={styles.linkWithIcons}>
|
|
195
|
+
<OLink
|
|
196
|
+
PressStyle={styles.linkWithIcons}
|
|
197
|
+
url={`tel:${order?.customer?.phone}`}
|
|
198
|
+
shorcut={order?.customer?.phone}
|
|
199
|
+
TextStyle={styles.textLink}
|
|
200
|
+
/>
|
|
201
|
+
</View>
|
|
202
|
+
)}
|
|
203
|
+
|
|
204
|
+
{!!order?.customer?.address && (
|
|
205
|
+
<View style={styles.linkWithIcons}>
|
|
206
|
+
<OLink
|
|
207
|
+
PressStyle={styles.linkWithIcons}
|
|
208
|
+
url={Platform.select({
|
|
209
|
+
ios: `maps:0,0?q=${order?.customer?.address}`,
|
|
210
|
+
android: `geo:0,0?q=${order?.customer?.address}`,
|
|
211
|
+
})}
|
|
212
|
+
shorcut={order?.customer?.address}
|
|
213
|
+
TextStyle={styles.textLink}
|
|
214
|
+
/>
|
|
215
|
+
</View>
|
|
216
|
+
)}
|
|
217
|
+
|
|
218
|
+
{!!order?.customer?.internal_number && (
|
|
219
|
+
<OText numberOfLines={1} mBottom={4} ellipsizeMode="tail">
|
|
220
|
+
{order?.customer?.internal_number}
|
|
221
|
+
</OText>
|
|
222
|
+
)}
|
|
223
|
+
|
|
224
|
+
{!!order?.customer?.address_notes && (
|
|
225
|
+
<OText numberOfLines={1} mBottom={4} ellipsizeMode="tail">
|
|
226
|
+
{order?.customer?.address_notes}
|
|
227
|
+
</OText>
|
|
228
|
+
)}
|
|
229
|
+
|
|
230
|
+
{!!order?.customer.zipcode && (
|
|
231
|
+
<OText numberOfLines={1} mBottom={4} ellipsizeMode="tail">
|
|
232
|
+
{order?.customer?.zipcode}
|
|
233
|
+
</OText>
|
|
234
|
+
)}
|
|
235
|
+
</OrderCustomer>
|
|
236
|
+
|
|
237
|
+
<OrderProducts>
|
|
238
|
+
<OText style={{ marginBottom: 5 }} size={16} weight="600">
|
|
239
|
+
{t('ORDER_DETAILS', 'Order Details')}
|
|
240
|
+
</OText>
|
|
241
|
+
|
|
242
|
+
{order?.products?.length > 0 &&
|
|
243
|
+
order?.products.map((product: any, i: number) => (
|
|
244
|
+
<ProductItemAccordion
|
|
245
|
+
key={product?.id || i}
|
|
246
|
+
product={product}
|
|
247
|
+
/>
|
|
248
|
+
))}
|
|
249
|
+
</OrderProducts>
|
|
250
|
+
|
|
251
|
+
<OrderBill>
|
|
252
|
+
<Table>
|
|
253
|
+
<OText mBottom={4}>{t('SUBTOTAL', 'Subtotal')}</OText>
|
|
254
|
+
<OText mBottom={4}>
|
|
255
|
+
{parsePrice(
|
|
256
|
+
order.tax_type === 1
|
|
257
|
+
? order?.summary?.subtotal + order?.summary?.tax ?? 0
|
|
258
|
+
: order?.summary?.subtotal ?? 0,
|
|
259
|
+
)}
|
|
260
|
+
</OText>
|
|
261
|
+
</Table>
|
|
262
|
+
|
|
263
|
+
{order?.tax_type !== 1 && (
|
|
264
|
+
<Table>
|
|
265
|
+
<OText mBottom={4}>
|
|
266
|
+
{t('TAX', 'Tax')}
|
|
267
|
+
{`(${verifyDecimals(
|
|
268
|
+
order?.summary?.tax_rate,
|
|
269
|
+
parseNumber,
|
|
270
|
+
)}%)`}
|
|
271
|
+
</OText>
|
|
272
|
+
|
|
273
|
+
<OText mBottom={4}>
|
|
274
|
+
{parsePrice(order?.summary?.tax ?? 0)}
|
|
275
|
+
</OText>
|
|
276
|
+
</Table>
|
|
277
|
+
)}
|
|
278
|
+
|
|
279
|
+
{order?.summary?.discount > 0 && (
|
|
280
|
+
<Table>
|
|
281
|
+
{order?.offer_type === 1 ? (
|
|
282
|
+
<OText mBottom={4}>
|
|
283
|
+
<OText>{t('DISCOUNT', 'Discount')}</OText>
|
|
284
|
+
|
|
285
|
+
<OText>
|
|
286
|
+
{`(${verifyDecimals(
|
|
287
|
+
order?.offer_rate,
|
|
288
|
+
parsePrice,
|
|
289
|
+
)}%)`}
|
|
290
|
+
</OText>
|
|
291
|
+
</OText>
|
|
292
|
+
) : (
|
|
293
|
+
<OText mBottom={4}>{t('DISCOUNT', 'Discount')}</OText>
|
|
294
|
+
)}
|
|
295
|
+
|
|
296
|
+
<OText mBottom={4}>
|
|
297
|
+
- {parsePrice(order?.summary?.discount)}
|
|
298
|
+
</OText>
|
|
299
|
+
</Table>
|
|
300
|
+
)}
|
|
301
|
+
|
|
302
|
+
{order?.summary?.subtotal_with_discount > 0 &&
|
|
303
|
+
order?.summary?.discount > 0 &&
|
|
304
|
+
order?.summary?.total >= 0 && (
|
|
305
|
+
<Table>
|
|
306
|
+
<OText mBottom={4}>
|
|
307
|
+
{t(
|
|
308
|
+
'SUBTOTAL_WITH_DISCOUNT',
|
|
309
|
+
'Subtotal with discount',
|
|
310
|
+
)}
|
|
311
|
+
</OText>
|
|
312
|
+
{order?.tax_type === 1 ? (
|
|
313
|
+
<OText mBottom={4}>
|
|
314
|
+
{parsePrice(
|
|
315
|
+
order?.summary?.subtotal_with_discount +
|
|
316
|
+
order?.summary?.tax ?? 0,
|
|
317
|
+
)}
|
|
318
|
+
</OText>
|
|
319
|
+
) : (
|
|
320
|
+
<OText mBottom={4}>
|
|
321
|
+
{parsePrice(
|
|
322
|
+
order?.summary?.subtotal_with_discount ?? 0,
|
|
323
|
+
)}
|
|
324
|
+
</OText>
|
|
325
|
+
)}
|
|
326
|
+
</Table>
|
|
327
|
+
)}
|
|
328
|
+
|
|
329
|
+
{order?.summary?.delivery_price > 0 && (
|
|
330
|
+
<Table>
|
|
331
|
+
<OText mBottom={4}>
|
|
332
|
+
{t('DELIVERY_FEE', 'Delivery Fee')}
|
|
333
|
+
</OText>
|
|
334
|
+
|
|
335
|
+
<OText mBottom={4}>
|
|
336
|
+
{parsePrice(order?.summary?.delivery_price)}
|
|
337
|
+
</OText>
|
|
338
|
+
</Table>
|
|
339
|
+
)}
|
|
340
|
+
|
|
341
|
+
<Table>
|
|
342
|
+
<OText mBottom={4}>
|
|
343
|
+
{t('DRIVER_TIP', 'Driver tip')}{' '}
|
|
344
|
+
{order?.summary?.driver_tip > 0 &&
|
|
345
|
+
parseInt(configs?.driver_tip_type?.value, 10) === 2 &&
|
|
346
|
+
!parseInt(configs?.driver_tip_use_custom?.value, 10) &&
|
|
347
|
+
`(${verifyDecimals(
|
|
348
|
+
order?.summary?.driver_tip,
|
|
349
|
+
parseNumber,
|
|
350
|
+
)}%)`}
|
|
351
|
+
</OText>
|
|
352
|
+
|
|
353
|
+
<OText mBottom={4}>
|
|
354
|
+
{parsePrice(order?.summary?.driver_tip ?? 0)}
|
|
355
|
+
</OText>
|
|
356
|
+
</Table>
|
|
357
|
+
|
|
358
|
+
{order?.summary?.service_fee > 0 && (
|
|
359
|
+
<Table>
|
|
360
|
+
<OText mBottom={4}>
|
|
361
|
+
{t('SERVICE_FEE', 'Service Fee')}{' '}
|
|
362
|
+
{`(${verifyDecimals(
|
|
363
|
+
order?.summary?.service_fee,
|
|
364
|
+
parseNumber,
|
|
365
|
+
)}%)`}
|
|
366
|
+
</OText>
|
|
367
|
+
|
|
368
|
+
<OText mBottom={4}>
|
|
369
|
+
{parsePrice(order?.summary?.service_fee)}
|
|
370
|
+
</OText>
|
|
371
|
+
</Table>
|
|
372
|
+
)}
|
|
373
|
+
|
|
374
|
+
<Total>
|
|
375
|
+
<Table>
|
|
376
|
+
<OText mBottom={4} style={styles.textBold}>
|
|
377
|
+
{t('TOTAL', 'Total')}
|
|
378
|
+
</OText>
|
|
379
|
+
|
|
380
|
+
<OText
|
|
381
|
+
mBottom={4}
|
|
382
|
+
style={styles.textBold}
|
|
383
|
+
color={theme.colors.primary}>
|
|
384
|
+
{parsePrice(order?.summary?.total ?? 0)}
|
|
385
|
+
</OText>
|
|
386
|
+
</Table>
|
|
387
|
+
</Total>
|
|
388
|
+
</OrderBill>
|
|
389
|
+
</OrderContent>
|
|
390
|
+
)
|
|
391
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
//Styles
|
|
4
|
+
import {
|
|
5
|
+
Actions,
|
|
6
|
+
Header,
|
|
7
|
+
OrderHeader,
|
|
8
|
+
} from './styles';
|
|
9
|
+
|
|
10
|
+
//Components
|
|
11
|
+
import {
|
|
12
|
+
OIconButton,
|
|
13
|
+
OText,
|
|
14
|
+
} from '../shared'
|
|
15
|
+
|
|
16
|
+
import { useTheme } from 'styled-components/native';
|
|
17
|
+
import { StyleSheet } from 'react-native';
|
|
18
|
+
|
|
19
|
+
import {
|
|
20
|
+
useLanguage,
|
|
21
|
+
useUtils,
|
|
22
|
+
} from 'ordering-components/native';
|
|
23
|
+
|
|
24
|
+
interface OrderHeader {
|
|
25
|
+
order?: any,
|
|
26
|
+
handleArrowBack?: any,
|
|
27
|
+
handleOpenMapView?: any,
|
|
28
|
+
handleOpenMessagesForBusiness?: any,
|
|
29
|
+
getOrderStatus?: any
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
33
|
+
const { order, handleArrowBack, handleOpenMapView, handleOpenMessagesForBusiness, getOrderStatus } = props
|
|
34
|
+
const theme = useTheme();
|
|
35
|
+
const [, t] = useLanguage();
|
|
36
|
+
const [{ parseDate }] = useUtils();
|
|
37
|
+
|
|
38
|
+
const styles = StyleSheet.create({
|
|
39
|
+
icons: {
|
|
40
|
+
maxWidth: 40,
|
|
41
|
+
height: 25,
|
|
42
|
+
alignItems: 'flex-end',
|
|
43
|
+
},
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
const colors: any = {
|
|
47
|
+
//BLUE
|
|
48
|
+
0: theme.colors.statusOrderBlue,
|
|
49
|
+
3: theme.colors.statusOrderBlue,
|
|
50
|
+
4: theme.colors.statusOrderBlue,
|
|
51
|
+
7: theme.colors.statusOrderBlue,
|
|
52
|
+
8: theme.colors.statusOrderBlue,
|
|
53
|
+
9: theme.colors.statusOrderBlue,
|
|
54
|
+
13: theme.colors.statusOrderBlue,
|
|
55
|
+
14: theme.colors.statusOrderBlue,
|
|
56
|
+
18: theme.colors.statusOrderBlue,
|
|
57
|
+
19: theme.colors.statusOrderBlue,
|
|
58
|
+
20: theme.colors.statusOrderBlue,
|
|
59
|
+
21: theme.colors.statusOrderBlue,
|
|
60
|
+
//GREEN
|
|
61
|
+
1: theme.colors.statusOrderGreen,
|
|
62
|
+
11: theme.colors.statusOrderGreen,
|
|
63
|
+
15: theme.colors.statusOrderGreen,
|
|
64
|
+
//RED
|
|
65
|
+
2: theme.colors.statusOrderRed,
|
|
66
|
+
5: theme.colors.statusOrderRed,
|
|
67
|
+
6: theme.colors.statusOrderRed,
|
|
68
|
+
10: theme.colors.statusOrderRed,
|
|
69
|
+
12: theme.colors.statusOrderRed,
|
|
70
|
+
16: theme.colors.statusOrderRed,
|
|
71
|
+
17: theme.colors.statusOrderRed,
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
return (
|
|
75
|
+
<>
|
|
76
|
+
<Header>
|
|
77
|
+
<OIconButton
|
|
78
|
+
icon={theme.images.general.arrow_left}
|
|
79
|
+
iconStyle={{ width: 20, height: 20 }}
|
|
80
|
+
borderColor={theme.colors.clear}
|
|
81
|
+
style={{ ...styles.icons, justifyContent: 'flex-end' }}
|
|
82
|
+
onClick={() => handleArrowBack()}
|
|
83
|
+
/>
|
|
84
|
+
|
|
85
|
+
<Actions>
|
|
86
|
+
<OIconButton
|
|
87
|
+
icon={theme.images.general.map}
|
|
88
|
+
iconStyle={{
|
|
89
|
+
width: 20,
|
|
90
|
+
height: 20,
|
|
91
|
+
tintColor: theme.colors.backArrow,
|
|
92
|
+
}}
|
|
93
|
+
borderColor={theme.colors.clear}
|
|
94
|
+
style={styles.icons}
|
|
95
|
+
onClick={() => handleOpenMapView()}
|
|
96
|
+
/>
|
|
97
|
+
|
|
98
|
+
<OIconButton
|
|
99
|
+
icon={theme.images.general.messages}
|
|
100
|
+
iconStyle={{
|
|
101
|
+
width: 20,
|
|
102
|
+
height: 20,
|
|
103
|
+
tintColor: theme.colors.backArrow,
|
|
104
|
+
}}
|
|
105
|
+
borderColor={theme.colors.clear}
|
|
106
|
+
style={styles.icons}
|
|
107
|
+
onClick={() => handleOpenMessagesForBusiness()}
|
|
108
|
+
/>
|
|
109
|
+
</Actions>
|
|
110
|
+
</Header>
|
|
111
|
+
<OrderHeader>
|
|
112
|
+
<OText size={13} style={{ marginBottom: 5 }}>
|
|
113
|
+
{order?.delivery_datetime_utc
|
|
114
|
+
? parseDate(order?.delivery_datetime_utc)
|
|
115
|
+
: parseDate(order?.delivery_datetime, { utc: false })}
|
|
116
|
+
</OText>
|
|
117
|
+
|
|
118
|
+
<OText numberOfLines={2} size={20} weight="600">
|
|
119
|
+
<>
|
|
120
|
+
{`${t('INVOICE_ORDER_NO', 'Order No.')} ${order.id} ${t(
|
|
121
|
+
'IS',
|
|
122
|
+
'is',
|
|
123
|
+
)} `}
|
|
124
|
+
<OText
|
|
125
|
+
size={20}
|
|
126
|
+
weight="600"
|
|
127
|
+
color={colors[order?.status] || theme.colors.primary}>
|
|
128
|
+
{getOrderStatus(order?.status, t)?.value}
|
|
129
|
+
</OText>
|
|
130
|
+
</>
|
|
131
|
+
</OText>
|
|
132
|
+
<OText size={13}>
|
|
133
|
+
{`${order?.paymethod?.name} - ${
|
|
134
|
+
order.delivery_type === 1
|
|
135
|
+
? t('DELIVERY', 'Delivery')
|
|
136
|
+
: order.delivery_type === 2
|
|
137
|
+
? t('PICKUP', 'Pickup')
|
|
138
|
+
: order.delivery_type === 3
|
|
139
|
+
? t('EAT_IN', 'Eat in')
|
|
140
|
+
: order.delivery_type === 4
|
|
141
|
+
? t('CURBSIDE', 'Curbside')
|
|
142
|
+
: t('DRIVER_THRU', 'Driver thru')
|
|
143
|
+
}`}
|
|
144
|
+
</OText>
|
|
145
|
+
</OrderHeader>
|
|
146
|
+
</>
|
|
147
|
+
)
|
|
148
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import styled from 'styled-components/native';
|
|
2
|
+
|
|
3
|
+
export const OrderDetailsContainer = styled.ScrollView`
|
|
4
|
+
flex: 1;
|
|
5
|
+
`;
|
|
6
|
+
|
|
7
|
+
export const Pickup = styled.View`
|
|
8
|
+
padding-vertical: 10px;
|
|
9
|
+
margin-bottom: 20px;
|
|
10
|
+
`;
|
|
11
|
+
|
|
12
|
+
export const Header = styled.View`
|
|
13
|
+
flex-direction: row;
|
|
14
|
+
justify-content: space-between;
|
|
15
|
+
`;
|
|
16
|
+
|
|
17
|
+
export const Actions = styled.View`
|
|
18
|
+
flex-direction: row;
|
|
19
|
+
justify-content: flex-end;
|
|
20
|
+
`;
|
|
21
|
+
|
|
22
|
+
export const Logo = styled.View`
|
|
23
|
+
margin-right: 20px;
|
|
24
|
+
`;
|
|
25
|
+
|
|
26
|
+
export const OrderContent = styled.View`
|
|
27
|
+
flex: 1;
|
|
28
|
+
`;
|
|
29
|
+
|
|
30
|
+
export const OrderHeader = styled.View`
|
|
31
|
+
padding-vertical: 20px;
|
|
32
|
+
border-bottom-width: 10px;
|
|
33
|
+
border-bottom-color: ${(props: any) => props.theme.colors.inputChat};
|
|
34
|
+
`;
|
|
35
|
+
|
|
36
|
+
export const OrderBusiness = styled.View`
|
|
37
|
+
position: relative;
|
|
38
|
+
bottom: 10px;
|
|
39
|
+
padding-vertical: 20px;
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
border-bottom-width: 10px;
|
|
42
|
+
border-bottom-color: ${(props: any) => props.theme.colors.inputChat};
|
|
43
|
+
align-items: flex-start;
|
|
44
|
+
`;
|
|
45
|
+
|
|
46
|
+
export const OrderCustomer = styled.View`
|
|
47
|
+
border-bottom-width: 10px;
|
|
48
|
+
border-bottom-color: ${(props: any) => props.theme.colors.inputChat};
|
|
49
|
+
padding-vertical: 20px;
|
|
50
|
+
`;
|
|
51
|
+
|
|
52
|
+
export const OrderProducts = styled(OrderCustomer)``;
|
|
53
|
+
|
|
54
|
+
export const Table = styled.View`
|
|
55
|
+
flex-direction: row;
|
|
56
|
+
justify-content: space-between;
|
|
57
|
+
flex: 1;
|
|
58
|
+
align-items: center;
|
|
59
|
+
`;
|
|
60
|
+
|
|
61
|
+
export const OrderBill = styled.View`
|
|
62
|
+
padding-vertical: 20px;
|
|
63
|
+
flex: 1;
|
|
64
|
+
`;
|
|
65
|
+
|
|
66
|
+
export const Total = styled.View`
|
|
67
|
+
border-top-width: 1px;
|
|
68
|
+
border-top-color: ${(props: any) => props.theme.colors.borderTops};
|
|
69
|
+
padding-vertical: 10px;
|
|
70
|
+
`;
|
|
71
|
+
|
|
72
|
+
export const DriverItem = styled.View`
|
|
73
|
+
padding: 15px;
|
|
74
|
+
justify-content: space-between;
|
|
75
|
+
align-items: center;
|
|
76
|
+
flex-direction: row;
|
|
77
|
+
justify-content: ${(props: any) =>
|
|
78
|
+
props?.justifyContent ? props?.justifyContent : 'flex-start'};
|
|
79
|
+
`;
|
|
80
|
+
|
|
81
|
+
export const AssignDriver = styled.View`
|
|
82
|
+
padding-vertical: 10px;
|
|
83
|
+
margin-bottom: 10px;
|
|
84
|
+
`;
|