ordering-ui-react-native 0.12.41 → 0.12.45

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 (59) hide show
  1. package/package.json +1 -1
  2. package/src/components/AppleLogin/index.tsx +145 -0
  3. package/src/components/AppleLogin/styles.tsx +22 -0
  4. package/src/components/BusinessesListing/index.tsx +1 -1
  5. package/src/components/Cart/index.tsx +64 -31
  6. package/src/components/LoginForm/index.tsx +34 -17
  7. package/src/components/OrderDetails/index.tsx +90 -35
  8. package/src/components/OrderSummary/index.tsx +59 -27
  9. package/src/components/OrderSummary/styles.tsx +6 -0
  10. package/src/components/SignupForm/index.tsx +52 -35
  11. package/src/components/SingleProductCard/index.tsx +1 -1
  12. package/src/components/TaxInformation/index.tsx +51 -0
  13. package/src/components/TaxInformation/styles.tsx +9 -0
  14. package/src/components/UserFormDetails/index.tsx +0 -2
  15. package/src/navigators/BottomNavigator.tsx +1 -1
  16. package/src/types/index.tsx +7 -1
  17. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +2 -2
  18. package/themes/doordash/src/components/Cart/index.tsx +55 -22
  19. package/themes/doordash/src/components/OrderDetails/index.tsx +444 -386
  20. package/themes/doordash/src/components/OrderSummary/index.tsx +252 -221
  21. package/themes/doordash/src/components/OrderSummary/styles.tsx +6 -0
  22. package/themes/doordash/src/components/SingleProductCard/index.tsx +1 -1
  23. package/themes/doordash/src/components/TaxInformation/index.tsx +51 -0
  24. package/themes/doordash/src/components/TaxInformation/styles.tsx +9 -0
  25. package/themes/franchises/src/components/Cart/index.tsx +55 -23
  26. package/themes/franchises/src/components/OrderDetails/index.tsx +77 -23
  27. package/themes/franchises/src/components/OrderSummary/index.tsx +58 -24
  28. package/themes/franchises/src/components/OrderSummary/styles.tsx +6 -0
  29. package/themes/franchises/src/components/SingleProductCard/index.tsx +1 -1
  30. package/themes/franchises/src/components/TaxInformation/index.tsx +51 -0
  31. package/themes/franchises/src/components/TaxInformation/styles.tsx +9 -0
  32. package/themes/instacart/src/components/Cart/index.tsx +57 -17
  33. package/themes/instacart/src/components/OrderDetails/index.tsx +490 -433
  34. package/themes/instacart/src/components/OrderSummary/index.tsx +236 -194
  35. package/themes/instacart/src/components/OrderSummary/styles.tsx +6 -0
  36. package/themes/instacart/src/components/SingleProductCard/index.tsx +2 -2
  37. package/themes/instacart/src/components/TaxInformation/index.tsx +51 -0
  38. package/themes/instacart/src/components/TaxInformation/styles.tsx +9 -0
  39. package/themes/original/src/components/Cart/index.tsx +55 -13
  40. package/themes/original/src/components/OrderDetails/index.tsx +76 -23
  41. package/themes/original/src/components/OrderSummary/index.tsx +208 -173
  42. package/themes/original/src/components/OrderSummary/styles.tsx +6 -0
  43. package/themes/original/src/components/SingleProductCard/index.tsx +1 -1
  44. package/themes/original/src/components/TaxInformation/index.tsx +51 -0
  45. package/themes/original/src/components/TaxInformation/styles.tsx +9 -0
  46. package/themes/single-business/src/components/Cart/index.tsx +57 -24
  47. package/themes/single-business/src/components/OrderDetails/index.tsx +77 -23
  48. package/themes/single-business/src/components/OrderSummary/index.tsx +58 -24
  49. package/themes/single-business/src/components/OrderSummary/styles.tsx +6 -0
  50. package/themes/single-business/src/components/SingleProductCard/index.tsx +1 -1
  51. package/themes/single-business/src/components/TaxInformation/index.tsx +51 -0
  52. package/themes/single-business/src/components/TaxInformation/styles.tsx +9 -0
  53. package/themes/uber-eats/src/components/Cart/index.tsx +56 -14
  54. package/themes/uber-eats/src/components/OrderDetails/index.tsx +81 -22
  55. package/themes/uber-eats/src/components/OrderSummary/index.tsx +56 -23
  56. package/themes/uber-eats/src/components/OrderSummary/styles.tsx +6 -0
  57. package/themes/uber-eats/src/components/SingleProductCard/index.tsx +1 -1
  58. package/themes/uber-eats/src/components/TaxInformation/index.tsx +51 -0
  59. package/themes/uber-eats/src/components/TaxInformation/styles.tsx +9 -0
@@ -4,30 +4,30 @@ import Spinner from 'react-native-loading-spinner-overlay'
4
4
  import LinearGradient from 'react-native-linear-gradient'
5
5
  import { Messages } from '../Messages'
6
6
  import {
7
- useLanguage,
8
- OrderDetails as OrderDetailsConTableoller,
9
- useUtils,
10
- useConfig,
11
- useSession,
12
- useOrder
7
+ useLanguage,
8
+ OrderDetails as OrderDetailsConTableoller,
9
+ useUtils,
10
+ useConfig,
11
+ useSession,
12
+ useOrder
13
13
  } from 'ordering-components/native'
14
14
  import {
15
- OrderDetailsContainer,
16
- Header,
17
- OrderContent,
18
- OrderBusiness,
19
- OrderData,
20
- OrderInfo,
21
- StatusBar,
22
- OrderCustomer,
23
- Customer,
24
- OrderProducts,
25
- Table,
26
- OrderBill,
27
- Total,
28
- Icons,
29
- OrderDriver,
30
- Map
15
+ OrderDetailsContainer,
16
+ Header,
17
+ OrderContent,
18
+ OrderBusiness,
19
+ OrderData,
20
+ OrderInfo,
21
+ StatusBar,
22
+ OrderCustomer,
23
+ Customer,
24
+ OrderProducts,
25
+ Table,
26
+ OrderBill,
27
+ Total,
28
+ Icons,
29
+ OrderDriver,
30
+ Map
31
31
  } from './styles'
32
32
  import { OButton, OIcon, OModal, OText } from '../shared'
33
33
  import { useTheme } from 'styled-components/native'
@@ -38,182 +38,197 @@ import { GoogleMap } from '../GoogleMap'
38
38
  import { verifyDecimals } from '../../utils'
