ordering-ui-react-native 0.16.49 → 0.16.50-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 +6 -5
- 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/BusinessInformation/index.tsx +33 -4
- package/src/components/BusinessInformation/styles.tsx +2 -2
- package/src/components/BusinessProductsList/index.tsx +10 -10
- 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/Messages/index.tsx +2 -2
- package/src/components/NotificationSetting/index.tsx +85 -0
- package/src/components/OrdersOption/index.tsx +54 -56
- package/src/components/PaymentOptions/index.tsx +298 -345
- package/src/components/PaymentOptionsWebView/index.tsx +120 -121
- package/src/components/ReviewProducts/index.tsx +11 -0
- package/src/components/SingleProductReview/index.tsx +8 -5
- package/src/components/StripeElementsForm/index.tsx +25 -16
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OBottomPopup.tsx +6 -2
- package/src/components/shared/OToast.tsx +4 -4
- package/src/index.tsx +2 -0
- package/src/types/@fatnlazycat/react-native-recaptcha-v3/index.d.ts +1 -0
- package/src/utils/index.tsx +2 -1
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +259 -238
- package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
- package/themes/business/src/components/BusinessController/index.tsx +2 -2
- package/themes/business/src/components/Chat/index.tsx +40 -32
- package/themes/business/src/components/DriverMap/index.tsx +7 -5
- package/themes/business/src/components/DriverSchedule/index.tsx +36 -19
- package/themes/business/src/components/LoginForm/index.tsx +111 -74
- package/themes/business/src/components/MapView/index.tsx +12 -1
- package/themes/business/src/components/MessagesOption/index.tsx +11 -1
- package/themes/business/src/components/NewOrderNotification/index.tsx +26 -41
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +40 -30
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +3 -3
- package/themes/business/src/components/OrdersListManager/index.tsx +10 -3
- package/themes/business/src/components/OrdersOption/index.tsx +76 -77
- 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/OrderItem.tsx +250 -0
- package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
- package/themes/business/src/components/PreviousOrders/index.tsx +332 -244
- package/themes/business/src/components/PreviousOrders/styles.tsx +30 -2
- package/themes/business/src/components/ProductItemAccordion/index.tsx +3 -2
- package/themes/business/src/components/ReviewCustomer/index.tsx +39 -15
- package/themes/business/src/components/ScheduleBlocked/index.tsx +2 -2
- package/themes/business/src/components/UserFormDetails/index.tsx +5 -2
- package/themes/business/src/components/UserProfileForm/index.tsx +2 -0
- 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/OLink.tsx +24 -12
- package/themes/business/src/components/shared/OText.tsx +3 -2
- package/themes/business/src/types/index.tsx +25 -11
- 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/BusinessesListing/index.tsx +2 -1
- package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
- 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/ProductForm/index.tsx +1 -14
- 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 +8 -0
- package/themes/original/src/components/AddressDetails/index.tsx +10 -8
- package/themes/original/src/components/AddressForm/index.tsx +157 -140
- 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 +218 -147
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +2 -2
- package/themes/original/src/components/BusinessController/index.tsx +203 -94
- package/themes/original/src/components/BusinessController/styles.tsx +14 -9
- package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +12 -6
- 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 +85 -137
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +10 -12
- 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 +59 -60
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +179 -83
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +19 -12
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -2
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +15 -4
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +3 -2
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +276 -122
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +48 -11
- package/themes/original/src/components/BusinessesListing/index.tsx +82 -28
- package/themes/original/src/components/Cart/index.tsx +82 -15
- package/themes/original/src/components/Cart/styles.tsx +4 -0
- package/themes/original/src/components/CartContent/index.tsx +27 -17
- package/themes/original/src/components/CartContent/styles.tsx +1 -1
- package/themes/original/src/components/Checkout/index.tsx +114 -118
- package/themes/original/src/components/Checkout/styles.tsx +4 -3
- package/themes/original/src/components/CitiesControl/index.tsx +89 -0
- package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
- 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/FavoriteList/index.tsx +69 -45
- package/themes/original/src/components/FloatingButton/index.tsx +13 -11
- package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
- package/themes/original/src/components/GPSButton/index.tsx +20 -19
- package/themes/original/src/components/GPSButton/styles.ts +3 -3
- package/themes/original/src/components/GoogleMap/index.tsx +20 -12
- package/themes/original/src/components/HelpAccountAndPayment/index.tsx +25 -10
- package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +4 -0
- package/themes/original/src/components/HelpGuide/index.tsx +9 -8
- package/themes/original/src/components/HelpOrder/index.tsx +9 -8
- package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
- package/themes/original/src/components/LoginForm/Otp/index.tsx +89 -73
- package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
- package/themes/original/src/components/LoginForm/index.tsx +98 -41
- package/themes/original/src/components/LottieAnimation/index.tsx +69 -0
- package/themes/original/src/components/Messages/index.tsx +35 -20
- package/themes/original/src/components/MomentOption/index.tsx +8 -6
- package/themes/original/src/components/MultiCart/index.tsx +63 -0
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -93
- package/themes/original/src/components/MultiCheckout/index.tsx +10 -2
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +34 -16
- package/themes/original/src/components/MyOrders/index.tsx +88 -24
- package/themes/original/src/components/NavBar/index.tsx +11 -5
- package/themes/original/src/components/NetworkError/index.tsx +5 -3
- package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
- package/themes/original/src/components/Notifications/index.tsx +148 -0
- package/themes/original/src/components/Notifications/styles.tsx +17 -0
- package/themes/original/src/components/OrderDetails/index.tsx +162 -50
- package/themes/original/src/components/OrderDetails/styles.tsx +15 -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 +77 -66
- package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
- package/themes/original/src/components/OrderSummary/index.tsx +2 -35
- package/themes/original/src/components/OrderTypeSelector/index.tsx +85 -36
- package/themes/original/src/components/OrderTypeSelector/styles.tsx +19 -1
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +94 -98
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
- package/themes/original/src/components/OrdersOption/index.tsx +91 -53
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +1 -2
- package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
- package/themes/original/src/components/PlaceSpot/index.tsx +249 -47
- package/themes/original/src/components/PlaceSpot/styles.tsx +0 -2
- package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
- package/themes/original/src/components/ProductForm/index.tsx +645 -664
- package/themes/original/src/components/ProductForm/styles.tsx +10 -11
- package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
- package/themes/original/src/components/ProductOption/index.tsx +1 -1
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +16 -8
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +0 -1
- package/themes/original/src/components/ProfessionalFilter/index.tsx +2 -1
- package/themes/original/src/components/ProfessionalProfile/index.tsx +19 -8
- package/themes/original/src/components/Promotions/index.tsx +232 -219
- package/themes/original/src/components/Promotions/styles.tsx +7 -2
- package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
- package/themes/original/src/components/ReviewOrder/index.tsx +120 -108
- package/themes/original/src/components/ReviewOrder/styles.tsx +5 -7
- package/themes/original/src/components/ReviewProducts/index.tsx +8 -5
- package/themes/original/src/components/ReviewTrigger/index.tsx +136 -0
- package/themes/original/src/components/ReviewTrigger/styles.tsx +41 -0
- package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
- package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
- package/themes/original/src/components/ServiceForm/index.tsx +341 -267
- package/themes/original/src/components/SignupForm/index.tsx +160 -113
- package/themes/original/src/components/SingleOrderCard/index.tsx +219 -129
- package/themes/original/src/components/SingleOrderCard/styles.tsx +10 -8
- package/themes/original/src/components/SingleProductCard/index.tsx +182 -105
- package/themes/original/src/components/SingleProductCard/styles.tsx +3 -10
- package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
- package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
- package/themes/original/src/components/StripeElementsForm/index.tsx +13 -2
- package/themes/original/src/components/UpsellingProducts/index.tsx +15 -5
- package/themes/original/src/components/UserDetails/index.tsx +5 -3
- package/themes/original/src/components/UserFormDetails/index.tsx +6 -48
- package/themes/original/src/components/UserProfile/index.tsx +58 -35
- package/themes/original/src/components/UserProfile/styles.ts +17 -0
- 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 -164
- package/themes/original/src/components/Wallets/styles.tsx +12 -8
- package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
- package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
- package/themes/original/src/components/shared/OBottomPopup.tsx +48 -15
- package/themes/original/src/components/shared/OButton.tsx +10 -3
- package/themes/original/src/components/shared/OIcon.tsx +8 -1
- package/themes/original/src/components/shared/OInput.tsx +10 -1
- package/themes/original/src/layouts/Container.tsx +13 -9
- package/themes/original/src/layouts/FloatingBottomContainer.tsx +5 -1
- package/themes/original/src/types/index.tsx +86 -28
- package/themes/original/src/utils/index.tsx +103 -58
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -2,16 +2,16 @@ import React, { useState } from 'react';
|
|
|
2
2
|
import {
|
|
3
3
|
SingleOrderCard as SingleOrderCardController,
|
|
4
4
|
useUtils,
|
|
5
|
+
useOrder,
|
|
5
6
|
useLanguage
|
|
6
7
|
} from 'ordering-components/native';
|
|
7
8
|
import { StyleSheet, TouchableOpacity, View } from 'react-native';
|
|
8
9
|
import { useTheme } from 'styled-components/native';
|
|
9
10
|
import { OIcon, OText, OButton } from '../shared';
|
|
10
|
-
import IconAntDesign from 'react-native-vector-icons/AntDesign'
|
|
11
11
|
import { SingleOrderCardParams } from '../../types';
|
|
12
|
+
import { OAlert } from '../../../../../src/components/shared'
|
|
12
13
|
|
|
13
14
|
import {
|
|
14
|
-
Container,
|
|
15
15
|
InnerContainer,
|
|
16
16
|
Logo,
|
|
17
17
|
CardInfoWrapper,
|
|
@@ -19,8 +19,11 @@ import {
|
|
|
19
19
|
ButtonWrapper,
|
|
20
20
|
ContentFooter,
|
|
21
21
|
UnreadMessageCounter,
|
|
22
|
-
Price
|
|
22
|
+
Price,
|
|
23
|
+
MultiLogosContainer
|
|
23
24
|
} from './styles';
|
|
25
|
+
import { LottieAnimation } from '../LottieAnimation';
|
|
26
|
+
import { CardAnimation } from '../shared/CardAnimation';
|
|
24
27
|
|
|
25
28
|
const SingleOrderCardUI = (props: SingleOrderCardParams) => {
|
|
26
29
|
const {
|
|
@@ -32,23 +35,38 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
|
|
|
32
35
|
onNavigationRedirect,
|
|
33
36
|
pastOrders,
|
|
34
37
|
isMessageView,
|
|
35
|
-
handleClickOrder
|
|
38
|
+
handleClickOrder,
|
|
39
|
+
handleRemoveCart,
|
|
40
|
+
cartState
|
|
36
41
|
} = props;
|
|
37
42
|
|
|
38
43
|
const [{ parsePrice, optimizeImage, parseDate }] = useUtils();
|
|
39
44
|
const [, t] = useLanguage();
|
|
45
|
+
const [{ carts }] = useOrder()
|
|
40
46
|
const theme = useTheme();
|
|
41
47
|
|
|
42
48
|
const [reorderSelected, setReorderSelected] = useState<number | null>(null);
|
|
49
|
+
const [confirm, setConfirm] = useState<any>({ open: false, content: null, handleOnAccept: null, id: null, title: null })
|
|
50
|
+
const [isPressed, setIsPressed] = useState(false)
|
|
43
51
|
|
|
44
52
|
const allowedOrderStatus = [1, 2, 5, 6, 10, 11, 12];
|
|
45
53
|
|
|
46
54
|
const styles = StyleSheet.create({
|
|
55
|
+
container: {
|
|
56
|
+
borderRadius: 7.6,
|
|
57
|
+
marginBottom: 10,
|
|
58
|
+
paddingVertical: 5,
|
|
59
|
+
},
|
|
47
60
|
logo: {
|
|
48
61
|
borderRadius: 8,
|
|
49
62
|
width: 64,
|
|
50
63
|
height: 64
|
|
51
64
|
},
|
|
65
|
+
minilogo: {
|
|
66
|
+
borderRadius: 8,
|
|
67
|
+
width: 40,
|
|
68
|
+
height: 40
|
|
69
|
+
},
|
|
52
70
|
logoWrapper: {
|
|
53
71
|
overflow: 'hidden',
|
|
54
72
|
backgroundColor: 'white',
|
|
@@ -94,12 +112,32 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
|
|
|
94
112
|
infoText: {
|
|
95
113
|
flexDirection: 'row',
|
|
96
114
|
alignItems: 'center'
|
|
115
|
+
},
|
|
116
|
+
cardAnimation: {
|
|
117
|
+
elevation: isPressed ? 2 : 0,
|
|
118
|
+
shadowColor: '#888',
|
|
119
|
+
shadowOffset: { width: 0, height: isPressed ? 2 : 0 },
|
|
120
|
+
shadowRadius: 18,
|
|
121
|
+
shadowOpacity: isPressed ? 0.8 : 0,
|
|
122
|
+
borderRadius: 12,
|
|
97
123
|
}
|
|
98
124
|
});
|
|
99
125
|
|
|
100
|
-
const handleReorderClick = (
|
|
101
|
-
|
|
102
|
-
|
|
126
|
+
const handleReorderClick = (order: any) => {
|
|
127
|
+
if (carts[`businessId:${order?.business_id}`] && carts[`businessId:${order?.business_id}`]?.products?.length > 0) {
|
|
128
|
+
setConfirm({
|
|
129
|
+
open: true,
|
|
130
|
+
content: [t('QUESTION_DELETE_PRODUCTS_FROM_CART', 'Are you sure that you want to delete all products from cart?')],
|
|
131
|
+
title: t('ORDER', 'Order'),
|
|
132
|
+
handleOnAccept: async () => {
|
|
133
|
+
handleRemoveCart()
|
|
134
|
+
setConfirm({ ...confirm, open: false })
|
|
135
|
+
}
|
|
136
|
+
})
|
|
137
|
+
} else {
|
|
138
|
+
setReorderSelected(order?.id);
|
|
139
|
+
handleReorder && handleReorder(order?.id);
|
|
140
|
+
}
|
|
103
141
|
};
|
|
104
142
|
|
|
105
143
|
const handleClickOrderReview = (order: any) => {
|
|
@@ -109,11 +147,12 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
|
|
|
109
147
|
order: {
|
|
110
148
|
id: order?.id,
|
|
111
149
|
business_id: order?.business_id,
|
|
112
|
-
logo: order?.business?.logo,
|
|
150
|
+
logo: order?.business?.length > 1 ? order?.business?.map?.((business : any) => business?.logo): order?.business?.logo,
|
|
113
151
|
driver: order?.driver,
|
|
114
152
|
products: order?.products,
|
|
115
153
|
review: order?.review,
|
|
116
|
-
user_review: order?.user_review
|
|
154
|
+
user_review: order?.user_review,
|
|
155
|
+
business: order?.business
|
|
117
156
|
},
|
|
118
157
|
});
|
|
119
158
|
return
|
|
@@ -126,143 +165,194 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
|
|
|
126
165
|
onNavigationRedirect('OrderDetails', { orderId: order?.uuid });
|
|
127
166
|
};
|
|
128
167
|
|
|
129
|
-
const handleClickViewOrder = (
|
|
130
|
-
|
|
131
|
-
|
|
168
|
+
const handleClickViewOrder = (order: any) => {
|
|
169
|
+
if (isMessageView) {
|
|
170
|
+
handleClickOrder(order?.uuid)
|
|
171
|
+
return
|
|
172
|
+
}
|
|
173
|
+
if (order?.cart_group_id){
|
|
174
|
+
onNavigationRedirect?.('MultiOrdersDetails', { orderId: order?.cart_group_id });
|
|
175
|
+
} else {
|
|
176
|
+
onNavigationRedirect?.('OrderDetails', { orderId: order?.uuid });
|
|
177
|
+
}
|
|
132
178
|
};
|
|
133
179
|
|
|
134
180
|
const handleChangeFavorite = () => {
|
|
135
181
|
handleFavoriteOrder && handleFavoriteOrder(!order?.favorite)
|
|
136
182
|
};
|
|
137
183
|
|
|
184
|
+
const handleOriginalReorder = () => {
|
|
185
|
+
setConfirm({ ...confirm, open: false, title: null })
|
|
186
|
+
setReorderSelected(order?.id);
|
|
187
|
+
handleReorder && handleReorder(order?.id);
|
|
188
|
+
}
|
|
189
|
+
|
|
138
190
|
return (
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
191
|
+
<>
|
|
192
|
+
<CardAnimation
|
|
193
|
+
onClick={() => handleClickViewOrder(order)}
|
|
194
|
+
style={[styles.container]}
|
|
195
|
+
>
|
|
196
|
+
<InnerContainer>
|
|
197
|
+
{(!!order.business?.logo || theme?.images?.dummies?.businessLogo) && (
|
|
198
|
+
<>
|
|
199
|
+
{order?.business?.length > 1 ? (
|
|
200
|
+
<MultiLogosContainer>
|
|
201
|
+
{order?.business?.map((business: any, i: number) => (
|
|
202
|
+
<View key={business?.id}>
|
|
203
|
+
{i > 1 ? (
|
|
204
|
+
<>
|
|
205
|
+
{console.log(order?.business?.length - 2)}
|
|
206
|
+
<OText mRight={3}> + {order?.business?.length - 2}</OText>
|
|
207
|
+
</>
|
|
208
|
+
) : (
|
|
209
|
+
<Logo style={styles.logoWrapper} isMulti>
|
|
210
|
+
<OIcon
|
|
211
|
+
url={optimizeImage(business?.logo, 'h_300,c_limit')}
|
|
212
|
+
src={optimizeImage(!business?.logo && theme?.images?.dummies?.businessLogo, 'h_300,c_limit')}
|
|
213
|
+
style={styles.minilogo}
|
|
214
|
+
/>
|
|
215
|
+
</Logo>
|
|
216
|
+
)}
|
|
217
|
+
</View>
|
|
218
|
+
))}
|
|
219
|
+
</MultiLogosContainer>
|
|
220
|
+
) : (
|
|
221
|
+
<Logo style={styles.logoWrapper}>
|
|
222
|
+
<OIcon
|
|
223
|
+
url={optimizeImage(order.business?.logo, 'h_300,c_limit')}
|
|
224
|
+
src={optimizeImage(!order.business?.logo && theme?.images?.dummies?.businessLogo, 'h_300,c_limit')}
|
|
225
|
+
style={styles.logo}
|
|
226
|
+
/>
|
|
227
|
+
</Logo>
|
|
228
|
+
)}
|
|
229
|
+
</>
|
|
230
|
+
)}
|
|
231
|
+
<CardInfoWrapper>
|
|
232
|
+
<ContentHeader>
|
|
233
|
+
<View style={{ flex: 1 }}>
|
|
234
|
+
<OText size={12} lineHeight={18} weight={'600'} numberOfLines={1} ellipsizeMode={'tail'}>
|
|
235
|
+
{order?.business?.length > 1 ? `${t('GROUP_ORDER', 'Group Order')} ${t('No', 'No')}. ${order?.cart_group_id}` : order.business?.name}
|
|
236
|
+
</OText>
|
|
237
|
+
</View>
|
|
238
|
+
{!!!pastOrders && (
|
|
239
|
+
<>
|
|
240
|
+
{isMessageView ? (
|
|
241
|
+
<>
|
|
242
|
+
{order?.unread_count > 0 && (
|
|
243
|
+
<UnreadMessageCounter>
|
|
244
|
+
<OText size={12} color={theme.colors.primary} lineHeight={18} >
|
|
245
|
+
{order?.unread_count}
|
|
246
|
+
</OText>
|
|
247
|
+
</UnreadMessageCounter>
|
|
248
|
+
)}
|
|
249
|
+
</>
|
|
250
|
+
) : (
|
|
251
|
+
<Price>
|
|
252
|
+
<OText size={12} lineHeight={18}>
|
|
253
|
+
{parsePrice(order?.summary?.total || order?.total)}
|
|
254
|
+
</OText>
|
|
255
|
+
</Price>
|
|
256
|
+
)}
|
|
257
|
+
</>
|
|
258
|
+
)}
|
|
259
|
+
{!!pastOrders && (
|
|
260
|
+
<ButtonWrapper>
|
|
261
|
+
{allowedOrderStatus.includes(parseInt(order?.status)) &&
|
|
262
|
+
!order.review && (
|
|
263
|
+
<TouchableOpacity
|
|
264
|
+
onPress={() => handleClickOrderReview(order)}
|
|
265
|
+
style={styles.reviewButton}>
|
|
266
|
+
<OText size={10} color={theme.colors.primary} numberOfLines={1}>
|
|
267
|
+
{t('REVIEW', 'Review')}
|
|
167
268
|
</OText>
|
|
168
|
-
</
|
|
269
|
+
</TouchableOpacity>
|
|
169
270
|
)}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
{
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
271
|
+
{order.cart && (
|
|
272
|
+
<OButton
|
|
273
|
+
text={t('REORDER', 'Reorder')}
|
|
274
|
+
imgRightSrc={''}
|
|
275
|
+
textStyle={styles.buttonText}
|
|
276
|
+
style={
|
|
277
|
+
((reorderLoading && order.id === reorderSelected) || cartState?.loading)
|
|
278
|
+
? styles.reorderLoading
|
|
279
|
+
: styles.reorderbutton
|
|
280
|
+
}
|
|
281
|
+
onClick={() => handleReorderClick(order)}
|
|
282
|
+
isLoading={(reorderLoading && order.id === reorderSelected) || cartState?.loading}
|
|
283
|
+
/>
|
|
284
|
+
)}
|
|
285
|
+
</ButtonWrapper>
|
|
286
|
+
)}
|
|
287
|
+
</ContentHeader>
|
|
288
|
+
<ContentFooter>
|
|
289
|
+
<View style={{ flex: 1 }}>
|
|
290
|
+
<View style={styles.infoText}>
|
|
291
|
+
{(!!!pastOrders || order?.business?.length > 1) && (
|
|
292
|
+
<>
|
|
293
|
+
<OText
|
|
294
|
+
size={10}
|
|
295
|
+
space
|
|
296
|
+
color={theme.colors.textSecondary}
|
|
297
|
+
style={{ marginVertical: 3 }}
|
|
298
|
+
lineHeight={15}
|
|
299
|
+
numberOfLines={1}
|
|
300
|
+
>
|
|
301
|
+
{order?.business?.length > 1 ? order?.business?.length : (t('ORDER_NO', 'Order No') + '.')}
|
|
302
|
+
</OText>
|
|
303
|
+
<OText
|
|
304
|
+
size={10}
|
|
305
|
+
color={theme.colors.textSecondary}
|
|
306
|
+
style={{ marginVertical: 3 }}
|
|
307
|
+
lineHeight={15}
|
|
308
|
+
numberOfLines={1}
|
|
309
|
+
>
|
|
310
|
+
{order?.business?.length > 1 ? t('ORDERS', 'orders') + ' \u2022 ' : order.id + ` \u2022 `}
|
|
189
311
|
</OText>
|
|
190
|
-
|
|
312
|
+
</>
|
|
191
313
|
)}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
}
|
|
202
|
-
onClick={() => handleReorderClick(order.id)}
|
|
203
|
-
isLoading={reorderLoading && order.id === reorderSelected}
|
|
204
|
-
/>
|
|
205
|
-
)}
|
|
206
|
-
</ButtonWrapper>
|
|
207
|
-
)}
|
|
208
|
-
</ContentHeader>
|
|
209
|
-
<ContentFooter>
|
|
210
|
-
<View style={{ flex: 1 }}>
|
|
211
|
-
<View style={styles.infoText}>
|
|
212
|
-
{!!!pastOrders && (
|
|
213
|
-
<>
|
|
214
|
-
<OText
|
|
215
|
-
size={10}
|
|
216
|
-
space
|
|
217
|
-
color={theme.colors.textSecondary}
|
|
218
|
-
style={{ marginVertical: 3 }}
|
|
219
|
-
lineHeight={15}
|
|
220
|
-
numberOfLines={1}
|
|
221
|
-
>
|
|
222
|
-
{t('ORDER_NO', 'Order No') + '.'}
|
|
223
|
-
</OText>
|
|
224
|
-
<OText
|
|
225
|
-
size={10}
|
|
226
|
-
color={theme.colors.textSecondary}
|
|
227
|
-
style={{ marginVertical: 3 }}
|
|
228
|
-
lineHeight={15}
|
|
229
|
-
numberOfLines={1}
|
|
230
|
-
>
|
|
231
|
-
{order.id + ` \u2022 `}
|
|
232
|
-
</OText>
|
|
233
|
-
</>
|
|
234
|
-
)}
|
|
314
|
+
<OText
|
|
315
|
+
size={10}
|
|
316
|
+
lineHeight={15}
|
|
317
|
+
color={theme.colors.textSecondary}
|
|
318
|
+
style={{ marginVertical: 3 }}
|
|
319
|
+
numberOfLines={1}>
|
|
320
|
+
{order?.delivery_datetime_utc ? parseDate(order?.delivery_datetime_utc) : parseDate(order?.delivery_datetime, { utc: false })}
|
|
321
|
+
</OText>
|
|
322
|
+
</View>
|
|
235
323
|
<OText
|
|
324
|
+
color={theme.colors.primary}
|
|
236
325
|
size={10}
|
|
237
326
|
lineHeight={15}
|
|
238
|
-
color={theme.colors.textSecondary}
|
|
239
|
-
style={{ marginVertical: 3 }}
|
|
240
327
|
numberOfLines={1}>
|
|
241
|
-
{
|
|
328
|
+
{getOrderStatus(order.status)?.value}
|
|
242
329
|
</OText>
|
|
243
330
|
</View>
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
>
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
331
|
+
{!isMessageView && !order?.business?.length && (
|
|
332
|
+
<LottieAnimation
|
|
333
|
+
type='favorite'
|
|
334
|
+
onClick={handleChangeFavorite}
|
|
335
|
+
initialValue={order?.favorite ? 0.75 : 0}
|
|
336
|
+
toValue={order?.favorite ? 0 : 0.75}
|
|
337
|
+
style={{ marginBottom: 5 }}
|
|
338
|
+
iconProps={{ color: theme.colors.danger5, size: 16, style: { top: 7 } }}
|
|
339
|
+
isActive={order?.favorite}
|
|
340
|
+
/>
|
|
341
|
+
)}
|
|
342
|
+
</ContentFooter>
|
|
343
|
+
</CardInfoWrapper>
|
|
344
|
+
</InnerContainer>
|
|
345
|
+
</CardAnimation>
|
|
346
|
+
<OAlert
|
|
347
|
+
open={confirm.open}
|
|
348
|
+
title={confirm.title}
|
|
349
|
+
content={confirm.content}
|
|
350
|
+
onAccept={confirm.handleOnAccept}
|
|
351
|
+
onCancel={() => handleOriginalReorder()}
|
|
352
|
+
onClose={() => handleOriginalReorder()}
|
|
353
|
+
/>
|
|
354
|
+
</>
|
|
355
|
+
|
|
266
356
|
)
|
|
267
357
|
}
|
|
268
358
|
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
import styled from 'styled-components/native'
|
|
2
|
-
|
|
3
|
-
export const Container = styled.TouchableOpacity`
|
|
4
|
-
border-radius: 7.6px;
|
|
5
|
-
box-shadow: 0 1px 2px #0000001A;
|
|
6
|
-
margin-bottom: 10px;
|
|
7
|
-
padding-vertical: 5px;
|
|
8
|
-
`
|
|
1
|
+
import styled, { css } from 'styled-components/native'
|
|
9
2
|
|
|
10
3
|
export const InnerContainer = styled.View`
|
|
11
4
|
flex-direction: row;
|
|
@@ -15,6 +8,9 @@ export const InnerContainer = styled.View`
|
|
|
15
8
|
export const Logo = styled.View`
|
|
16
9
|
border-radius: 7.6px;
|
|
17
10
|
margin-right: 12px;
|
|
11
|
+
${({ isMulti } : any) => isMulti && css`
|
|
12
|
+
margin-right: 5px;
|
|
13
|
+
`}
|
|
18
14
|
`
|
|
19
15
|
|
|
20
16
|
export const CardInfoWrapper = styled.View`
|
|
@@ -52,3 +48,9 @@ export const Price = styled.View`
|
|
|
52
48
|
margin-left: 10px;
|
|
53
49
|
width: 30%;
|
|
54
50
|
`
|
|
51
|
+
|
|
52
|
+
export const MultiLogosContainer = styled.View`
|
|
53
|
+
display: flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
flex-direction: row;
|
|
56
|
+
`
|