ordering-ui-react-native 0.16.9 → 0.16.10-release
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 +8 -4
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/ActiveOrders/index.tsx +61 -63
- package/src/components/ActiveOrders/styles.tsx +8 -14
- package/src/components/AddressForm/index.tsx +18 -2
- package/src/components/BusinessBasicInformation/index.tsx +11 -19
- package/src/components/BusinessController/index.tsx +10 -8
- package/src/components/BusinessInformation/index.tsx +22 -0
- package/src/components/BusinessTypeFilter/index.tsx +1 -2
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/Checkout/index.tsx +2 -1
- package/src/components/LanguageSelector/index.tsx +21 -16
- package/src/components/LoginForm/index.tsx +118 -30
- package/src/components/LoginForm/styles.tsx +6 -0
- package/src/components/Messages/index.tsx +2 -2
- package/src/components/NotificationSetting/index.tsx +85 -0
- package/src/components/OrderDetails/index.tsx +7 -21
- package/src/components/OrdersOption/index.tsx +54 -56
- package/src/components/PaymentOptions/index.tsx +335 -365
- package/src/components/PaymentOptionsWebView/index.tsx +120 -121
- package/src/components/ReviewDriver/index.tsx +1 -1
- package/src/components/ReviewOrder/index.tsx +2 -1
- package/src/components/ReviewProducts/index.tsx +11 -0
- package/src/components/SignupForm/index.tsx +143 -61
- package/src/components/SingleProductReview/index.tsx +8 -5
- package/src/components/StripeElementsForm/index.tsx +25 -16
- package/src/components/StripeMethodForm/index.tsx +1 -2
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OBottomPopup.tsx +6 -2
- package/src/index.tsx +2 -0
- package/src/navigators/CheckoutNavigator.tsx +6 -0
- package/src/navigators/HomeNavigator.tsx +6 -0
- package/src/pages/BusinessesListing.tsx +7 -6
- package/src/pages/MultiCheckout.tsx +31 -0
- package/src/pages/MultiOrdersDetails.tsx +27 -0
- package/src/pages/OrderDetails.tsx +1 -1
- package/src/pages/ReviewDriver.tsx +2 -2
- package/src/pages/ReviewOrder.tsx +2 -2
- package/src/theme.json +0 -1
- package/src/types/@fatnlazycat/react-native-recaptcha-v3/index.d.ts +1 -0
- package/src/types/index.tsx +13 -9
- package/src/utils/index.tsx +0 -1
- package/themes/business/index.tsx +4 -0
- package/themes/business/src/components/BusinessController/index.tsx +2 -2
- package/themes/business/src/components/Chat/index.tsx +42 -34
- package/themes/business/src/components/DriverMap/index.tsx +13 -10
- package/themes/business/src/components/DriverSchedule/index.tsx +71 -0
- package/themes/business/src/components/DriverSchedule/styles.tsx +6 -0
- package/themes/business/src/components/LoginForm/index.tsx +111 -74
- package/themes/business/src/components/MapView/index.tsx +1 -1
- package/themes/business/src/components/MessagesOption/index.tsx +11 -1
- package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
- package/themes/business/src/components/OrderDetails/Delivery.tsx +3 -3
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +19 -18
- package/themes/business/src/components/OrdersListManager/index.tsx +10 -3
- package/themes/business/src/components/OrdersOption/index.tsx +65 -21
- package/themes/business/src/components/OrdersOption/styles.tsx +5 -1
- package/themes/business/src/components/OrdersOptionBusiness/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionCity/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionDate/index.tsx +19 -6
- package/themes/business/src/components/OrdersOptionDelivery/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionDriver/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionPaymethod/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionStatus/index.tsx +10 -1
- package/themes/business/src/components/PreviousMessages/index.tsx +17 -18
- package/themes/business/src/components/PreviousOrders/index.tsx +21 -23
- package/themes/business/src/components/ProductItemAccordion/index.tsx +5 -4
- package/themes/business/src/components/ReviewCustomer/index.tsx +1 -1
- package/themes/business/src/components/ScheduleBlocked/index.tsx +53 -0
- package/themes/business/src/components/UserFormDetails/index.tsx +5 -2
- package/themes/business/src/components/UserProfileForm/index.tsx +28 -4
- package/themes/business/src/components/shared/ODropDown.tsx +42 -8
- package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
- package/themes/business/src/components/shared/OModal.tsx +40 -37
- package/themes/business/src/types/index.tsx +14 -9
- package/themes/business/src/utils/index.tsx +10 -0
- package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
- package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/kiosk/src/components/BusinessMenu/index.tsx +2 -1
- package/themes/kiosk/src/components/CartItem/index.tsx +4 -3
- package/themes/kiosk/src/components/CategoriesMenu/index.tsx +1 -0
- package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
- package/themes/kiosk/src/components/DrawerView/index.tsx +1 -0
- package/themes/kiosk/src/components/DrawerView/styles.tsx +2 -2
- package/themes/kiosk/src/components/LoginForm/index.tsx +121 -10
- package/themes/kiosk/src/components/LoginForm/styles.tsx +5 -0
- package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
- package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/kiosk/src/types/index.d.ts +2 -0
- package/themes/original/index.tsx +22 -0
- package/themes/original/src/components/ActiveOrders/index.tsx +15 -132
- package/themes/original/src/components/ActiveOrders/styles.tsx +0 -54
- package/themes/original/src/components/AddressForm/index.tsx +136 -133
- package/themes/original/src/components/AddressList/index.tsx +1 -1
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +302 -160
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +6 -2
- package/themes/original/src/components/BusinessController/index.tsx +179 -96
- package/themes/original/src/components/BusinessController/styles.tsx +5 -0
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +12 -9
- package/themes/original/src/components/BusinessItemAccordion/styles.tsx +3 -1
- package/themes/original/src/components/BusinessListingSearch/BusinessControllerSkeletons/index.tsx +57 -0
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +59 -0
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/styles.tsx +13 -0
- package/themes/original/src/components/BusinessListingSearch/index.tsx +106 -126
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +18 -13
- package/themes/original/src/components/BusinessProductsList/CategoryDescription/index.tsx +44 -0
- package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +87 -0
- package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/styles.tsx +12 -0
- package/themes/original/src/components/BusinessProductsList/index.tsx +65 -72
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +290 -178
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +18 -0
- package/themes/original/src/components/BusinessReviews/index.tsx +6 -1
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +106 -38
- package/themes/original/src/components/BusinessTypeFilter/styles.tsx +2 -0
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +561 -0
- package/themes/original/src/components/BusinessesListing/{styles.tsx → Layout/Appointment/styles.tsx} +24 -2
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +673 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +137 -0
- package/themes/original/src/components/BusinessesListing/index.tsx +102 -464
- package/themes/original/src/components/Cart/index.tsx +81 -36
- package/themes/original/src/components/Cart/styles.tsx +4 -0
- package/themes/original/src/components/CartContent/index.tsx +22 -16
- package/themes/original/src/components/Checkout/index.tsx +106 -66
- package/themes/original/src/components/Checkout/styles.tsx +0 -1
- package/themes/original/src/components/DriverTips/index.tsx +4 -4
- package/themes/original/src/components/DriverTips/styles.tsx +2 -1
- package/themes/original/src/components/Favorite/index.tsx +92 -0
- package/themes/original/src/components/Favorite/styles.tsx +22 -0
- package/themes/original/src/components/FavoriteList/index.tsx +317 -0
- package/themes/original/src/components/FavoriteList/styles.tsx +5 -0
- package/themes/original/src/components/GPSButton/index.tsx +25 -17
- package/themes/original/src/components/GoogleMap/index.tsx +20 -12
- package/themes/original/src/components/HelpAccountAndPayment/index.tsx +8 -3
- package/themes/original/src/components/HelpGuide/index.tsx +8 -3
- package/themes/original/src/components/HelpOrder/index.tsx +8 -3
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +18 -1
- package/themes/original/src/components/LoginForm/Otp/index.tsx +3 -2
- package/themes/original/src/components/LoginForm/index.tsx +79 -42
- package/themes/original/src/components/Messages/index.tsx +17 -17
- package/themes/original/src/components/MomentSelector/index.tsx +197 -0
- package/themes/original/src/components/MomentSelector/styles.tsx +6 -0
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +243 -0
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/styles.tsx +46 -0
- package/themes/original/src/components/MultiCheckout/index.tsx +304 -0
- package/themes/original/src/components/MultiCheckout/styles.tsx +59 -0
- package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +372 -0
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +262 -0
- package/themes/original/src/components/MultiOrdersDetails/styles.tsx +50 -0
- package/themes/original/src/components/MyOrders/index.tsx +177 -27
- package/themes/original/src/components/MyOrders/styles.tsx +8 -1
- package/themes/original/src/components/NavBar/index.tsx +11 -5
- package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +167 -0
- package/themes/original/src/components/OrderDetails/index.tsx +125 -40
- package/themes/original/src/components/OrderDetails/styles.tsx +5 -2
- package/themes/original/src/components/OrderItAgain/index.tsx +75 -0
- package/themes/original/src/components/OrderItAgain/styles.tsx +10 -0
- package/themes/original/src/components/OrderProgress/index.tsx +8 -2
- package/themes/original/src/components/OrderSummary/index.tsx +1 -34
- package/themes/original/src/components/OrderTypeSelector/index.tsx +84 -36
- package/themes/original/src/components/OrderTypeSelector/styles.tsx +19 -1
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +144 -0
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +6 -0
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +56 -0
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +6 -0
- package/themes/original/src/components/OrdersOption/index.tsx +130 -37
- package/themes/original/src/components/OrdersOption/styles.tsx +4 -1
- package/themes/original/src/components/PaymentOptions/index.tsx +57 -37
- package/themes/original/src/components/PhoneInputNumber/index.tsx +4 -10
- package/themes/original/src/components/PlaceSpot/index.tsx +243 -47
- package/themes/original/src/components/PlaceSpot/styles.tsx +0 -2
- package/themes/original/src/components/PreviousOrders/index.tsx +18 -147
- package/themes/original/src/components/ProductForm/index.tsx +712 -655
- package/themes/original/src/components/ProductForm/styles.tsx +9 -7
- package/themes/original/src/components/ProductItemAccordion/index.tsx +37 -24
- package/themes/original/src/components/ProductOption/index.tsx +1 -1
- package/themes/original/src/components/ProfessionalFilter/index.tsx +129 -0
- package/themes/original/src/components/ProfessionalFilter/styles.tsx +0 -0
- package/themes/original/src/components/ProfessionalProfile/index.tsx +309 -0
- package/themes/original/src/components/ProfessionalProfile/styles.tsx +46 -0
- package/themes/original/src/components/ReviewDriver/index.tsx +6 -6
- package/themes/original/src/components/ReviewOrder/index.tsx +18 -3
- package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
- package/themes/original/src/components/ReviewTrigger/index.tsx +118 -0
- package/themes/original/src/components/ReviewTrigger/styles.tsx +34 -0
- package/themes/original/src/components/SearchBar/index.tsx +10 -5
- package/themes/original/src/components/ServiceForm/index.tsx +608 -0
- package/themes/original/src/components/ServiceForm/styles.tsx +50 -0
- package/themes/original/src/components/SignupForm/index.tsx +301 -158
- package/themes/original/src/components/SingleOrderCard/index.tsx +316 -0
- package/themes/original/src/components/SingleOrderCard/styles.tsx +54 -0
- package/themes/original/src/components/SingleProductCard/index.tsx +215 -95
- package/themes/original/src/components/SingleProductCard/styles.tsx +2 -2
- package/themes/original/src/components/SingleProductReview/index.tsx +30 -3
- package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
- package/themes/original/src/components/StripeElementsForm/index.tsx +25 -9
- package/themes/original/src/components/StripeElementsForm/naked.tsx +2 -2
- package/themes/original/src/components/UpsellingProducts/index.tsx +14 -4
- package/themes/original/src/components/UserDetails/index.tsx +32 -18
- package/themes/original/src/components/UserFormDetails/index.tsx +107 -73
- package/themes/original/src/components/UserProfile/index.tsx +12 -1
- package/themes/original/src/components/UserProfileForm/index.tsx +15 -10
- package/themes/original/src/components/WalletTransactions/index.tsx +76 -0
- package/themes/original/src/components/WalletTransactions/styles.tsx +13 -0
- package/themes/original/src/components/Wallets/index.tsx +176 -162
- package/themes/original/src/components/Wallets/styles.tsx +10 -8
- package/themes/original/src/components/shared/OBottomPopup.tsx +47 -14
- package/themes/original/src/components/shared/OButton.tsx +10 -3
- package/themes/original/src/components/shared/OInput.tsx +3 -2
- package/themes/original/src/components/shared/OModal.tsx +3 -1
- package/themes/original/src/layouts/FloatingBottomContainer.tsx +5 -1
- package/themes/original/src/types/index.tsx +200 -46
- package/themes/original/src/utils/index.tsx +77 -0
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -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,262 @@
|
|
|
1
|
+
import React, { useEffect } from 'react'
|
|
2
|
+
import { useLanguage, useUtils, useToast, ToastType, MultiOrdersDetails as MultiOrdersDetailsController } from 'ordering-components/native'
|
|
3
|
+
import { View, StyleSheet, BackHandler, TouchableOpacity } 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
|
+
import AntDesignIcon from 'react-native-vector-icons/AntDesign'
|
|
10
|
+
|
|
11
|
+
import {
|
|
12
|
+
OrdersDetailsContainer,
|
|
13
|
+
Header,
|
|
14
|
+
Divider,
|
|
15
|
+
Section,
|
|
16
|
+
Customer,
|
|
17
|
+
InfoBlock,
|
|
18
|
+
Row,
|
|
19
|
+
OrdersSummary,
|
|
20
|
+
BorderLine
|
|
21
|
+
} from './styles'
|
|
22
|
+
|
|
23
|
+
export const MultiOrdersDetailsUI = (props: any) => {
|
|
24
|
+
const {
|
|
25
|
+
navigation,
|
|
26
|
+
customer,
|
|
27
|
+
paymentEvents,
|
|
28
|
+
ordersSummary,
|
|
29
|
+
isFromMultiCheckout
|
|
30
|
+
} = props
|
|
31
|
+
|
|
32
|
+
const theme = useTheme()
|
|
33
|
+
const styles = StyleSheet.create({
|
|
34
|
+
btnBackArrow: {
|
|
35
|
+
borderWidth: 0,
|
|
36
|
+
backgroundColor: theme.colors.clear,
|
|
37
|
+
shadowColor: theme.colors.clear,
|
|
38
|
+
padding: 0,
|
|
39
|
+
marginLeft: -20
|
|
40
|
+
},
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
const { loading, orders, error } = props.ordersList
|
|
44
|
+
const [, t] = useLanguage()
|
|
45
|
+
const [{ parsePrice, parseNumber, parseDate }] = useUtils();
|
|
46
|
+
const [, { showToast }] = useToast();
|
|
47
|
+
|
|
48
|
+
const walletName: any = {
|
|
49
|
+
cash: {
|
|
50
|
+
name: t('PAY_WITH_CASH_WALLET', 'Pay with Cash Wallet')
|
|
51
|
+
},
|
|
52
|
+
credit_point: {
|
|
53
|
+
name: t('PAY_WITH_CREDITS_POINTS_WALLET', 'Pay with Credit Points Wallet')
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const handleArrowBack: any = () => {
|
|
58
|
+
if (!isFromMultiCheckout) {
|
|
59
|
+
navigation?.canGoBack() && navigation.goBack();
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
navigation.navigate('BusinessList');
|
|
63
|
+
return true
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const handleGoToOrderDetails = (uuid: any) => {
|
|
67
|
+
navigation.navigate('OrderDetails', { orderId: uuid })
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
if (error) {
|
|
72
|
+
showToast(ToastType.Error, error)
|
|
73
|
+
}
|
|
74
|
+
}, [error])
|
|
75
|
+
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
BackHandler.addEventListener('hardwareBackPress', handleArrowBack)
|
|
78
|
+
return () => {
|
|
79
|
+
BackHandler.removeEventListener('hardwareBackPress', handleArrowBack)
|
|
80
|
+
}
|
|
81
|
+
}, [])
|
|
82
|
+
|
|
83
|
+
return (
|
|
84
|
+
<OrdersDetailsContainer keyboardShouldPersistTaps="handled" contentContainerStyle={{ paddingHorizontal: 40 }}>
|
|
85
|
+
<View style={{ flexDirection: 'row' }}>
|
|
86
|
+
<OButton
|
|
87
|
+
imgRightSrc={null}
|
|
88
|
+
style={styles.btnBackArrow}
|
|
89
|
+
onClick={() => handleArrowBack()}
|
|
90
|
+
icon={AntDesignIcon}
|
|
91
|
+
iconProps={{
|
|
92
|
+
name: 'arrowleft',
|
|
93
|
+
size: 26
|
|
94
|
+
}}
|
|
95
|
+
/>
|
|
96
|
+
</View>
|
|
97
|
+
<Header>
|
|
98
|
+
{loading ? (
|
|
99
|
+
<Placeholder Animation={Fade}>
|
|
100
|
+
<PlaceholderLine
|
|
101
|
+
width={20}
|
|
102
|
+
height={30}
|
|
103
|
+
noMargin
|
|
104
|
+
style={{ borderRadius: 10, marginBottom: 8 }}
|
|
105
|
+
/>
|
|
106
|
+
<PlaceholderLine
|
|
107
|
+
height={18}
|
|
108
|
+
noMargin
|
|
109
|
+
style={{ borderRadius: 10 }}
|
|
110
|
+
/>
|
|
111
|
+
</Placeholder>
|
|
112
|
+
) : (
|
|
113
|
+
<>
|
|
114
|
+
<OText size={20} lineHeight={30} mBottom={8} color={theme.colors.textNormal}>
|
|
115
|
+
{t('HEY', 'Hey')} <OText size={20} lineHeight={30} weight={700} mLeft={10} color={theme.colors.textNormal}>{customer?.name} {customer?.lastname}</OText>
|
|
116
|
+
</OText>
|
|
117
|
+
<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>
|
|
118
|
+
</>
|
|
119
|
+
)}
|
|
120
|
+
</Header>
|
|
121
|
+
<Divider />
|
|
122
|
+
<Section>
|
|
123
|
+
<OText size={16} lineHeight={24} weight={'500'} color={theme.colors.textNormal} mBottom={16}>
|
|
124
|
+
{t('CUSTOMER_DETAILS', 'Customer Details')}
|
|
125
|
+
</OText>
|
|
126
|
+
{loading ? (
|
|
127
|
+
<Customer>
|
|
128
|
+
<PlaceholderLine height={18} noMargin style={{ borderRadius: 2 }} />
|
|
129
|
+
<PlaceholderLine height={18} noMargin style={{ borderRadius: 2 }} />
|
|
130
|
+
<PlaceholderLine height={18} noMargin style={{ borderRadius: 2 }} />
|
|
131
|
+
</Customer>
|
|
132
|
+
) : (
|
|
133
|
+
<Customer>
|
|
134
|
+
<InfoBlock>
|
|
135
|
+
<OText size={12} lineHeight={18} color={theme.colors.textNormal} mBottom={2}>
|
|
136
|
+
{customer?.name} {customer?.lastname}
|
|
137
|
+
</OText>
|
|
138
|
+
<OText size={12} lineHeight={18} color={theme.colors.textNormal} mBottom={2}>
|
|
139
|
+
{customer?.address}
|
|
140
|
+
</OText>
|
|
141
|
+
<OText size={12} lineHeight={18} color={theme.colors.textNormal} mBottom={2}>
|
|
142
|
+
{customer?.cellphone}
|
|
143
|
+
</OText>
|
|
144
|
+
</InfoBlock>
|
|
145
|
+
</Customer>
|
|
146
|
+
)}
|
|
147
|
+
</Section>
|
|
148
|
+
<Divider />
|
|
149
|
+
<Section>
|
|
150
|
+
<OText size={16} lineHeight={24} weight={'500'} color={theme.colors.textNormal} mBottom={16}>
|
|
151
|
+
{t('PAYMETHOD', 'Payment method')}
|
|
152
|
+
</OText>
|
|
153
|
+
{paymentEvents.map((event: any) => (
|
|
154
|
+
<OText key={event.id} size={12} lineHeight={18} color={theme.colors.textNormal}>
|
|
155
|
+
{event?.wallet_event
|
|
156
|
+
? walletName[event?.wallet_event?.wallet?.type]?.name
|
|
157
|
+
: event?.paymethod?.name}
|
|
158
|
+
</OText>
|
|
159
|
+
))}
|
|
160
|
+
</Section>
|
|
161
|
+
<Divider />
|
|
162
|
+
<Section>
|
|
163
|
+
<OText size={16} lineHeight={24} weight={'500'} color={theme.colors.textNormal} mBottom={20}>
|
|
164
|
+
{t('DELIVERYA_V21', 'Delivery address')}
|
|
165
|
+
</OText>
|
|
166
|
+
{loading ? (
|
|
167
|
+
<PlaceholderLine height={18} noMargin style={{ borderRadius: 2 }} />
|
|
168
|
+
) : (
|
|
169
|
+
<OText size={12} lineHeight={18} color={theme.colors.textNormal} mBottom={2}>
|
|
170
|
+
{customer?.address}
|
|
171
|
+
</OText>
|
|
172
|
+
)}
|
|
173
|
+
</Section>
|
|
174
|
+
<Divider />
|
|
175
|
+
{loading ? (
|
|
176
|
+
<Placeholder Animation={Fade}>
|
|
177
|
+
<PlaceholderLine
|
|
178
|
+
height={300}
|
|
179
|
+
noMargin
|
|
180
|
+
style={{ borderRadius: 10, marginBottom: 8 }}
|
|
181
|
+
/>
|
|
182
|
+
</Placeholder>
|
|
183
|
+
) : (
|
|
184
|
+
<OrdersSummary>
|
|
185
|
+
<OText size={16} lineHeight={24} weight={'500'} color={theme.colors.textNormal} mBottom={20}>
|
|
186
|
+
{t('ORDER_SUMMARY', 'Order summary')}
|
|
187
|
+
</OText>
|
|
188
|
+
{orders.map((order: any) => (
|
|
189
|
+
<Row key={order.id}>
|
|
190
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
|
|
191
|
+
{t('ORDER', 'Order')} #{order.id}
|
|
192
|
+
</OText>
|
|
193
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
|
|
194
|
+
{parsePrice(order?.summary?.total ?? order?.total)}
|
|
195
|
+
</OText>
|
|
196
|
+
</Row>
|
|
197
|
+
))}
|
|
198
|
+
<BorderLine />
|
|
199
|
+
<Row>
|
|
200
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
|
|
201
|
+
{t('TOTAL_BEFORE_TAX', 'Total before tax')}:
|
|
202
|
+
</OText>
|
|
203
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
|
|
204
|
+
{parsePrice(ordersSummary?.subtotal)}
|
|
205
|
+
</OText>
|
|
206
|
+
</Row>
|
|
207
|
+
<Row>
|
|
208
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
|
|
209
|
+
{t('ESTIMATED_TAX_TO_BE_COLLECTED', 'Estimated tax to be collected')}:
|
|
210
|
+
</OText>
|
|
211
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
|
|
212
|
+
{parsePrice(ordersSummary?.tax)}
|
|
213
|
+
</OText>
|
|
214
|
+
</Row>
|
|
215
|
+
<BorderLine />
|
|
216
|
+
<Row style={{ marginTop: 10 }}>
|
|
217
|
+
<OText size={14} lineHeight={18} weight={'500'} color={theme.colors.textNormal}>
|
|
218
|
+
{t('PAYMENT_TOTAL', 'Payment total')}:
|
|
219
|
+
</OText>
|
|
220
|
+
<OText size={14} lineHeight={18} weight={'500'} color={theme.colors.textNormal}>
|
|
221
|
+
{parsePrice(ordersSummary?.total)}
|
|
222
|
+
</OText>
|
|
223
|
+
</Row>
|
|
224
|
+
</OrdersSummary>
|
|
225
|
+
)}
|
|
226
|
+
|
|
227
|
+
{loading ? (
|
|
228
|
+
[...Array(3).keys()].map(i => (
|
|
229
|
+
<Placeholder Animation={Fade} key={i}>
|
|
230
|
+
<PlaceholderLine
|
|
231
|
+
height={300}
|
|
232
|
+
noMargin
|
|
233
|
+
style={{ borderRadius: 10, marginBottom: 8 }}
|
|
234
|
+
/>
|
|
235
|
+
</Placeholder>
|
|
236
|
+
))
|
|
237
|
+
) : (
|
|
238
|
+
<>
|
|
239
|
+
{orders.map((order: any) => (
|
|
240
|
+
<React.Fragment key={order.id}>
|
|
241
|
+
<SingleOrderCard
|
|
242
|
+
navigation={navigation}
|
|
243
|
+
order={order}
|
|
244
|
+
handleGoToOrderDetails={handleGoToOrderDetails}
|
|
245
|
+
/>
|
|
246
|
+
<Divider />
|
|
247
|
+
</React.Fragment>
|
|
248
|
+
))}
|
|
249
|
+
</>
|
|
250
|
+
)}
|
|
251
|
+
<Divider />
|
|
252
|
+
</OrdersDetailsContainer>
|
|
253
|
+
)
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
export const MultiOrdersDetails = (props: any) => {
|
|
257
|
+
const MultiOrdersDetails = {
|
|
258
|
+
...props,
|
|
259
|
+
UIComponent: MultiOrdersDetailsUI
|
|
260
|
+
}
|
|
261
|
+
return <MultiOrdersDetailsController {...MultiOrdersDetails} />
|
|
262
|
+
}
|
|
@@ -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
|
+
`
|