ordering-ui-react-native 0.17.24 → 0.17.25-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 (211) hide show
  1. package/package.json +8 -7
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/BusinessesListing/index.tsx +1 -1
  4. package/src/components/OrderCreating/index.tsx +1 -21
  5. package/src/components/PaymentOptionsWebView/index.tsx +119 -120
  6. package/src/components/StripeMethodForm/index.tsx +108 -79
  7. package/src/components/VerifyPhone/styles.tsx +1 -2
  8. package/src/components/shared/OToast.tsx +4 -4
  9. package/src/types/index.tsx +5 -0
  10. package/src/utils/index.tsx +7 -1
  11. package/themes/business/index.tsx +2 -0
  12. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +265 -240
  13. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
  14. package/themes/business/src/components/BusinessController/index.tsx +0 -1
  15. package/themes/business/src/components/Chat/index.tsx +118 -107
  16. package/themes/business/src/components/DriverMap/index.tsx +17 -6
  17. package/themes/business/src/components/GoogleMap/index.tsx +58 -57
  18. package/themes/business/src/components/LoginForm/Otp/index.tsx +120 -0
  19. package/themes/business/src/components/LoginForm/Otp/styles.tsx +7 -0
  20. package/themes/business/src/components/LoginForm/index.tsx +238 -80
  21. package/themes/business/src/components/LoginForm/styles.tsx +10 -0
  22. package/themes/business/src/components/MapView/index.tsx +10 -10
  23. package/themes/business/src/components/NewOrderNotification/index.tsx +43 -50
  24. package/themes/business/src/components/OrderDetails/Delivery.tsx +4 -3
  25. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +90 -47
  26. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +59 -62
  27. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +195 -0
  28. package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
  29. package/themes/business/src/components/OrderMessage/index.tsx +18 -17
  30. package/themes/business/src/components/OrderSummary/index.tsx +113 -121
  31. package/themes/business/src/components/OrdersOption/index.tsx +32 -75
  32. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +250 -0
  33. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
  34. package/themes/business/src/components/PreviousOrders/index.tsx +445 -243
  35. package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
  36. package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
  37. package/themes/business/src/components/ReviewCustomer/index.tsx +41 -24
  38. package/themes/business/src/components/StoresList/index.tsx +2 -2
  39. package/themes/business/src/components/shared/OLink.tsx +33 -13
  40. package/themes/business/src/components/shared/OModal.tsx +16 -9
  41. package/themes/business/src/components/shared/OText.tsx +8 -2
  42. package/themes/business/src/types/index.tsx +32 -2
  43. package/themes/business/src/utils/index.tsx +44 -1
  44. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  45. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  46. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  47. package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
  48. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  49. package/themes/kiosk/src/components/LoginForm/Otp/index.tsx +92 -0
  50. package/themes/kiosk/src/components/LoginForm/Otp/styles.tsx +7 -0
  51. package/themes/kiosk/src/components/LoginForm/index.tsx +473 -151
  52. package/themes/kiosk/src/components/LoginForm/styles.tsx +14 -1
  53. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  54. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  55. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  56. package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +3 -2
  57. package/themes/kiosk/src/components/PhoneInputNumber/styles.tsx +1 -3
  58. package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
  59. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  60. package/themes/kiosk/src/components/shared/OModal.tsx +14 -11
  61. package/themes/kiosk/src/layouts/Container.tsx +7 -1
  62. package/themes/kiosk/src/types/index.d.ts +13 -0
  63. package/themes/kiosk/src/utils/index.tsx +15 -0
  64. package/themes/original/index.tsx +6 -0
  65. package/themes/original/src/components/AddressDetails/index.tsx +29 -11
  66. package/themes/original/src/components/AddressForm/index.tsx +53 -19
  67. package/themes/original/src/components/AddressList/index.tsx +26 -21
  68. package/themes/original/src/components/AddressList/styles.tsx +4 -2
  69. package/themes/original/src/components/AnalyticsSegment/index.tsx +193 -10
  70. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  71. package/themes/original/src/components/BusinessBasicInformation/index.tsx +166 -89
  72. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +9 -7
  73. package/themes/original/src/components/BusinessController/index.tsx +145 -68
  74. package/themes/original/src/components/BusinessController/styles.tsx +22 -9
  75. package/themes/original/src/components/BusinessFeaturedController/index.tsx +21 -54
  76. package/themes/original/src/components/BusinessFeaturedController/styles.tsx +8 -0
  77. package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
  78. package/themes/original/src/components/BusinessItemAccordion/index.tsx +23 -22
  79. package/themes/original/src/components/BusinessListingSearch/index.tsx +350 -323
  80. package/themes/original/src/components/BusinessPreorder/index.tsx +97 -16
  81. package/themes/original/src/components/BusinessProductsList/index.tsx +20 -11
  82. package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
  83. package/themes/original/src/components/BusinessProductsListing/index.tsx +616 -495
  84. package/themes/original/src/components/BusinessProductsListing/styles.tsx +7 -9
  85. package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
  86. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  87. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +105 -78
  88. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
  89. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  90. package/themes/original/src/components/Cart/index.tsx +102 -69
  91. package/themes/original/src/components/CartContent/index.tsx +110 -19
  92. package/themes/original/src/components/CartContent/styles.tsx +15 -1
  93. package/themes/original/src/components/Checkout/index.tsx +323 -178
  94. package/themes/original/src/components/Checkout/styles.tsx +4 -2
  95. package/themes/original/src/components/CitiesControl/index.tsx +89 -0
  96. package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
  97. package/themes/original/src/components/CouponControl/index.tsx +10 -3
  98. package/themes/original/src/components/DriverTips/index.tsx +52 -34
  99. package/themes/original/src/components/Favorite/index.tsx +7 -4
  100. package/themes/original/src/components/Favorite/styles.tsx +1 -1
  101. package/themes/original/src/components/FavoriteList/index.tsx +51 -80
  102. package/themes/original/src/components/FloatingButton/index.tsx +1 -2
  103. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  104. package/themes/original/src/components/GPSButton/index.tsx +6 -4
  105. package/themes/original/src/components/GPSButton/styles.ts +3 -3
  106. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +96 -0
  107. package/themes/original/src/components/GiftCard/GiftCardUI/styles.tsx +5 -0
  108. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +100 -0
  109. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +8 -0
  110. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +178 -0
  111. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +8 -0
  112. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +165 -0
  113. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +9 -0
  114. package/themes/original/src/components/GoogleMap/index.tsx +15 -4
  115. package/themes/original/src/components/Help/index.tsx +8 -8
  116. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +11 -22
  117. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +6 -0
  118. package/themes/original/src/components/HelpGuide/index.tsx +12 -16
  119. package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
  120. package/themes/original/src/components/HelpOrder/index.tsx +12 -25
  121. package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
  122. package/themes/original/src/components/Home/index.tsx +13 -4
  123. package/themes/original/src/components/LanguageSelector/index.tsx +17 -13
  124. package/themes/original/src/components/LastOrder/index.tsx +1 -34
  125. package/themes/original/src/components/LoginForm/Otp/index.tsx +89 -73
  126. package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
  127. package/themes/original/src/components/LoginForm/index.tsx +59 -22
  128. package/themes/original/src/components/LottieAnimation/index.tsx +78 -0
  129. package/themes/original/src/components/MessageListing/index.tsx +16 -42
  130. package/themes/original/src/components/Messages/index.tsx +32 -10
  131. package/themes/original/src/components/MomentOption/index.tsx +195 -88
  132. package/themes/original/src/components/MultiCart/index.tsx +50 -0
  133. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +197 -116
  134. package/themes/original/src/components/MultiCheckout/index.tsx +288 -86
  135. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
  136. package/themes/original/src/components/MultiOrdersDetails/index.tsx +67 -20
  137. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
  138. package/themes/original/src/components/MyOrders/index.tsx +55 -51
  139. package/themes/original/src/components/NavBar/index.tsx +6 -11
  140. package/themes/original/src/components/Notifications/index.tsx +46 -50
  141. package/themes/original/src/components/Notifications/styles.tsx +6 -3
  142. package/themes/original/src/components/OrderDetails/OrderEta.tsx +64 -0
  143. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +15 -3
  144. package/themes/original/src/components/OrderDetails/index.tsx +201 -339
  145. package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
  146. package/themes/original/src/components/OrderItAgain/index.tsx +3 -1
  147. package/themes/original/src/components/OrderProgress/index.tsx +74 -112
  148. package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
  149. package/themes/original/src/components/OrderSummary/index.tsx +87 -59
  150. package/themes/original/src/components/OrderTypeSelector/index.tsx +3 -2
  151. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +24 -19
  152. package/themes/original/src/components/OrdersOption/index.tsx +96 -88
  153. package/themes/original/src/components/PageBanner/index.tsx +171 -0
  154. package/themes/original/src/components/PageBanner/styles.tsx +11 -0
  155. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
  156. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  157. package/themes/original/src/components/PaymentOptions/index.tsx +34 -6
  158. package/themes/original/src/components/PhoneInputNumber/index.tsx +3 -3
  159. package/themes/original/src/components/PlaceSpot/index.tsx +12 -6
  160. package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
  161. package/themes/original/src/components/ProductForm/index.tsx +230 -261
  162. package/themes/original/src/components/ProductForm/styles.tsx +4 -7
  163. package/themes/original/src/components/ProductItemAccordion/index.tsx +59 -29
  164. package/themes/original/src/components/ProductOptionSubOption/index.tsx +18 -10
  165. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +1 -2
  166. package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
  167. package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -50
  168. package/themes/original/src/components/ProfessionalProfile/index.tsx +36 -7
  169. package/themes/original/src/components/Promotions/index.tsx +234 -220
  170. package/themes/original/src/components/Promotions/styles.tsx +10 -3
  171. package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
  172. package/themes/original/src/components/ReviewOrder/index.tsx +26 -9
  173. package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
  174. package/themes/original/src/components/ReviewProducts/index.tsx +23 -11
  175. package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
  176. package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
  177. package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
  178. package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
  179. package/themes/original/src/components/ServiceForm/index.tsx +74 -19
  180. package/themes/original/src/components/Sessions/index.tsx +11 -8
  181. package/themes/original/src/components/Sessions/styles.tsx +5 -0
  182. package/themes/original/src/components/SignupForm/index.tsx +82 -67
  183. package/themes/original/src/components/SingleOrderCard/index.tsx +149 -63
  184. package/themes/original/src/components/SingleOrderCard/styles.tsx +11 -9
  185. package/themes/original/src/components/SingleProductCard/index.tsx +99 -55
  186. package/themes/original/src/components/SingleProductCard/styles.tsx +27 -13
  187. package/themes/original/src/components/SingleProductReview/index.tsx +8 -2
  188. package/themes/original/src/components/SingleProductReview/styles.tsx +1 -1
  189. package/themes/original/src/components/StripeCardsList/index.tsx +9 -2
  190. package/themes/original/src/components/StripeElementsForm/index.tsx +28 -15
  191. package/themes/original/src/components/UpsellingProducts/index.tsx +238 -224
  192. package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
  193. package/themes/original/src/components/UserDetails/index.tsx +8 -4
  194. package/themes/original/src/components/UserFormDetails/index.tsx +47 -7
  195. package/themes/original/src/components/UserProfile/index.tsx +9 -14
  196. package/themes/original/src/components/UserProfileForm/index.tsx +21 -28
  197. package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
  198. package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
  199. package/themes/original/src/components/Wallets/index.tsx +94 -33
  200. package/themes/original/src/components/Wallets/styles.tsx +2 -0
  201. package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
  202. package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
  203. package/themes/original/src/components/shared/OBottomPopup.tsx +1 -1
  204. package/themes/original/src/components/shared/OButton.tsx +6 -2
  205. package/themes/original/src/components/shared/OIcon.tsx +8 -1
  206. package/themes/original/src/components/shared/OInput.tsx +16 -2
  207. package/themes/original/src/components/shared/OModal.tsx +3 -3
  208. package/themes/original/src/layouts/Container.tsx +13 -9
  209. package/themes/original/src/types/index.tsx +36 -9
  210. package/themes/original/src/utils/index.tsx +375 -58
  211. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -10,6 +10,7 @@ import {
10
10
  useConfig
11
11
  } from 'ordering-components/native';