39
39
  import moment from 'moment'
40
40
  import SocialShareFav from '../SocialShare'
41
+ import { OSRow } from '../OrderSummary/styles'
42
+ import { TaxInformation } from '../TaxInformation';
43
+ import AntIcon from 'react-native-vector-icons/AntDesign'
41
44
 
42
45
  export const OrderDetailsUI = (props: OrderDetailsParams) => {
43
46
 
44
- const {
45
- navigation,
46
- messages,
47
- setMessages,
48
- readMessages,
49
- messagesReadList,
50
- isFromCheckout,
51
- isFromRoot,
52
- driverLocation,
53
- goToBusinessList
54
- } = props
55
-
56
- const theme = useTheme();
57
-
58
- const styles = StyleSheet.create({
59
- rowDirection: {
60
- flexDirection: 'row'
61
- },
62
- statusBar: {
63
- transform: [{ scaleX: I18nManager.isRTL ? -1 : 1 }],
64
- height: 6,
65
- borderRadius: 6
66
- },
67
- logo: {
68
- width: 75,
69
- height: 75,
70
- borderRadius: 10
71
- },
72
- textBold: {
73
- fontWeight: 'bold'
74
- },
75
- btnBackArrow: {
76
- borderWidth: 0,
77
- backgroundColor: theme.colors.clear,
78
- borderColor: theme.colors.clear,
79
- shadowColor: theme.colors.clear,
80
- alignItems: 'flex-start',
81
- justifyContent: 'flex-start',
82
- paddingLeft: 10,
83
- marginStart: -10,
84
- height: 30,
85
- width: 50
86
- },
87
- })
88
-
89
- const [, t] = useLanguage()
90
- const [{ parsePrice, parseNumber, parseDate }] = useUtils()
91
- const [{ user }] = useSession()
92
- const [{ configs }] = useConfig()
93
- const [, { refreshOrderOptions }] = useOrder()
94
- const [openModalForBusiness, setOpenModalForBusiness] = useState(false)
95
- const [openModalForDriver, setOpenModalForDriver] = useState(false)
96
- const [unreadAlert, setUnreadAlert] = useState({ business: false, driver: false })
97
- const { order, businessData } = props.order
98
-
99
-
100
- const getOrderStatus = (s: string) => {
101
- const status = parseInt(s)
102
- const orderStatus = [
103
- { key: 0, value: t('PENDING', 'Pending'), slug: 'PENDING', percentage: 0.25, image: theme.images.order.status0 },
104
- { key: 1, value: t('COMPLETED', 'Completed'), slug: 'COMPLETED', percentage: 1, image: theme.images.order.status1 },
105
- { key: 2, value: t('REJECTED', 'Rejected'), slug: 'REJECTED', percentage: 0, image: theme.images.order.status2 },
106
- { key: 3, value: t('DRIVER_IN_BUSINESS', 'Driver in business'), slug: 'DRIVER_IN_BUSINESS', percentage: 0.60, image: theme.images.order.status3 },
107
- { key: 4, value: t('PREPARATION_COMPLETED', 'Preparation Completed'), slug: 'PREPARATION_COMPLETED', percentage: 0.70, image: theme.images.order.status4 },
108
- { key: 5, value: t('REJECTED_BY_BUSINESS', 'Rejected by business'), slug: 'REJECTED_BY_BUSINESS', percentage: 0, image: theme.images.order.status5 },
109
- { key: 6, value: t('REJECTED_BY_DRIVER', 'Rejected by Driver'), slug: 'REJECTED_BY_DRIVER', percentage: 0, image: theme.images.order.status6 },
110
- { key: 7, value: t('ACCEPTED_BY_BUSINESS', 'Accepted by business'), slug: 'ACCEPTED_BY_BUSINESS', percentage: 0.35, image: theme.images.order.status7 },
111
- { key: 8, value: t('ACCEPTED_BY_DRIVER', 'Accepted by driver'), slug: 'ACCEPTED_BY_DRIVER', percentage: 0.45, image: theme.images.order.status8 },
112
- { key: 9, value: t('PICK_UP_COMPLETED_BY_DRIVER', 'Pick up completed by driver'), slug: 'PICK_UP_COMPLETED_BY_DRIVER', percentage: 0.80, image: theme.images.order.status9 },
113
- { key: 10, value: t('PICK_UP_FAILED_BY_DRIVER', 'Pick up Failed by driver'), slug: 'PICK_UP_FAILED_BY_DRIVER', percentage: 0, image: theme.images.order.status10 },
114
- { key: 11, value: t('DELIVERY_COMPLETED_BY_DRIVER', 'Delivery completed by driver'), slug: 'DELIVERY_COMPLETED_BY_DRIVER', percentage: 1, image: theme.images.order.status11 },
115
- { key: 12, value: t('DELIVERY_FAILED_BY_DRIVER', 'Delivery Failed by driver'), slug: 'DELIVERY_FAILED_BY_DRIVER', percentage: 0, image: theme.images.order.status12 },
116
- { key: 13, value: t('PREORDER', 'PreOrder'), slug: 'PREORDER', percentage: 0, image: theme.images.order.status13 },
117
- { key: 14, value: t('ORDER_NOT_READY', 'Order not ready'), slug: 'ORDER_NOT_READY', percentage: 0, image: theme.images.order.status14 },
118
- { key: 15, value: t('ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER', 'Order picked up completed by customer'), slug: 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER', percentage: 100, image: theme.images.order.status15 },
119
- { key: 16, value: t('CANCELLED_BY_CUSTOMER', 'Cancelled by customer'), slug: 'CANCELLED_BY_CUSTOMER', percentage: 0, image: theme.images.order.status16 },
120
- { key: 17, value: t('ORDER_NOT_PICKEDUP_BY_CUSTOMER', 'Order not picked up by customer'), slug: 'ORDER_NOT_PICKEDUP_BY_CUSTOMER', percentage: 0, image: theme.images.order.status17 },
121
- { key: 18, value: t('DRIVER_ALMOST_ARRIVED_TO_BUSINESS', 'Driver almost arrived to business'), slug: 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS', percentage: 0.15, image: theme.images.order.status18 },
122
- { key: 19, value: t('DRIVER_ALMOST_ARRIVED_TO_CUSTOMER', 'Driver almost arrived to customer'), slug: 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER', percentage: 0.90, image: theme.images.order.status19 },
123
- { key: 20, value: t('ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', 'Customer almost arrived to business'), slug: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', percentage: 90, image: theme.images.order.status20 },
124
- { key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Customer arrived to business'), slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS', percentage: 95, image: theme.images.order.status21 }
125
- ]
126
-
127
-
128
- const objectStatus = orderStatus.find((o) => o.key === status)
129
-
130
- return objectStatus && objectStatus
131
- }
132
-
133
- const handleOpenMessagesForBusiness = () => {
134
- setOpenModalForBusiness(true)
135
- readMessages && readMessages()
136
- setUnreadAlert({ ...unreadAlert, business: false })
137
- }
138
-
139
- const handleOpenMessagesForDriver = () => {
140
- setOpenModalForDriver(true)
141
- readMessages && readMessages()
142
- setUnreadAlert({ ...unreadAlert, driver: false })
143
- }
144
-
145
- const unreadMessages = () => {
146
- const length = messages?.messages.length
147
- const unreadLength = order?.unread_count
148
- const unreadedMessages = messages.messages.slice(length - unreadLength, length)
149
- const business = unreadedMessages.some((message: any) => message?.can_see?.includes(2))
150
- const driver = unreadedMessages.some((message: any) => message?.can_see?.includes(4))
151
- setUnreadAlert({ business, driver })
152
- }
153
-
154
- const handleCloseModal = () => {
155
- setOpenModalForBusiness(false)
156
- setOpenModalForDriver(false)
157
- }
158
-
159
- const handleArrowBack: any = () => {
160
- if ((!isFromCheckout && !goToBusinessList) || isFromRoot) {
161
- navigation?.canGoBack() && navigation.goBack();
162
- return
163
- }
164
- if (goToBusinessList) {
165
- refreshOrderOptions()
166
- }
167
- navigation.navigate('BottomTab');
168
- }
169
-
170
- const handleCallToDriver = () => {
171
-
172
- }
173
-
174
- const handleShareDelivery = () => {
175
-
176
- }
177
-
178
- useEffect(() => {
179
- BackHandler.addEventListener('hardwareBackPress', handleArrowBack);
180
- return () => {
181
- BackHandler.removeEventListener('hardwareBackPress', handleArrowBack);
182
- }
183
- }, [])
184
-
185
- useEffect(() => {
186
- if (messagesReadList?.length) {
187
- openModalForBusiness ? setUnreadAlert({ ...unreadAlert, business: false }) : setUnreadAlert({ ...unreadAlert, driver: false })
188
- }
189
- }, [messagesReadList])
190
-
191
- const locations = [
192
- { ...order?.driver?.location, title: t('DRIVER', 'Driver'), icon: order?.driver?.photo || 'https://res.cloudinary.com/demo/image/fetch/c_thumb,g_face,r_max/https://www.freeiconspng.com/thumbs/driver-icon/driver-icon-14.png' },
193
- { ...order?.business?.location, title: order?.business?.name, icon: order?.business?.logo || theme.images.dummies.businessLogo },
194
- { ...order?.customer?.location, title: t('YOUR_LOCATION', 'Your Location'), icon: order?.customer?.photo || 'https://res.cloudinary.com/demo/image/upload/c_thumb,g_face,r_max/d_avatar.png/non_existing_id.png' }
195
- ]
196
-
197
- useEffect(() => {
198
- if (driverLocation) {
199
- locations[0] = driverLocation
200
- }
201
- }, [driverLocation])
202
-
203
- return (
204
- <OrderDetailsContainer keyboardShouldPersistTaps='handled' showsVerticalScrollIndicator={false} contentContainerStyle={{ paddingHorizontal: 40 }}>
205
- <Spinner visible={!order || Object.keys(order).length === 0} />
206
- {order && Object.keys(order).length > 0 && (
207
- <>
208
- <Header>
209
- <OButton
210
- imgLeftSrc={theme.images.general.close}
211
- imgRightSrc={null}
212
- style={styles.btnBackArrow}
213
- onClick={() => handleArrowBack()}
214
- imgLeftStyle={{ tintColor: theme.colors.textPrimary, width: 16 }}
215
- />
216
- {/* <HeaderInfo>
47
+ const {
48
+ navigation,
49
+ messages,
50
+ setMessages,
51
+ readMessages,
52
+ messagesReadList,
53
+ isFromCheckout,
54
+ isFromRoot,
55
+ driverLocation,
56
+ goToBusinessList
57
+ } = props
58
+
59
+ const theme = useTheme();
60
+
61
+ const styles = StyleSheet.create({
62
+ rowDirection: {
63
+ flexDirection: 'row'
64
+ },
65
+ statusBar: {
66
+ transform: [{ scaleX: I18nManager.isRTL ? -1 : 1 }],
67
+ height: 6,
68
+ borderRadius: 6
69
+ },
70
+ logo: {
71
+ width: 75,
72
+ height: 75,
73
+ borderRadius: 10
74
+ },
75
+ textBold: {
76
+ fontWeight: 'bold'
77
+ },
78
+ btnBackArrow: {
79
+ borderWidth: 0,
80
+ backgroundColor: theme.colors.clear,
81
+ borderColor: theme.colors.clear,
82
+ shadowColor: theme.colors.clear,
83
+ alignItems: 'flex-start',
84
+ justifyContent: 'flex-start',
85
+ paddingLeft: 10,
86
+ marginStart: -10,
87
+ height: 30,
88
+ width: 50
89
+ },
90
+ })
91
+
92
+ const [, t] = useLanguage()
93
+ const [{ parsePrice, parseNumber, parseDate }] = useUtils()
94
+ const [{ user }] = useSession()
95
+ const [{ configs }] = useConfig()
96
+ const [, { refreshOrderOptions }] = useOrder()
97
+ const [openModalForBusiness, setOpenModalForBusiness] = useState(false)
98
+ const [openModalForDriver, setOpenModalForDriver] = useState(false)
99
+ const [unreadAlert, setUnreadAlert] = useState({ business: false, driver: false })
100
+ const [openTaxModal, setOpenTaxModal] = useState<any>({ open: false, data: null })
101
+
102
+ const { order, businessData } = props.order
103
+
104
+
105
+ const getOrderStatus = (s: string) => {
106
+ const status = parseInt(s)
107
+ const orderStatus = [
108
+ { key: 0, value: t('PENDING', 'Pending'), slug: 'PENDING', percentage: 0.25, image: theme.images.order.status0 },
109
+ { key: 1, value: t('COMPLETED', 'Completed'), slug: 'COMPLETED', percentage: 1, image: theme.images.order.status1 },
110
+ { key: 2, value: t('REJECTED', 'Rejected'), slug: 'REJECTED', percentage: 0, image: theme.images.order.status2 },
111
+ { key: 3, value: t('DRIVER_IN_BUSINESS', 'Driver in business'), slug: 'DRIVER_IN_BUSINESS', percentage: 0.60, image: theme.images.order.status3 },
112
+ { key: 4, value: t('PREPARATION_COMPLETED', 'Preparation Completed'), slug: 'PREPARATION_COMPLETED', percentage: 0.70, image: theme.images.order.status4 },
113
+ { key: 5, value: t('REJECTED_BY_BUSINESS', 'Rejected by business'), slug: 'REJECTED_BY_BUSINESS', percentage: 0, image: theme.images.order.status5 },
114
+ { key: 6, value: t('REJECTED_BY_DRIVER', 'Rejected by Driver'), slug: 'REJECTED_BY_DRIVER', percentage: 0, image: theme.images.order.status6 },
115
+ { key: 7, value: t('ACCEPTED_BY_BUSINESS', 'Accepted by business'), slug: 'ACCEPTED_BY_BUSINESS', percentage: 0.35, image: theme.images.order.status7 },
116
+ { key: 8, value: t('ACCEPTED_BY_DRIVER', 'Accepted by driver'), slug: 'ACCEPTED_BY_DRIVER', percentage: 0.45, image: theme.images.order.status8 },
117
+ { key: 9, value: t('PICK_UP_COMPLETED_BY_DRIVER', 'Pick up completed by driver'), slug: 'PICK_UP_COMPLETED_BY_DRIVER', percentage: 0.80, image: theme.images.order.status9 },
118
+ { key: 10, value: t('PICK_UP_FAILED_BY_DRIVER', 'Pick up Failed by driver'), slug: 'PICK_UP_FAILED_BY_DRIVER', percentage: 0, image: theme.images.order.status10 },
119
+ { key: 11, value: t('DELIVERY_COMPLETED_BY_DRIVER', 'Delivery completed by driver'), slug: 'DELIVERY_COMPLETED_BY_DRIVER', percentage: 1, image: theme.images.order.status11 },
120
+ { key: 12, value: t('DELIVERY_FAILED_BY_DRIVER', 'Delivery Failed by driver'), slug: 'DELIVERY_FAILED_BY_DRIVER', percentage: 0, image: theme.images.order.status12 },
121
+ { key: 13, value: t('PREORDER', 'PreOrder'), slug: 'PREORDER', percentage: 0, image: theme.images.order.status13 },
122
+ { key: 14, value: t('ORDER_NOT_READY', 'Order not ready'), slug: 'ORDER_NOT_READY', percentage: 0, image: theme.images.order.status14 },
123
+ { key: 15, value: t('ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER', 'Order picked up completed by customer'), slug: 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER', percentage: 100, image: theme.images.order.status15 },
124
+ { key: 16, value: t('CANCELLED_BY_CUSTOMER', 'Cancelled by customer'), slug: 'CANCELLED_BY_CUSTOMER', percentage: 0, image: theme.images.order.status16 },
125
+ { key: 17, value: t('ORDER_NOT_PICKEDUP_BY_CUSTOMER', 'Order not picked up by customer'), slug: 'ORDER_NOT_PICKEDUP_BY_CUSTOMER', percentage: 0, image: theme.images.order.status17 },
126
+ { key: 18, value: t('DRIVER_ALMOST_ARRIVED_TO_BUSINESS', 'Driver almost arrived to business'), slug: 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS', percentage: 0.15, image: theme.images.order.status18 },
127
+ { key: 19, value: t('DRIVER_ALMOST_ARRIVED_TO_CUSTOMER', 'Driver almost arrived to customer'), slug: 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER', percentage: 0.90, image: theme.images.order.status19 },
128
+ { key: 20, value: t('ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', 'Customer almost arrived to business'), slug: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', percentage: 90, image: theme.images.order.status20 },
129
+ { key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Customer arrived to business'), slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS', percentage: 95, image: theme.images.order.status21 }
130
+ ]
131
+
132
+
133
+ const objectStatus = orderStatus.find((o) => o.key === status)
134
+
135
+ return objectStatus && objectStatus
136
+ }
137
+
138
+ const handleOpenMessagesForBusiness = () => {
139
+ setOpenModalForBusiness(true)
140
+ readMessages && readMessages()
141
+ setUnreadAlert({ ...unreadAlert, business: false })
142
+ }
143
+
144
+ const handleOpenMessagesForDriver = () => {
145
+ setOpenModalForDriver(true)
146
+ readMessages && readMessages()
147
+ setUnreadAlert({ ...unreadAlert, driver: false })
148
+ }
149
+
150
+ const unreadMessages = () => {
151
+ const length = messages?.messages.length
152
+ const unreadLength = order?.unread_count
153
+ const unreadedMessages = messages.messages.slice(length - unreadLength, length)
154
+ const business = unreadedMessages.some((message: any) => message?.can_see?.includes(2))
155
+ const driver = unreadedMessages.some((message: any) => message?.can_see?.includes(4))
156
+ setUnreadAlert({ business, driver })
157
+ }
158
+
159
+ const handleCloseModal = () => {
160
+ setOpenModalForBusiness(false)
161
+ setOpenModalForDriver(false)
162
+ }
163
+
164
+ const handleArrowBack: any = () => {
165
+ if ((!isFromCheckout && !goToBusinessList) || isFromRoot) {
166
+ navigation?.canGoBack() && navigation.goBack();
167
+ return
168
+ }
169
+ if (goToBusinessList) {
170
+ refreshOrderOptions()
171
+ }
172
+ navigation.navigate('BottomTab');
173
+ }
174
+
175
+ const handleCallToDriver = () => {
176
+
177
+ }
178
+
179
+ const handleShareDelivery = () => {
180
+
181
+ }
182
+
183
+ const getIncludedTaxes = () => {
184
+ if (order?.taxes?.length === 0) {
185
+ return order.tax_type === 1 ? order?.summary?.tax ?? 0 : 0
186
+ } else {
187
+ return order?.taxes.reduce((taxIncluded: number, tax: any) => {
188
+ return taxIncluded + (tax.type === 1 ? tax.summary?.tax : 0)
189
+ }, 0)
190
+ }
191
+ }
192
+
193
+ useEffect(() => {
194
+ BackHandler.addEventListener('hardwareBackPress', handleArrowBack);
195
+ return () => {
196
+ BackHandler.removeEventListener('hardwareBackPress', handleArrowBack);
197
+ }
198
+ }, [])
199
+
200
+ useEffect(() => {
201
+ if (messagesReadList?.length) {
202
+ openModalForBusiness ? setUnreadAlert({ ...unreadAlert, business: false }) : setUnreadAlert({ ...unreadAlert, driver: false })
203
+ }
204
+ }, [messagesReadList])
205
+
206
+ const locations = [
207
+ { ...order?.driver?.location, title: t('DRIVER', 'Driver'), icon: order?.driver?.photo || 'https://res.cloudinary.com/demo/image/fetch/c_thumb,g_face,r_max/https://www.freeiconspng.com/thumbs/driver-icon/driver-icon-14.png' },
208
+ { ...order?.business?.location, title: order?.business?.name, icon: order?.business?.logo || theme.images.dummies.businessLogo },
209
+ { ...order?.customer?.location, title: t('YOUR_LOCATION', 'Your Location'), icon: order?.customer?.photo || 'https://res.cloudinary.com/demo/image/upload/c_thumb,g_face,r_max/d_avatar.png/non_existing_id.png' }
210
+ ]
211
+
212
+ useEffect(() => {
213
+ if (driverLocation) {
214
+ locations[0] = driverLocation
215
+ }
216
+ }, [driverLocation])
217
+
218
+ return (
219
+ <OrderDetailsContainer keyboardShouldPersistTaps='handled' showsVerticalScrollIndicator={false} contentContainerStyle={{ paddingHorizontal: 40 }}>
220
+ <Spinner visible={!order || Object.keys(order).length === 0} />
221
+ {order && Object.keys(order).length > 0 && (
222
+ <>
223
+ <Header>
224
+ <OButton
225
+ imgLeftSrc={theme.images.general.close}
226
+ imgRightSrc={null}
227
+ style={styles.btnBackArrow}
228
+ onClick={() => handleArrowBack()}
229
+ imgLeftStyle={{ tintColor: theme.colors.textPrimary, width: 16 }}
230
+ />
231
+ {/* <HeaderInfo>
217
232
  <OIcon src={theme.images.logos.logotypeInvert} height={50} width={180} />
218
233
  <OText size={28} color={theme.colors.white} style={{ fontWeight: Platform.OS === 'ios' ? '600' : 'bold', alignItems: 'flex-start' }}>
219
234
  {order?.customer?.name} {t('THANKS_ORDER', 'thanks for your order!')}
@@ -226,198 +241,241 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
226
241
  <OText size={20} color={theme.colors.white}>{parsePrice(order?.summary?.total || order?.total)}</OText>
227
242
  </View>
228
243
  </HeaderInfo>*/}
229
- <OrderInfo>
230
- <OrderData>
231
- <View style={{ alignItems: 'flex-start', marginBottom: 19 }}>
232
- <OText size={20} weight={Platform.OS === 'ios' ? '600' : 'bold'} style={{ lineHeight: 30, marginBottom: 16 }}>{t('ORDER', 'Order')} {order?.id}</OText>
233
- <OText color={theme.colors.textPrimary} style={theme.labels.middle as TextStyle}>{getOrderStatus(order?.status)?.value}</OText>
234
- <OText style={theme.labels.small as TextStyle} color={theme.colors.textSecondary}>
235
- {`${order?.business?.name} \u2022 ${order?.delivery_datetime_utc
236
- ? moment(order?.delivery_datetime_utc).format('D/MMM/yyyy \u2022 h:m')
237
- : moment(order?.delivery_datetime).utc().format('D/MMM/yyyy \u2022 h:m')}`
238
- }
239
- </OText>
240
- </View>
241
- <StatusBar>
242
- <LinearGradient
243
- start={{ x: 0.0, y: 0.0 }}
244
- end={{ x: getOrderStatus(order?.status)?.percentage || 0, y: 0 }}
245
- locations={[.9999, .9999]}
246
- colors={[theme.colors.primary, theme.colors.backgroundGray300]}
247
- style={styles.statusBar}
248
- />
249
- </StatusBar>
250
- </OrderData>
251
- </OrderInfo>
252
- </Header>
253
- <OrderContent>
254
- <OrderBusiness>
255
- <View style={{ flexDirection: 'row', alignItems: 'baseline', justifyContent: 'space-between' }}>
256
- <OText style={{ ...theme.labels.middle, marginBottom: 2 } as TextStyle} numberOfLines={1} ellipsizeMode='tail'>
257
- {order?.business?.name}
258
- </OText>
259
- <Icons>
260
- <TouchableOpacity onPress={() => props.navigation.navigate('Business', { store: businessData?.slug })}>
261
- <OText color={theme.colors.green} style={theme.labels.normal as TextStyle}>{t('GO_TO_STORE', 'Go to Store')}</OText>
262
- </TouchableOpacity>
263
- <OText style={theme.labels.normal as TextStyle} color={theme.colors.textSecondary}>{' \u2022 '}</OText>
264
- <TouchableOpacity onPress={() => handleOpenMessagesForBusiness()}>
265
- <OText style={theme.labels.normal as TextStyle}>{t('CHAT', 'Chat')}</OText>
266
- </TouchableOpacity>
267
- </Icons>
268
- </View>
269
- <OText style={{ ...theme.labels.normal, marginBottom: 2 } as TextStyle}>{order?.business?.address}</OText>
270
- <OText style={{ ...theme.labels.normal, marginBottom: 2 } as TextStyle}>{order?.business?.email}</OText>
271
- <OText style={{ ...theme.labels.normal, marginBottom: 2 } as TextStyle}>{order?.business?.cellphone}</OText>
272
- </OrderBusiness>
273
-
274
- <OrderCustomer>
275
- <Customer>
276
- <OText style={{ ...theme.labels.middle, marginBottom: 2 } as TextStyle}>{order?.customer?.name} {order?.customer?.lastname}</OText>
277
- <OText style={{ ...theme.labels.normal, marginBottom: 2 } as TextStyle}>{order?.customer?.address}</OText>
278
- <OText style={{ ...theme.labels.normal, marginBottom: 2 } as TextStyle}>{order?.customer?.cellphone}</OText>
279
- <OText style={{ ...theme.labels.normal, marginBottom: 2 } as TextStyle}>{order?.customer?.email}</OText>
280
- </Customer>
281
- </OrderCustomer>
282
-
283
- <OrderCustomer style={{zIndex: 10}}>
284
- <View style={{ flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' }}>
285
- <View>
286
- <OText style={{ ...theme.labels.middle, marginBottom: 2 } as TextStyle}>{t('SHARE_THIS_DELIVERY', 'Share this delivery')}</OText>
287
- <OText style={{ ...theme.labels.normal, marginBottom: 2 } as TextStyle}>{t('LET_SOMEONE_FOLLOW_ALONG', 'Let someone follow along')}</OText>
288
- </View>
289
- <TouchableOpacity onPress={() => {}} style={{alignItems: 'center'}}>
290
- <SocialShareFav icon={theme.images.general.share_fill} style={{width: 16, height: 16}} />
291
- </TouchableOpacity>
292
- </View>
293
- </OrderCustomer>
294
-
295
- {order?.driver && (
296
- <OrderDriver>
297
- <View style={{ flexDirection: 'row', justifyContent: 'space-between', alignItems: 'baseline' }}>
298
- <OText style={{ ...theme.labels.middle } as TextStyle}>{order?.driver?.name} {order?.driver?.lastname}</OText>
299
- <Icons>
300
- <TouchableOpacity onPress={() => handleCallToDriver()}>
301
- <OText style={theme.labels.normal as TextStyle}>{t('CALL', 'Call')}</OText>
302
- </TouchableOpacity>
303
- <OText style={theme.labels.normal as TextStyle} color={theme.colors.textSecondary}>{' \u2022 '}</OText>
304
- <TouchableOpacity onPress={() => handleOpenMessagesForDriver()}>
305
- <OText style={theme.labels.normal as TextStyle}>{t('CHAT', 'Chat')}</OText>
306
- </TouchableOpacity>
307
- </Icons>
308
- </View>
309
- <Customer>
310
- {order?.driver && (
311
- <>
312
- <OText style={theme.labels.normal as TextStyle}>{t('DRIVER', 'Driver')}</OText>
313
- {order?.driver?.location && parseInt(order?.status) === 9 && (
314
- <Map>
315
- <GoogleMap
316
- location={order?.driver?.location}
317
- locations={locations}
318
- readOnly
319
- />
320
- </Map>
321
- )}
322
- </>
323
- )}
324
- </Customer>
325
- </OrderDriver>
326
- )}
327
-
328
- <OrderProducts>
329
- <OText style={theme.labels.middle as TextStyle}>{t('ORDER_DETAILS', 'Order Details')}</OText>
330
- {order?.products?.length && order?.products.map((product: any, i: number) => (
331
- <ProductItemAccordion
332
- key={product?.id || i}
333
- product={product}
334
- isMini
335
- />
336
- ))}
337
- </OrderProducts>
338
- <OrderBill>
339
- <Table>
340
- <OText>{t('SUBTOTAL', 'Subtotal')}</OText>
341
- <OText>{parsePrice(order?.summary?.subtotal || order?.subtotal)}</OText>
342
- </Table>
343
- {(order?.summary?.discount > 0 || order?.discount > 0) && (
344
- <Table>
345
- {order?.offer_type === 1 ? (
346
- <OText>
347
- {t('DISCOUNT', 'Discount')}
348
- <OText>{`(${verifyDecimals(order?.offer_rate, parsePrice)}%)`}</OText>
349
- </OText>
350
- ) : (
351
- <OText>{t('DISCOUNT', 'Discount')}</OText>
352
- )}
353
- <OText>- {parsePrice(order?.summary?.discount || order?.discount)}</OText>
354
- </Table>
355
- )}
356
- {order?.tax_type !== 1 && (
357
- <Table>
358
- <OText>
359
- {t('TAX', 'Tax')}
360
- {`(${verifyDecimals(order?.tax, parseNumber)}%)`}
361
- </OText>
362
- <OText>{parsePrice(order?.summary?.tax || order?.totalTax)}</OText>
363
- </Table>
364
- )}
365
- {(order?.summary?.delivery_price > 0 || order?.deliveryFee > 0) && (
366
- <Table>
367
- <OText>{t('DELIVERY_FEE', 'Delivery Fee')}</OText>
368
- <OText>{parsePrice(order?.summary?.delivery_price || order?.deliveryFee)}</OText>
369
- </Table>
370
- )}
371
- <Table>
372
- <OText>
373
- {t('DRIVER_TIP', 'Driver tip')}
374
- {(order?.summary?.driver_tip > 0 || order?.driver_tip > 0) &&
375
- parseInt(configs?.driver_tip_type?.value, 10) === 2 &&
376
- !parseInt(configs?.driver_tip_use_custom?.value, 10) &&
377
- (
378
- `(${verifyDecimals(order?.driver_tip, parseNumber)}%)`
379
- )}
380
- </OText>
381
- <OText>{parsePrice(order?.summary?.driver_tip || order?.totalDriverTip)}</OText>
382
- </Table>
383
- <Table>
384
- <OText>
385
- {t('SERVICE_FEE', 'Service Fee')}
386
- {`(${verifyDecimals(order?.service_fee, parseNumber)}%)`}
387
- </OText>
388
- <OText>{parsePrice(order?.summary?.service_fee || order?.serviceFee || 0)}</OText>
389
- </Table>
390
- <Total>
391
- <Table>
392
- <OText size={12} weight={Platform.OS === 'ios' ? '600' : 'bold'}>{t('TOTAL', 'Total')}</OText>
393
- <OText size={12} weight={Platform.OS === 'ios' ? '600' : 'bold'}>{parsePrice(order?.summary?.total || order?.total)}</OText>
394
- </Table>
395
- </Total>
396
- </OrderBill>
397
- </OrderContent>
398
- </>
399
- )}
400
- <OModal open={openModalForBusiness || openModalForDriver} entireModal onClose={() => handleCloseModal()} overScreen>
401
- <Messages
402
- type={openModalForBusiness ? USER_TYPE.BUSINESS : USER_TYPE.DRIVER}
403
- orderId={order?.id}
404
- messages={messages}
405
- order={order}
406
- setMessages={setMessages}
407
- />
408
- </OModal>
409
-
410
- </OrderDetailsContainer>
411
- )
244
+ <OrderInfo>
245
+ <OrderData>
246
+ <View style={{ alignItems: 'flex-start', marginBottom: 19 }}>
247
+ <OText size={20} weight={Platform.OS === 'ios' ? '600' : 'bold'} style={{ lineHeight: 30, marginBottom: 16 }}>{t('ORDER', 'Order')} {order?.id}</OText>
248
+ <OText color={theme.colors.textPrimary} style={theme.labels.middle as TextStyle}>{getOrderStatus(order?.status)?.value}</OText>
249
+ <OText style={theme.labels.small as TextStyle} color={theme.colors.textSecondary}>
250
+ {`${order?.business?.name} \u2022 ${order?.delivery_datetime_utc
251
+ ? moment(order?.delivery_datetime_utc).format('D/MMM/yyyy \u2022 h:m')
252
+ : moment(order?.delivery_datetime).utc().format('D/MMM/yyyy \u2022 h:m')}`
253
+ }
254
+ </OText>
255
+ </View>
256
+ <StatusBar>
257
+ <LinearGradient
258
+ start={{ x: 0.0, y: 0.0 }}
259
+ end={{ x: getOrderStatus(order?.status)?.percentage || 0, y: 0 }}
260
+ locations={[.9999, .9999]}
261
+ colors={[theme.colors.primary, theme.colors.backgroundGray300]}
262
+ style={styles.statusBar}
263
+ />
264
+ </StatusBar>
265
+ </OrderData>
266
+ </OrderInfo>
267
+ </Header>
268
+ <OrderContent>
269
+ <OrderBusiness>
270
+ <View style={{ flexDirection: 'row', alignItems: 'baseline', justifyContent: 'space-between' }}>
271
+ <OText style={{ ...theme.labels.middle, marginBottom: 2 } as TextStyle} numberOfLines={1} ellipsizeMode='tail'>
272
+ {order?.business?.name}
273
+ </OText>
274
+ <Icons>
275
+ <TouchableOpacity onPress={() => props.navigation.navigate('Business', { store: businessData?.slug })}>
276
+ <OText color={theme.colors.green} style={theme.labels.normal as TextStyle}>{t('GO_TO_STORE', 'Go to Store')}</OText>
277
+ </TouchableOpacity>
278
+ <OText style={theme.labels.normal as TextStyle} color={theme.colors.textSecondary}>{' \u2022 '}</OText>
279
+ <TouchableOpacity onPress={() => handleOpenMessagesForBusiness()}>
280
+ <OText style={theme.labels.normal as TextStyle}>{t('CHAT', 'Chat')}</OText>
281
+ </TouchableOpacity>
282
+ </Icons>
283
+ </View>
284
+ <OText style={{ ...theme.labels.normal, marginBottom: 2 } as TextStyle}>{order?.business?.address}</OText>
285
+ <OText style={{ ...theme.labels.normal, marginBottom: 2 } as TextStyle}>{order?.business?.email}</OText>
286
+ <OText style={{ ...theme.labels.normal, marginBottom: 2 } as TextStyle}>{order?.business?.cellphone}</OText>
287
+ </OrderBusiness>
288
+
289
+ <OrderCustomer>
290
+ <Customer>
291
+ <OText style={{ ...theme.labels.middle, marginBottom: 2 } as TextStyle}>{order?.customer?.name} {order?.customer?.lastname}</OText>
292
+ <OText style={{ ...theme.labels.normal, marginBottom: 2 } as TextStyle}>{order?.customer?.address}</OText>
293
+ <OText style={{ ...theme.labels.normal, marginBottom: 2 } as TextStyle}>{order?.customer?.cellphone}</OText>
294
+ <OText style={{ ...theme.labels.normal, marginBottom: 2 } as TextStyle}>{order?.customer?.email}</OText>
295
+ </Customer>
296
+ </OrderCustomer>
297
+
298
+ <OrderCustomer style={{ zIndex: 10 }}>
299
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' }}>
300
+ <View>
301
+ <OText style={{ ...theme.labels.middle, marginBottom: 2 } as TextStyle}>{t('SHARE_THIS_DELIVERY', 'Share this delivery')}</OText>
302
+ <OText style={{ ...theme.labels.normal, marginBottom: 2 } as TextStyle}>{t('LET_SOMEONE_FOLLOW_ALONG', 'Let someone follow along')}</OText>
303
+ </View>
304
+ <TouchableOpacity onPress={() => { }} style={{ alignItems: 'center' }}>
305
+ <SocialShareFav icon={theme.images.general.share_fill} style={{ width: 16, height: 16 }} />
306
+ </TouchableOpacity>
307
+ </View>
308
+ </OrderCustomer>
309
+
310
+ {order?.driver && (
311
+ <OrderDriver>
312
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between', alignItems: 'baseline' }}>
313
+ <OText style={{ ...theme.labels.middle } as TextStyle}>{order?.driver?.name} {order?.driver?.lastname}</OText>
314
+ <Icons>
315
+ <TouchableOpacity onPress={() => handleCallToDriver()}>
316
+ <OText style={theme.labels.normal as TextStyle}>{t('CALL', 'Call')}</OText>
317
+ </TouchableOpacity>
318
+ <OText style={theme.labels.normal as TextStyle} color={theme.colors.textSecondary}>{' \u2022 '}</OText>
319
+ <TouchableOpacity onPress={() => handleOpenMessagesForDriver()}>
320
+ <OText style={theme.labels.normal as TextStyle}>{t('CHAT', 'Chat')}</OText>
321
+ </TouchableOpacity>
322
+ </Icons>
323
+ </View>
324
+ <Customer>
325
+ {order?.driver && (
326
+ <>
327
+ <OText style={theme.labels.normal as TextStyle}>{t('DRIVER', 'Driver')}</OText>
328
+ {order?.driver?.location && parseInt(order?.status) === 9 && (
329
+ <Map>
330
+ <GoogleMap
331
+ location={order?.driver?.location}
332
+ locations={locations}
333
+ readOnly
334
+ />
335
+ </Map>
336
+ )}
337
+ </>
338
+ )}
339
+ </Customer>
340
+ </OrderDriver>
341
+ )}
342
+
343
+ <OrderProducts>
344
+ <OText style={theme.labels.middle as TextStyle}>{t('ORDER_DETAILS', 'Order Details')}</OText>
345
+ {order?.products?.length && order?.products.map((product: any, i: number) => (
346
+ <ProductItemAccordion
347
+ key={product?.id || i}
348
+ product={product}
349
+ isMini
350
+ />
351
+ ))}
352
+ </OrderProducts>
353
+ <OrderBill>
354
+ <Table>
355
+ <OText>{t('SUBTOTAL', 'Subtotal')}</OText>
356
+ <OText>{parsePrice(((order?.summary?.subtotal || order?.subtotal) + getIncludedTaxes()))}</OText>
357
+ </Table>
358
+ {(order?.summary?.discount > 0 || order?.discount > 0) && (
359
+ <Table>
360
+ {order?.offer_type === 1 ? (
361
+ <OText>
362
+ {t('DISCOUNT', 'Discount')}
363
+ <OText>{`(${verifyDecimals(order?.offer_rate, parsePrice)}%)`}</OText>
364
+ </OText>
365
+ ) : (
366
+ <OText>{t('DISCOUNT', 'Discount')}</OText>
367
+ )}
368
+ <OText>- {parsePrice(order?.summary?.discount || order?.discount)}</OText>
369
+ </Table>
370
+ )}
371
+ {
372
+ order?.taxes?.length === 0 && order?.tax_type === 2 && (
373
+ <Table>
374
+ <OText>
375
+ {t('TAX', 'Tax')} {`(${verifyDecimals(order?.tax, parseNumber)}%)`}
376
+ </OText>
377
+ <OText>{parsePrice(order?.summary?.tax || 0)}</OText>
378
+ </Table>
379
+ )
380
+ }
381
+ {
382
+ order?.fees?.length === 0 && (
383
+ <Table>
384
+ <OText>
385
+ {t('SERVICE_FEE', 'Service fee')}
386
+ {`(${verifyDecimals(order?.service_fee, parseNumber)}%)`}
387
+ </OText>
388
+ <OText>{parsePrice(order?.summary?.service_fee || 0)}</OText>
389
+ </Table>
390
+ )
391
+ }
392
+ {
393
+ order?.taxes?.length > 0 && order?.taxes?.filter((tax: any) => tax?.type === 2 && tax?.rate !== 0).map((tax: any) => (
394
+ <Table key={tax.id}>
395
+ <OSRow>
396
+ <OText numberOfLines={1}>
397
+ {tax.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
398
+ {`(${verifyDecimals(tax?.rate, parseNumber)}%)`}{' '}
399
+ </OText>
400
+ <TouchableOpacity onPress={() => setOpenTaxModal({ open: true, data: tax })}>
401
+ <AntIcon name='exclamationcircleo' size={18} color={theme.colors.primary} />
402
+ </TouchableOpacity>
403
+ </OSRow>
404
+ <OText>{parsePrice(tax?.summary?.tax || 0)}</OText>
405
+ </Table>
406
+ ))
407
+ }
408
+ {
409
+ order?.fees?.length > 0 && order?.fees?.filter((fee: any) => !(fee.fixed === 0 && fee.percentage === 0))?.map((fee: any) => (
410
+ <Table key={fee.id}>
411
+ <OSRow>
412
+ <OText numberOfLines={1}>
413
+ {fee.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
414
+ ({parsePrice(fee?.fixed)} + {fee.percentage}%){' '}
415
+ </OText>
416
+ <TouchableOpacity onPress={() => setOpenTaxModal({ open: true, data: fee })}>
417
+ <AntIcon name='exclamationcircleo' size={18} color={theme.colors.primary} />
418
+ </TouchableOpacity>
419
+ </OSRow>
420
+ <OText>{parsePrice(fee?.fixed + fee?.summary?.percentage || 0)}</OText>
421
+ </Table>
422
+ ))
423
+ }
424
+ {(order?.summary?.delivery_price > 0 || order?.deliveryFee > 0) && (
425
+ <Table>
426
+ <OText>{t('DELIVERY_FEE', 'Delivery Fee')}</OText>
427
+ <OText>{parsePrice(order?.summary?.delivery_price || order?.deliveryFee)}</OText>
428
+ </Table>
429
+ )}
430
+ <Table>
431
+ <OText>
432
+ {t('DRIVER_TIP', 'Driver tip')}
433
+ {(order?.summary?.driver_tip > 0 || order?.driver_tip > 0) &&
434
+ parseInt(configs?.driver_tip_type?.value, 10) === 2 &&
435
+ !parseInt(configs?.driver_tip_use_custom?.value, 10) &&
436
+ (
437
+ `(${verifyDecimals(order?.driver_tip, parseNumber)}%)`
438
+ )}
439
+ </OText>
440
+ <OText>{parsePrice(order?.summary?.driver_tip || order?.totalDriverTip)}</OText>
441
+ </Table>
442
+ <Total>
443
+ <Table>
444
+ <OText size={12} weight={Platform.OS === 'ios' ? '600' : 'bold'}>{t('TOTAL', 'Total')}</OText>
445
+ <OText size={12} weight={Platform.OS === 'ios' ? '600' : 'bold'}>{parsePrice(order?.summary?.total || order?.total)}</OText>
446
+ </Table>
447
+ </Total>
448
+ </OrderBill>
449
+ </OrderContent>
450
+ </>
451
+ )}
452
+ <OModal open={openModalForBusiness || openModalForDriver} entireModal onClose={() => handleCloseModal()} overScreen>
453
+ <Messages
454
+ type={openModalForBusiness ? USER_TYPE.BUSINESS : USER_TYPE.DRIVER}
455
+ orderId={order?.id}
456
+ messages={messages}
457
+ order={order}
458
+ setMessages={setMessages}
459
+ />
460
+ </OModal>
461
+ <OModal
462
+ open={openTaxModal.open}
463
+ onClose={() => setOpenTaxModal({ open: false, data: null })}
464
+ entireModal
465
+ >
466
+ <TaxInformation data={openTaxModal.data} products={order?.products} />
467
+ </OModal>
468
+ </OrderDetailsContainer>
469
+ )
412
470
  }
413
471
 
414
472
  export const OrderDetails = (props: OrderDetailsParams) => {
415
- const orderDetailsProps = {
416
- ...props,
417
- UIComponent: OrderDetailsUI
418
- }
419
-
420
- return (
421
- <OrderDetailsConTableoller {...orderDetailsProps} />
422
- )
473
+ const orderDetailsProps = {
474
+ ...props,
475
+ UIComponent: OrderDetailsUI
476
+ }
477
+
478
+ return (
479
+ <OrderDetailsConTableoller {...orderDetailsProps} />
480
+ )
423
481
  }