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