12
12
  import { useTheme } from 'styled-components/native';
13
+ import { showLocation } from 'react-native-map-link';
13
14
  import {
14
15
  OrderDetailsContainer,
15
16
  Header,
@@ -39,7 +40,7 @@ import { ProductItemAccordion } from '../ProductItemAccordion';
39
40
  import { TouchableOpacity } from 'react-native-gesture-handler';
40
41
  import { OrderDetailsParams } from '../../types';
41
42
  import { GoogleMap } from '../GoogleMap';
42
- import { verifyDecimals } from '../../utils';
43
+ import { verifyDecimals, getOrderStatus } from '../../utils';
43
44
  import { OSRow } from '../OrderSummary/styles';
44
45
  import AntIcon from 'react-native-vector-icons/AntDesign'
45
46
  import { TaxInformation } from '../TaxInformation';
@@ -47,6 +48,8 @@ import { Placeholder, PlaceholderLine } from 'rn-placeholder';
47
48
  import NavBar from '../NavBar'
48
49
  import { OrderHistory } from './OrderHistory';
49
50
  import { PlaceSpot } from '../PlaceSpot'
51
+ import { OrderEta } from './OrderEta'
52
+ import { SendGiftCard } from '../GiftCard/SendGiftCard'
50
53
  export const OrderDetailsUI = (props: OrderDetailsParams) => {
51
54
  const {
52
55
  navigation,
@@ -110,12 +113,18 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
110
113
  const [{ carts }] = useOrder()
111
114
 
112
115
  const [isReviewed, setIsReviewed] = useState(false)
116
+ const [isGiftCardSent, setIsGiftCardSent] = useState(false)
113
117
  const [isOrderHistory, setIsOrderHistory] = useState(false)
114
118
  const [openTaxModal, setOpenTaxModal] = useState<any>({ open: false, tax: null, type: '' })
115
119
  const [refreshing] = useState(false);
116
120
  const { order, businessData } = props.order;
117
121
  const mapValidStatuses = [9, 19, 23]
118
122
  const placeSpotTypes = [3, 4, 5]
123
+ const directionTypes = [2, 3, 4, 5]
124
+ const activeStatus = [0, 3, 4, 7, 8, 9, 13, 14, 18, 19, 20, 21, 22, 23]
125
+ const enabledPoweredByOrdering = configs?.powered_by_ordering_module?.value
126
+ const hideDeliveryDate = theme?.confirmation?.components?.order?.components?.date?.hidden
127
+ const isGiftCardOrder = !order?.business_id
119
128
 
120
129
  const walletName: any = {
121
130
  cash: {
@@ -126,205 +135,6 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
126
135
  }
127
136
  }
128
137
 
129
- const getOrderStatus = (s: string) => {
130
- const status = parseInt(s);
131
- const orderStatus = [
132
- {
133
- key: 0,
134
- value: t('PENDING', 'Pending'),
135
- slug: 'PENDING',
136
- percentage: 0.25,
137
- image: theme.images.order.status0,
138
- },
139
- {
140
- key: 1,
141
- value: t('COMPLETED', 'Completed'),
142
- slug: 'COMPLETED',
143
- percentage: 1,
144
- image: theme.images.order.status1,
145
- },
146
- {
147
- key: 2,
148
- value: t('REJECTED', 'Rejected'),
149
- slug: 'REJECTED',
150
- percentage: 0,
151
- image: theme.images.order.status2,
152
- },
153
- {
154
- key: 3,
155
- value: t('DRIVER_IN_BUSINESS', 'Driver in business'),
156
- slug: 'DRIVER_IN_BUSINESS',
157
- percentage: 0.6,
158
- image: theme.images.order.status3,
159
- },
160
- {
161
- key: 4,
162
- value: t('PREPARATION_COMPLETED', 'Preparation Completed'),
163
- slug: 'PREPARATION_COMPLETED',
164
- percentage: 0.7,
165
- image: theme.images.order.status4,
166
- },
167
- {
168
- key: 5,
169
- value: t('REJECTED_BY_BUSINESS', 'Rejected by business'),
170
- slug: 'REJECTED_BY_BUSINESS',
171
- percentage: 0,
172
- image: theme.images.order.status5,
173
- },
174
- {
175
- key: 6,
176
- value: t('REJECTED_BY_DRIVER', 'Rejected by Driver'),
177
- slug: 'REJECTED_BY_DRIVER',
178
- percentage: 0,
179
- image: theme.images.order.status6,
180
- },
181
- {
182
- key: 7,
183
- value: t('ACCEPTED_BY_BUSINESS', 'Accepted by business'),
184
- slug: 'ACCEPTED_BY_BUSINESS',
185
- percentage: 0.35,
186
- image: theme.images.order.status7,
187
- },
188
- {
189
- key: 8,
190
- value: t('ACCEPTED_BY_DRIVER', 'Accepted by driver'),
191
- slug: 'ACCEPTED_BY_DRIVER',
192
- percentage: 0.45,
193
- image: theme.images.order.status8,
194
- },
195
- {
196
- key: 9,
197
- value: t('PICK_UP_COMPLETED_BY_DRIVER', 'Pick up completed by driver'),
198
- slug: 'PICK_UP_COMPLETED_BY_DRIVER',
199
- percentage: 0.8,
200
- image: theme.images.order.status9,
201
- },
202
- {
203
- key: 10,
204
- value: t('PICK_UP_FAILED_BY_DRIVER', 'Pick up Failed by driver'),
205
- slug: 'PICK_UP_FAILED_BY_DRIVER',
206
- percentage: 0,
207
- image: theme.images.order.status10,
208
- },
209
- {
210
- key: 11,
211
- value: t(
212
- 'DELIVERY_COMPLETED_BY_DRIVER',
213
- 'Delivery completed by driver',
214
- ),
215
- slug: 'DELIVERY_COMPLETED_BY_DRIVER',
216
- percentage: 1,
217
- image: theme.images.order.status11,
218
- },
219
- {
220
- key: 12,
221
- value: t('DELIVERY_FAILED_BY_DRIVER', 'Delivery Failed by driver'),
222
- slug: 'DELIVERY_FAILED_BY_DRIVER',
223
- percentage: 0,
224
- image: theme.images.order.status12,
225
- },
226
- {
227
- key: 13,
228
- value: t('PREORDER', 'PreOrder'),
229
- slug: 'PREORDER',
230
- percentage: 0,
231
- image: theme.images.order.status13,
232
- },
233
- {
234
- key: 14,
235
- value: t('ORDER_NOT_READY', 'Order not ready'),
236
- slug: 'ORDER_NOT_READY',
237
- percentage: 0,
238
- image: theme.images.order.status13,
239
- },
240
- {
241
- key: 15,
242
- value: t(
243
- 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
244
- 'Order picked up completed by customer',
245
- ),
246
- slug: 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
247
- percentage: 100,
248
- image: theme.images.order.status1,
249
- },
250
- {
251
- key: 16,
252
- value: t('CANCELLED_BY_CUSTOMER', 'Cancelled by customer'),
253
- slug: 'CANCELLED_BY_CUSTOMER',
254
- percentage: 0,
255
- image: theme.images.order.status2,
256
- },
257
- {
258
- key: 17,
259
- value: t(
260
- 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
261
- 'Order not picked up by customer',
262
- ),
263
- slug: 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
264
- percentage: 0,
265
- image: theme.images.order.status2,
266
- },
267
- {
268
- key: 18,
269
- value: t(
270
- 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
271
- 'Driver almost arrived to business',
272
- ),
273
- slug: 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
274
- percentage: 0.15,
275
- image: theme.images.order.status3,
276
- },
277
- {
278
- key: 19,
279
- value: t(
280
- 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER',
281
- 'Driver almost arrived to customer',
282
- ),
283
- slug: 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER',
284
- percentage: 0.9,
285
- image: theme.images.order.status11,
286
- },
287
- {
288
- key: 20,
289
- value: t(
290
- 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
291
- 'Customer almost arrived to business',
292
- ),
293
- slug: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
294
- percentage: 90,
295
- image: theme.images.order.status7,
296
- },
297
- {
298
- key: 21,
299
- value: t(
300
- 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
301
- 'Customer arrived to business',
302
- ),
303
- slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
304
- percentage: 95,
305
- image: theme.images.order.status7,
306
- },
307
- {
308
- key: 22,
309
- value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver'),
310
- slug: 'ORDER_LOOKING_FOR_DRIVER',
311
- percentage: 35,
312
- image: theme.images.order.status8
313
- },
314
- {
315
- key: 23,
316
- value: t('ORDER_DRIVER_ON_WAY', 'Driver on way'),
317
- slug: 'ORDER_DRIVER_ON_WAY',
318
- percentage: 45,
319
- image: theme.images.order.status8
320
- }
321
- ];
322
-
323
- const objectStatus = orderStatus.find((o) => o.key === status);
324
-
325
- return objectStatus && objectStatus;
326
- };
327
-
328
138
  const handleGoToMessages = (type: string) => {
329
139
  readMessages && readMessages();
330
140
  navigation.navigate(
@@ -591,161 +401,194 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
591
401
  style={{ marginTop: Platform.OS === 'ios' ? 0 : 20 }}
592
402
  titleWrapStyle={{ paddingHorizontal: 0 }}
593
403
  titleStyle={{ marginRight: 0, marginLeft: 0 }}
594
- subTitle={<OText size={12} lineHeight={18} color={theme.colors.textNormal}>
595
- {order?.delivery_datetime_utc
596
- ? parseDate(order?.delivery_datetime_utc)
597
- : parseDate(order?.delivery_datetime, { utc: false })}
404
+ subTitle={!hideDeliveryDate && <OText size={12} lineHeight={18} color={theme.colors.textNormal}>
405
+ {activeStatus.includes(order?.status) ? (
406
+ <OrderEta order={order} />
407
+ ) : (
408
+ parseDate(order?.reporting_data?.at[`status:${order.status}`])
409
+ )}
598
410
  </OText>}
599
411
  />
600
- <OrderInfo>
601
- <OrderData>
602
- <View style={styles.linkWrapper}>
603
- {
604
- (
605
- parseInt(order?.status) === 1 ||
606
- parseInt(order?.status) === 11 ||
607
- parseInt(order?.status) === 15
608
- ) && !order.review && !isReviewed && (
609
- <TouchableOpacity
610
- activeOpacity={0.7}
611
- style={{ marginTop: 6, marginRight: 10 }}
612
- onPress={() => handleClickOrderReview(order)}
613
- >
614
- <OText
615
- size={10}
616
- lineHeight={15}
617
- color={theme.colors.primary}
618
- style={{ textDecorationLine: 'underline' }}
412
+ {enabledPoweredByOrdering && (
413
+ <View style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
414
+ <OText>
415
+ Powered By Ordering.co
416
+ </OText>
417
+ </View>
418
+ )}
419
+ {!isGiftCardOrder && (
420
+ <OrderInfo>
421
+ <OrderData>
422
+ <View style={styles.linkWrapper}>
423
+ {
424
+ (
425
+ parseInt(order?.status) === 1 ||
426
+ parseInt(order?.status) === 11 ||
427
+ parseInt(order?.status) === 15
428
+ ) && !order.review && !isReviewed && (
429
+ <TouchableOpacity
430
+ activeOpacity={0.7}
431
+ style={{ marginTop: 6, marginRight: 10 }}
432
+ onPress={() => handleClickOrderReview(order)}
619
433
  >
620
- {t('REVIEW_YOUR_ORDER', 'Review your order')}
621
- </OText>
622
- </TouchableOpacity>
623
- )}
624
- <TouchableOpacity
625
- activeOpacity={0.7}
626
- style={{ marginTop: 6 }}
627
- onPress={() => setIsOrderHistory(true)}
628
-
629
- >
630
- <OText
631
- size={10}
632
- lineHeight={15}
633
- color={theme.colors.primary}
634
- style={{ textDecorationLine: 'underline', textTransform: 'capitalize' }}
434
+ <OText
435
+ size={12}
436
+ lineHeight={15}
437
+ color={theme.colors.primary}
438
+ style={{ textDecorationLine: 'underline' }}
439
+ >
440
+ {t('REVIEW_YOUR_ORDER', 'Review your order')}
441
+ </OText>
442
+ </TouchableOpacity>
443
+ )}
444
+ <TouchableOpacity
445
+ activeOpacity={0.7}
446
+ style={{ marginTop: 6 }}
447
+ onPress={() => setIsOrderHistory(true)}
448
+
635
449
  >
636
- {t('VIEW_DETAILS', 'View Details')}
637
- </OText>
638
- </TouchableOpacity>
639
- </View>
640
-
641
- <StaturBar>
642
- <LinearGradient
643
- start={{ x: 0.0, y: 0.0 }}
644
- end={{
645
- x: getOrderStatus(order?.status)?.percentage || 0,
646
- y: 0,
647
- }}
648
- locations={[0.9999, 0.9999]}
649
- colors={[theme.colors.primary, theme.colors.backgroundGray100]}
650
- style={styles.statusBar}
651
- />
652
- </StaturBar>
450
+ <OText
451
+ size={12}
452
+ lineHeight={15}
453
+ color={theme.colors.primary}
454
+ style={{ textDecorationLine: 'underline', textTransform: 'capitalize' }}
455
+ >
456
+ {t('VIEW_DETAILS', 'View Details')}
457
+ </OText>
458
+ </TouchableOpacity>
459
+ </View>
460
+
461
+ <StaturBar>
462
+ <LinearGradient
463
+ start={{ x: 0.0, y: 0.0 }}
464
+ end={{
465
+ x: getOrderStatus(order?.status)?.percentage || 0,
466
+ y: 0,
467
+ }}
468
+ locations={[0.9999, 0.9999]}
469
+ colors={[theme.colors.primary, theme.colors.backgroundGray100]}
470
+ style={styles.statusBar}
471
+ />
472
+ </StaturBar>
473
+ <OText
474
+ size={16}
475
+ lineHeight={24}
476
+ weight={'600'}
477
+ color={theme.colors.textNormal}>
478
+ {getOrderStatus(order?.status)?.value}
479
+ </OText>
480
+ </OrderData>
481
+ <View
482
+ style={{
483
+ height: 8,
484
+ backgroundColor: theme.colors.backgroundGray100,
485
+ marginTop: 18,
486
+ marginHorizontal: -40,
487
+ }}
488
+ />
489
+ </OrderInfo>
490
+ )}
491
+ </Header>
492
+ <OrderContent>
493
+ {!isGiftCardOrder && (
494
+ <OrderBusiness>
653
495
  <OText
654
496
  size={16}
655
497
  lineHeight={24}
656
- weight={'600'}
657
- color={theme.colors.textNormal}>
658
- {getOrderStatus(order?.status)?.value}
498
+ weight={'500'}
499
+ color={theme.colors.textNormal}
500
+ mBottom={12}>
501
+ {t('FROM', 'From')}
659
502
  </OText>
660
- </OrderData>
661
- <View
662
- style={{
663
- height: 8,
664
- backgroundColor: theme.colors.backgroundGray100,
665
- marginTop: 18,
666
- marginHorizontal: -40,
667
- }}
668
- />
669
- </OrderInfo>
670
- </Header>
671
- <OrderContent>
672
- <OrderBusiness>
673
- <OText
674
- size={16}
675
- lineHeight={24}
676
- weight={'500'}
677
- color={theme.colors.textNormal}
678
- mBottom={12}>
679
- {t('FROM', 'From')}
680
- </OText>
681
- <View
682
- style={{
683
- display: 'flex',
684
- flexDirection: 'column',
685
- alignItems: 'flex-start',
686
- }}>
687
503
  <View
688
504
  style={{
689
- flexDirection: 'row',
690
- alignItems: 'center',
691
- justifyContent: 'space-between',
505
+ display: 'flex',
506
+ flexDirection: 'column',
507
+ alignItems: 'flex-start',
692
508
  }}>
693
- <OText
694
- size={13}
695
- lineHeight={20}
696
- color={theme.colors.textNormal}
697
- style={{ flexGrow: 1, flexBasis: '80%' }}>
698
- {order?.business?.name}
699
- </OText>
700
- <Icons>
701
- {!!order?.business?.cellphone && (
509
+ <View
510
+ style={{
511
+ flexDirection: 'row',
512
+ alignItems: 'center',
513
+ justifyContent: 'space-between',
514
+ }}>
515
+ <OText
516
+ size={13}
517
+ lineHeight={20}
518
+ color={theme.colors.textNormal}
519
+ style={{ flexGrow: 1, flexBasis: '80%' }}>
520
+ {order?.business?.name}
521
+ </OText>
522
+ <Icons>
523
+ {!!order?.business?.cellphone && (
524
+ <TouchableOpacity
525
+ onPress={() => order?.business?.cellphone &&
526
+ Linking.openURL(`tel:${order?.business?.cellphone}`)
527
+ }
528
+ style={{ paddingEnd: 5 }}
529
+ >
530
+ <OIcon
531
+ src={theme.images.general.phone}
532
+ width={16}
533
+ color={theme.colors.disabled}
534
+ />
535
+ </TouchableOpacity>
536
+ )}
702
537
  <TouchableOpacity
703
- onPress={() => order?.business?.cellphone &&
704
- Linking.openURL(`tel:${order?.business?.cellphone}`)
705
- }
706
- style={{ paddingEnd: 5 }}
707
- >
538
+ style={{ paddingStart: 5 }}
539
+ onPress={() => handleGoToMessages('business')}>
708
540
  <OIcon
709
- src={theme.images.general.phone}
541
+ src={theme.images.general.chat}
710
542
  width={16}
711
543
  color={theme.colors.disabled}
712
544
  />
713
545
  </TouchableOpacity>
714
- )}
715
- <TouchableOpacity
716
- style={{ paddingStart: 5 }}
717
- onPress={() => handleGoToMessages('business')}>
718
- <OIcon
719
- src={theme.images.general.chat}
720
- width={16}
721
- color={theme.colors.disabled}
722
- />
723
- </TouchableOpacity>
724
- </Icons>
725
- </View>
726
- <OText
727
- size={12}
728
- lineHeight={18}
729
- color={theme.colors.textNormal}
730
- mBottom={2}>
731
- {order?.business?.email}
732
- </OText>
733
- {!!order?.business?.cellphone && (
546
+ </Icons>
547
+ </View>
734
548
  <OText
735
549
  size={12}
736
550
  lineHeight={18}
737
551
  color={theme.colors.textNormal}
738
552
  mBottom={2}>
739
- {order?.business?.cellphone}
553
+ {order?.business?.email}
554
+ </OText>
555
+ {!!order?.business?.cellphone && (
556
+ <OText
557
+ size={12}
558
+ lineHeight={18}
559
+ color={theme.colors.textNormal}
560
+ mBottom={2}>
561
+ {order?.business?.cellphone}
562
+ </OText>
563
+ )}
564
+ <OText size={12} lineHeight={18} color={theme.colors.textNormal}>
565
+ {order?.business?.address}
740
566
  </OText>
567
+ </View>
568
+ {directionTypes.includes(order?.delivery_type) && (
569
+ <OButton
570
+ text={t('GET_DIRECTIONS', 'Get Directions')}
571
+ imgRightSrc=''
572
+ textStyle={{ color: theme.colors.white }}
573
+ style={{
574
+ alignSelf: 'center',
575
+ borderRadius: 10,
576
+ marginTop: 30
577
+ }}
578
+ onClick={() => showLocation({
579
+ latitude: order?.business?.location?.lat,
580
+ longitude: order?.business?.location?.lng,
581
+ naverCallerName: 'com.reactnativeappstemplate5',
582
+ dialogTitle: t('GET_DIRECTIONS', 'Get Directions'),
583
+ dialogMessage: t('WHAT_APP_WOULD_YOU_USE', 'What app would you like to use?'),
584
+ cancelText: t('CANCEL', 'Cancel'),
585
+ })}
586
+ />
741
587
  )}
742
- <OText size={12} lineHeight={18} color={theme.colors.textNormal}>
743
- {order?.business?.address}
744
- </OText>
745
- </View>
746
- </OrderBusiness>
588
+ </OrderBusiness>
589
+ )}
747
590
 
748
- {placeSpotTypes.includes(order?.delivery_type) && (
591
+ {!isGiftCardOrder && placeSpotTypes.includes(order?.delivery_type) && (
749
592
  <PlaceSpotWrapper>
750
593
  <PlaceSpot
751
594
  isInputMode
@@ -771,7 +614,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
771
614
  weight={'500'}
772
615
  color={theme.colors.textNormal}
773
616
  mBottom={12}>
774
- {t('TO', 'To')}
617
+ {isGiftCardOrder ? t('CUSTOMER', 'Customer') : t('TO', 'To')}
775
618
  </OText>
776
619
  <Customer>
777
620
  <InfoBlock>
@@ -800,7 +643,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
800
643
  )}
801
644
  </InfoBlock>
802
645
  </Customer>
803
- {order?.delivery_option !== undefined && order?.delivery_type === 1 && (
646
+ {!isGiftCardOrder && order?.delivery_option !== undefined && order?.delivery_type === 1 && (
804
647
  <View style={{ marginTop: 15 }}>
805
648
  <OText size={16} style={{ textAlign: 'left' }} color={theme.colors.textNormal}>
806
649
  {t('DELIVERY_PREFERENCE', 'Delivery Preference')}
@@ -822,7 +665,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
822
665
  <>
823
666
  {order?.driver?.location && mapValidStatuses.includes(parseInt(order?.status)) && (
824
667
  <Map>
825
- <GoogleMap
668
+ <GoogleMap
826
669
  location={typeof order?.driver?.location?.location === 'string'
827
670
  ? {
828
671
  lat: parseFloat(driverLocationString[0]),
@@ -982,7 +825,9 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
982
825
  </Table>
983
826
  ))
984
827
  }
985
- <Divider />
828
+ {!isGiftCardOrder && (
829
+ <Divider />
830
+ )}
986
831
  {order?.summary?.subtotal_with_discount > 0 && order?.summary?.discount > 0 && order?.summary?.total >= 0 && (
987
832
  <Table>
988
833
  <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{t('SUBTOTAL_WITH_DISCOUNT', 'Subtotal with discount')}</OText>
@@ -1104,8 +949,8 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
1104
949
  )}
1105
950
  <Total>
1106
951
  <Table>
1107
- <OText size={20} lineHeight={30} weight={'600'} color={theme.colors.textNormal}>{t('TOTAL', 'Total')}</OText>
1108
- <OText size={20} lineHeight={30} weight={'600'} color={theme.colors.textNormal}>
952
+ <OText size={14} style={{ fontWeight: 'bold' }} color={theme.colors.textNormal}>{t('TOTAL', 'Total')}</OText>
953
+ <OText size={14} style={{ fontWeight: 'bold' }} color={theme.colors.textNormal}>
1109
954
  {parsePrice(order?.summary?.total ?? order?.total)}
1110
955
  </OText>
1111
956
  </Table>
@@ -1139,13 +984,13 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
1139
984
  <OText>
1140
985
  {event?.wallet_event
1141
986
  ? walletName[event?.wallet_event?.wallet?.type]?.name
1142
- : event?.paymethod?.name}
987
+ : t(event?.paymethod?.name.toUpperCase()?.replace(/ /g, '_'), event?.paymethod?.name)}
1143
988
  </OText>
1144
- {event?.data?.charge_id && (
989
+ {/* {event?.data?.charge_id && (
1145
990
  <OText>
1146
991
  {`${t('CODE', 'Code')}: ${event?.data?.charge_id}`}
1147
992
  </OText>
1148
- )}
993
+ )} */}
1149
994
  </View>
1150
995
  <OText>
1151
996
  -{parsePrice(event.amount, { isTruncable: true })}
@@ -1156,6 +1001,23 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
1156
1001
  </View>
1157
1002
  )}
1158
1003
  </OrderBill>
1004
+ {isGiftCardOrder && order?.products[0]?.gift_card?.status === 'pending' && !isGiftCardSent && (
1005
+ <>
1006
+ <View
1007
+ style={{
1008
+ height: 8,
1009
+ backgroundColor: theme.colors.backgroundGray100,
1010
+ marginTop: 10,
1011
+ marginHorizontal: -40,
1012
+ marginBottom: 20
1013
+ }}
1014
+ />
1015
+ <SendGiftCard
1016
+ giftCardId={order?.products[0]?.gift_card?.id}
1017
+ setIsGiftCardSent={setIsGiftCardSent}
1018
+ />
1019
+ </>
1020
+ )}
1159
1021
  </OrderContent>
1160
1022
  </>
1161
1023
  )}
@@ -5,7 +5,6 @@ export const OrderDetailsContainer = styled.ScrollView`
5
5
  `
6
6
 
7
7
  export const NavBack = styled.TouchableOpacity`
8
-
9
8
  `
10
9
 
11
10