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