ordering-ui-react-native 0.17.57 → 0.17.58-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 (212) 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 +29 -8
  6. package/src/components/PhoneInputNumber/index.tsx +6 -2
  7. package/src/components/StripeMethodForm/index.tsx +136 -102
  8. package/src/components/VerifyPhone/styles.tsx +1 -2
  9. package/src/components/shared/OToast.tsx +4 -4
  10. package/src/types/index.tsx +5 -0
  11. package/src/utils/index.tsx +5 -0
  12. package/themes/business/index.tsx +2 -0
  13. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +265 -240
  14. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
  15. package/themes/business/src/components/BusinessController/index.tsx +0 -1
  16. package/themes/business/src/components/Chat/index.tsx +125 -113
  17. package/themes/business/src/components/DriverMap/index.tsx +17 -6
  18. package/themes/business/src/components/DriverSchedule/index.tsx +42 -5
  19. package/themes/business/src/components/GoogleMap/index.tsx +58 -57
  20. package/themes/business/src/components/LoginForm/Otp/index.tsx +31 -3
  21. package/themes/business/src/components/LoginForm/index.tsx +15 -22
  22. package/themes/business/src/components/MapView/index.tsx +10 -10
  23. package/themes/business/src/components/NewOrderNotification/index.tsx +35 -21
  24. package/themes/business/src/components/NotFoundSource/index.tsx +2 -2
  25. package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
  26. package/themes/business/src/components/OrderDetails/Delivery.tsx +191 -6
  27. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +93 -50
  28. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +64 -63
  29. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +195 -0
  30. package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
  31. package/themes/business/src/components/OrderMessage/index.tsx +19 -18
  32. package/themes/business/src/components/OrderSummary/index.tsx +113 -121
  33. package/themes/business/src/components/OrdersOption/index.tsx +32 -75
  34. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +249 -0
  35. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
  36. package/themes/business/src/components/PreviousOrders/index.tsx +445 -243
  37. package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
  38. package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
  39. package/themes/business/src/components/ReviewCustomer/index.tsx +30 -15
  40. package/themes/business/src/components/StoresList/index.tsx +3 -4
  41. package/themes/business/src/components/UserProfileForm/index.tsx +11 -13
  42. package/themes/business/src/components/shared/OLink.tsx +33 -13
  43. package/themes/business/src/components/shared/OModal.tsx +16 -9
  44. package/themes/business/src/components/shared/OText.tsx +8 -2
  45. package/themes/business/src/types/index.tsx +28 -12
  46. package/themes/business/src/utils/index.tsx +29 -2
  47. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  48. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  49. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  50. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  51. package/themes/kiosk/src/components/Intro/index.tsx +16 -1
  52. package/themes/kiosk/src/components/LoginForm/index.tsx +7 -9
  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 +2 -2
  57. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  58. package/themes/original/index.tsx +4 -0
  59. package/themes/original/src/components/AddressDetails/index.tsx +28 -10
  60. package/themes/original/src/components/AddressForm/index.tsx +68 -40
  61. package/themes/original/src/components/AddressList/index.tsx +27 -22
  62. package/themes/original/src/components/AddressList/styles.tsx +4 -2
  63. package/themes/original/src/components/AnalyticsSegment/index.tsx +193 -10
  64. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  65. package/themes/original/src/components/AppleLogin/styles.tsx +3 -1
  66. package/themes/original/src/components/BusinessBasicInformation/index.tsx +153 -96
  67. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +10 -12
  68. package/themes/original/src/components/BusinessController/index.tsx +122 -68
  69. package/themes/original/src/components/BusinessController/styles.tsx +23 -4
  70. package/themes/original/src/components/BusinessFeaturedController/index.tsx +21 -54
  71. package/themes/original/src/components/BusinessFeaturedController/styles.tsx +8 -0
  72. package/themes/original/src/components/BusinessInformation/index.tsx +110 -108
  73. package/themes/original/src/components/BusinessItemAccordion/index.tsx +15 -20
  74. package/themes/original/src/components/BusinessListingSearch/index.tsx +352 -326
  75. package/themes/original/src/components/BusinessListingSearch/styles.tsx +0 -18
  76. package/themes/original/src/components/BusinessPreorder/index.tsx +103 -19
  77. package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -2
  78. package/themes/original/src/components/BusinessProductsList/index.tsx +25 -15
  79. package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
  80. package/themes/original/src/components/BusinessProductsListing/UpsellingRedirect.tsx +1 -1
  81. package/themes/original/src/components/BusinessProductsListing/index.tsx +683 -555
  82. package/themes/original/src/components/BusinessProductsListing/styles.tsx +2 -2
  83. package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
  84. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  85. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +96 -91
  86. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -4
  87. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  88. package/themes/original/src/components/Cart/index.tsx +77 -50
  89. package/themes/original/src/components/CartContent/index.tsx +117 -20
  90. package/themes/original/src/components/CartContent/styles.tsx +17 -7
  91. package/themes/original/src/components/Checkout/index.tsx +359 -171
  92. package/themes/original/src/components/Checkout/styles.tsx +4 -2
  93. package/themes/original/src/components/CitiesControl/index.tsx +89 -0
  94. package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
  95. package/themes/original/src/components/CouponControl/index.tsx +10 -3
  96. package/themes/original/src/components/DriverTips/index.tsx +52 -34
  97. package/themes/original/src/components/FacebookLogin/styles.tsx +3 -1
  98. package/themes/original/src/components/Favorite/index.tsx +8 -9
  99. package/themes/original/src/components/Favorite/styles.tsx +1 -1
  100. package/themes/original/src/components/FavoriteList/index.tsx +51 -80
  101. package/themes/original/src/components/FloatingButton/index.tsx +1 -2
  102. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  103. package/themes/original/src/components/GPSButton/index.tsx +6 -4
  104. package/themes/original/src/components/GPSButton/styles.ts +3 -3
  105. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +96 -0
  106. package/themes/original/src/components/GiftCard/GiftCardUI/styles.tsx +5 -0
  107. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +100 -0
  108. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +8 -0
  109. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +191 -0
  110. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +8 -0
  111. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +165 -0
  112. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +9 -0
  113. package/themes/original/src/components/GoogleLogin/styles.tsx +1 -1
  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 +10 -31
  117. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +5 -3
  118. package/themes/original/src/components/HelpGuide/index.tsx +6 -6
  119. package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
  120. package/themes/original/src/components/HelpOrder/index.tsx +6 -15
  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/LastOrder/index.tsx +1 -34
  124. package/themes/original/src/components/LoginForm/Otp/index.tsx +55 -13
  125. package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
  126. package/themes/original/src/components/LoginForm/index.tsx +60 -35
  127. package/themes/original/src/components/LottieAnimation/index.tsx +89 -55
  128. package/themes/original/src/components/MessageListing/index.tsx +16 -42
  129. package/themes/original/src/components/Messages/index.tsx +32 -10
  130. package/themes/original/src/components/MomentOption/index.tsx +195 -90
  131. package/themes/original/src/components/MomentSelector/index.tsx +1 -1
  132. package/themes/original/src/components/MultiCart/index.tsx +50 -0
  133. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +153 -49
  134. package/themes/original/src/components/MultiCheckout/index.tsx +308 -88
  135. package/themes/original/src/components/MultiCheckout/styles.tsx +3 -1
  136. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
  137. package/themes/original/src/components/MultiOrdersDetails/index.tsx +68 -21
  138. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
  139. package/themes/original/src/components/MyOrders/index.tsx +65 -52
  140. package/themes/original/src/components/NavBar/index.tsx +18 -18
  141. package/themes/original/src/components/NotFoundSource/index.tsx +14 -10
  142. package/themes/original/src/components/Notifications/index.tsx +46 -50
  143. package/themes/original/src/components/Notifications/styles.tsx +6 -3
  144. package/themes/original/src/components/OrderDetails/OrderEta.tsx +76 -0
  145. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +15 -3
  146. package/themes/original/src/components/OrderDetails/index.tsx +190 -358
  147. package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
  148. package/themes/original/src/components/OrderItAgain/index.tsx +3 -1
  149. package/themes/original/src/components/OrderProgress/index.tsx +33 -59
  150. package/themes/original/src/components/OrderSummary/index.tsx +85 -57
  151. package/themes/original/src/components/OrderTypeSelector/index.tsx +1 -1
  152. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +24 -19
  153. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +14 -14
  154. package/themes/original/src/components/OrdersOption/index.tsx +78 -67
  155. package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
  156. package/themes/original/src/components/PageBanner/index.tsx +106 -31
  157. package/themes/original/src/components/PageBanner/styles.tsx +4 -4
  158. package/themes/original/src/components/PaymentOptionCard/index.tsx +180 -0
  159. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
  160. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  161. package/themes/original/src/components/PaymentOptions/index.tsx +68 -9
  162. package/themes/original/src/components/PhoneInputNumber/index.tsx +3 -3
  163. package/themes/original/src/components/PlaceSpot/index.tsx +12 -6
  164. package/themes/original/src/components/ProductForm/index.tsx +109 -33
  165. package/themes/original/src/components/ProductForm/styles.tsx +5 -7
  166. package/themes/original/src/components/ProductItemAccordion/index.tsx +22 -19
  167. package/themes/original/src/components/ProductOptionSubOption/index.tsx +24 -14
  168. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +3 -4
  169. package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
  170. package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -50
  171. package/themes/original/src/components/ProfessionalProfile/index.tsx +36 -7
  172. package/themes/original/src/components/Promotions/index.tsx +234 -220
  173. package/themes/original/src/components/Promotions/styles.tsx +10 -3
  174. package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
  175. package/themes/original/src/components/ReviewOrder/index.tsx +26 -9
  176. package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
  177. package/themes/original/src/components/ReviewProducts/index.tsx +23 -11
  178. package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
  179. package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
  180. package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
  181. package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
  182. package/themes/original/src/components/ServiceForm/index.tsx +66 -17
  183. package/themes/original/src/components/Sessions/index.tsx +11 -8
  184. package/themes/original/src/components/Sessions/styles.tsx +5 -0
  185. package/themes/original/src/components/SignupForm/index.tsx +44 -29
  186. package/themes/original/src/components/SingleOrderCard/index.tsx +130 -52
  187. package/themes/original/src/components/SingleOrderCard/styles.tsx +11 -2
  188. package/themes/original/src/components/SingleProductCard/index.tsx +71 -34
  189. package/themes/original/src/components/SingleProductCard/styles.tsx +21 -4
  190. package/themes/original/src/components/SingleProductReview/styles.tsx +1 -1
  191. package/themes/original/src/components/StripeCardsList/index.tsx +13 -3
  192. package/themes/original/src/components/StripeElementsForm/index.tsx +48 -34
  193. package/themes/original/src/components/UpsellingProducts/index.tsx +238 -224
  194. package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
  195. package/themes/original/src/components/UserDetails/index.tsx +8 -4
  196. package/themes/original/src/components/UserFormDetails/index.tsx +76 -7
  197. package/themes/original/src/components/UserFormDetails/styles.tsx +1 -1
  198. package/themes/original/src/components/UserProfile/index.tsx +88 -79
  199. package/themes/original/src/components/UserProfileForm/index.tsx +27 -29
  200. package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
  201. package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
  202. package/themes/original/src/components/WalletTransactions/index.tsx +3 -3
  203. package/themes/original/src/components/Wallets/index.tsx +67 -24
  204. package/themes/original/src/components/Wallets/styles.tsx +3 -4
  205. package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
  206. package/themes/original/src/components/shared/OButton.tsx +6 -2
  207. package/themes/original/src/components/shared/OInput.tsx +6 -1
  208. package/themes/original/src/components/shared/OModal.tsx +3 -3
  209. package/themes/original/src/layouts/Container.tsx +1 -1
  210. package/themes/original/src/types/index.tsx +41 -11
  211. package/themes/original/src/utils/index.tsx +273 -1
  212. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -40,7 +40,7 @@ import { ProductItemAccordion } from '../ProductItemAccordion';
40
40
  import { TouchableOpacity } from 'react-native-gesture-handler';
41
41
  import { OrderDetailsParams } from '../../types';
42
42
  import { GoogleMap } from '../GoogleMap';
43
- import { verifyDecimals } from '../../utils';
43
+ import { verifyDecimals, getOrderStatus } from '../../utils';
44
44
  import { OSRow } from '../OrderSummary/styles';
45
45
  import AntIcon from 'react-native-vector-icons/AntDesign'
46
46
  import { TaxInformation } from '../TaxInformation';
@@ -48,6 +48,8 @@ import { Placeholder, PlaceholderLine } from 'rn-placeholder';
48
48
  import NavBar from '../NavBar'
49
49
  import { OrderHistory } from './OrderHistory';
50
50
  import { PlaceSpot } from '../PlaceSpot'
51
+ import { OrderEta } from './OrderEta'
52
+ import { SendGiftCard } from '../GiftCard/SendGiftCard'
51
53
  export const OrderDetailsUI = (props: OrderDetailsParams) => {
52
54
  const {
53
55
  navigation,
@@ -111,6 +113,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
111
113
  const [{ carts }] = useOrder()
112
114
 
113
115
  const [isReviewed, setIsReviewed] = useState(false)
116
+ const [isGiftCardSent, setIsGiftCardSent] = useState(false)
114
117
  const [isOrderHistory, setIsOrderHistory] = useState(false)
115
118
  const [openTaxModal, setOpenTaxModal] = useState<any>({ open: false, tax: null, type: '' })
116
119
  const [refreshing] = useState(false);
@@ -118,7 +121,10 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
118
121
  const mapValidStatuses = [9, 19, 23]
119
122
  const placeSpotTypes = [3, 4, 5]
120
123
  const directionTypes = [2, 3, 4, 5]
124
+ const activeStatus = [0, 3, 4, 7, 8, 9, 13, 14, 18, 19, 20, 21, 22, 23]
121
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
122
128
 
123
129
  const walletName: any = {
124
130
  cash: {
@@ -129,205 +135,6 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
129
135
  }
130
136
  }
131
137
 
132
- const getOrderStatus = (s: string) => {
133
- const status = parseInt(s);
134
- const orderStatus = [
135
- {
136
- key: 0,
137
- value: t('PENDING', 'Pending'),
138
- slug: 'PENDING',
139
- percentage: 0.25,
140
- image: theme.images.order.status0,
141
- },
142
- {
143
- key: 1,
144
- value: t('COMPLETED', 'Completed'),
145
- slug: 'COMPLETED',
146
- percentage: 1,
147
- image: theme.images.order.status1,
148
- },
149
- {
150
- key: 2,
151
- value: t('REJECTED', 'Rejected'),
152
- slug: 'REJECTED',
153
- percentage: 0,
154
- image: theme.images.order.status2,
155
- },
156
- {
157
- key: 3,
158
- value: t('DRIVER_IN_BUSINESS', 'Driver in business'),
159
- slug: 'DRIVER_IN_BUSINESS',
160
- percentage: 0.6,
161
- image: theme.images.order.status3,
162
- },
163
- {
164
- key: 4,
165
- value: t('PREPARATION_COMPLETED', 'Preparation Completed'),
166
- slug: 'PREPARATION_COMPLETED',
167
- percentage: 0.7,
168
- image: theme.images.order.status4,
169
- },
170
- {
171
- key: 5,
172
- value: t('REJECTED_BY_BUSINESS', 'Rejected by business'),
173
- slug: 'REJECTED_BY_BUSINESS',
174
- percentage: 0,
175
- image: theme.images.order.status5,
176
- },
177
- {
178
- key: 6,
179
- value: t('REJECTED_BY_DRIVER', 'Rejected by Driver'),
180
- slug: 'REJECTED_BY_DRIVER',
181
- percentage: 0,
182
- image: theme.images.order.status6,
183
- },
184
- {
185
- key: 7,
186
- value: t('ACCEPTED_BY_BUSINESS', 'Accepted by business'),
187
- slug: 'ACCEPTED_BY_BUSINESS',
188
- percentage: 0.35,
189
- image: theme.images.order.status7,
190
- },
191
- {
192
- key: 8,
193
- value: t('ACCEPTED_BY_DRIVER', 'Accepted by driver'),
194
- slug: 'ACCEPTED_BY_DRIVER',
195
- percentage: 0.45,
196
- image: theme.images.order.status8,
197
- },
198
- {
199
- key: 9,
200
- value: t('PICK_UP_COMPLETED_BY_DRIVER', 'Pick up completed by driver'),
201
- slug: 'PICK_UP_COMPLETED_BY_DRIVER',
202
- percentage: 0.8,
203
- image: theme.images.order.status9,
204
- },
205
- {
206
- key: 10,
207
- value: t('PICK_UP_FAILED_BY_DRIVER', 'Pick up Failed by driver'),
208
- slug: 'PICK_UP_FAILED_BY_DRIVER',
209
- percentage: 0,
210
- image: theme.images.order.status10,
211
- },
212
- {
213
- key: 11,
214
- value: t(
215
- 'DELIVERY_COMPLETED_BY_DRIVER',
216
- 'Delivery completed by driver',
217
- ),
218
- slug: 'DELIVERY_COMPLETED_BY_DRIVER',
219
- percentage: 1,
220
- image: theme.images.order.status11,
221
- },
222
- {
223
- key: 12,
224
- value: t('DELIVERY_FAILED_BY_DRIVER', 'Delivery Failed by driver'),
225
- slug: 'DELIVERY_FAILED_BY_DRIVER',
226
- percentage: 0,
227
- image: theme.images.order.status12,
228
- },
229
- {
230
- key: 13,
231
- value: t('PREORDER', 'PreOrder'),
232
- slug: 'PREORDER',
233
- percentage: 0,
234
- image: theme.images.order.status13,
235
- },
236
- {
237
- key: 14,
238
- value: t('ORDER_NOT_READY', 'Order not ready'),
239
- slug: 'ORDER_NOT_READY',
240
- percentage: 0,
241
- image: theme.images.order.status13,
242
- },
243
- {
244
- key: 15,
245
- value: t(
246
- 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
247
- 'Order picked up completed by customer',
248
- ),
249
- slug: 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
250
- percentage: 100,
251
- image: theme.images.order.status1,
252
- },
253
- {
254
- key: 16,
255
- value: t('CANCELLED_BY_CUSTOMER', 'Cancelled by customer'),
256
- slug: 'CANCELLED_BY_CUSTOMER',
257
- percentage: 0,
258
- image: theme.images.order.status2,
259
- },
260
- {
261
- key: 17,
262
- value: t(
263
- 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
264
- 'Order not picked up by customer',
265
- ),
266
- slug: 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
267
- percentage: 0,
268
- image: theme.images.order.status2,
269
- },
270
- {
271
- key: 18,
272
- value: t(
273
- 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
274
- 'Driver almost arrived to business',
275
- ),
276
- slug: 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
277
- percentage: 0.15,
278
- image: theme.images.order.status3,
279
- },
280
- {
281
- key: 19,
282
- value: t(
283
- 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER',
284
- 'Driver almost arrived to customer',
285
- ),
286
- slug: 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER',
287
- percentage: 0.9,
288
- image: theme.images.order.status11,
289
- },
290
- {
291
- key: 20,
292
- value: t(
293
- 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
294
- 'Customer almost arrived to business',
295
- ),
296
- slug: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
297
- percentage: 90,
298
- image: theme.images.order.status7,
299
- },
300
- {
301
- key: 21,
302
- value: t(
303
- 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
304
- 'Customer arrived to business',
305
- ),
306
- slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
307
- percentage: 95,
308
- image: theme.images.order.status7,
309
- },
310
- {
311
- key: 22,
312
- value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver'),
313
- slug: 'ORDER_LOOKING_FOR_DRIVER',
314
- percentage: 35,
315
- image: theme.images.order.status8
316
- },
317
- {
318
- key: 23,
319
- value: t('ORDER_DRIVER_ON_WAY', 'Driver on way'),
320
- slug: 'ORDER_DRIVER_ON_WAY',
321
- percentage: 45,
322
- image: theme.images.order.status8
323
- }
324
- ];
325
-
326
- const objectStatus = orderStatus.find((o) => o.key === status);
327
-
328
- return objectStatus && objectStatus;
329
- };
330
-
331
138
  const handleGoToMessages = (type: string) => {
332
139
  readMessages && readMessages();
333
140
  navigation.navigate(
@@ -594,10 +401,12 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
594
401
  style={{ marginTop: Platform.OS === 'ios' ? 0 : 20 }}
595
402
  titleWrapStyle={{ paddingHorizontal: 0 }}
596
403
  titleStyle={{ marginRight: 0, marginLeft: 0 }}
597
- subTitle={<OText size={12} lineHeight={18} color={theme.colors.textNormal}>
598
- {order?.delivery_datetime_utc
599
- ? parseDate(order?.delivery_datetime_utc)
600
- : 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
+ )}
601
410
  </OText>}
602
411
  />
603
412
  {enabledPoweredByOrdering && (
@@ -607,175 +416,179 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
607
416
  </OText>
608
417
  </View>
609
418
  )}
610
- <OrderInfo>
611
- <OrderData>
612
- <View style={styles.linkWrapper}>
613
- {
614
- (
615
- parseInt(order?.status) === 1 ||
616
- parseInt(order?.status) === 11 ||
617
- parseInt(order?.status) === 15
618
- ) && !order.review && !isReviewed && (
619
- <TouchableOpacity
620
- activeOpacity={0.7}
621
- style={{ marginTop: 6, marginRight: 10 }}
622
- onPress={() => handleClickOrderReview(order)}
623
- >
624
- <OText
625
- size={12}
626
- lineHeight={15}
627
- color={theme.colors.primary}
628
- style={{ textDecorationLine: 'underline' }}
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)}
629
433
  >
630
- {t('REVIEW_YOUR_ORDER', 'Review your order')}
631
- </OText>
632
- </TouchableOpacity>
633
- )}
634
- <TouchableOpacity
635
- activeOpacity={0.7}
636
- style={{ marginTop: 6 }}
637
- onPress={() => setIsOrderHistory(true)}
638
-
639
- >
640
- <OText
641
- size={12}
642
- lineHeight={15}
643
- color={theme.colors.primary}
644
- 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
+
645
449
  >
646
- {t('VIEW_DETAILS', 'View Details')}
647
- </OText>
648
- </TouchableOpacity>
649
- </View>
650
-
651
- <StaturBar>
652
- <LinearGradient
653
- start={{ x: 0.0, y: 0.0 }}
654
- end={{
655
- x: getOrderStatus(order?.status)?.percentage || 0,
656
- y: 0,
657
- }}
658
- locations={[0.9999, 0.9999]}
659
- colors={[theme.colors.primary, theme.colors.backgroundGray100]}
660
- style={styles.statusBar}
661
- />
662
- </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>
663
495
  <OText
664
496
  size={16}
665
497
  lineHeight={24}
666
- weight={'600'}
667
- color={theme.colors.textNormal}>
668
- {getOrderStatus(order?.status)?.value}
498
+ weight={'500'}
499
+ color={theme.colors.textNormal}
500
+ mBottom={12}>
501
+ {t('FROM', 'From')}
669
502
  </OText>
670
- </OrderData>
671
- <View
672
- style={{
673
- height: 8,
674
- backgroundColor: theme.colors.backgroundGray100,
675
- marginTop: 18,
676
- marginHorizontal: -40,
677
- }}
678
- />
679
- </OrderInfo>
680
- </Header>
681
- <OrderContent>
682
- <OrderBusiness>
683
- <OText
684
- size={16}
685
- lineHeight={24}
686
- weight={'500'}
687
- color={theme.colors.textNormal}
688
- mBottom={12}>
689
- {t('FROM', 'From')}
690
- </OText>
691
- <View
692
- style={{
693
- display: 'flex',
694
- flexDirection: 'column',
695
- alignItems: 'flex-start',
696
- }}>
697
503
  <View
698
504
  style={{
699
- flexDirection: 'row',
700
- alignItems: 'center',
701
- justifyContent: 'space-between',
505
+ display: 'flex',
506
+ flexDirection: 'column',
507
+ alignItems: 'flex-start',
702
508
  }}>
703
- <OText
704
- size={13}
705
- lineHeight={20}
706
- color={theme.colors.textNormal}
707
- style={{ flexGrow: 1, flexBasis: '80%' }}>
708
- {order?.business?.name}
709
- </OText>
710
- <Icons>
711
- {!!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
+ )}
712
537
  <TouchableOpacity
713
- onPress={() => order?.business?.cellphone &&
714
- Linking.openURL(`tel:${order?.business?.cellphone}`)
715
- }
716
- style={{ paddingEnd: 5 }}
717
- >
538
+ style={{ paddingStart: 5 }}
539
+ onPress={() => handleGoToMessages('business')}>
718
540
  <OIcon
719
- src={theme.images.general.phone}
541
+ src={theme.images.general.chat}
720
542
  width={16}
721
543
  color={theme.colors.disabled}
722
544
  />
723
545
  </TouchableOpacity>
724
- )}
725
- <TouchableOpacity
726
- style={{ paddingStart: 5 }}
727
- onPress={() => handleGoToMessages('business')}>
728
- <OIcon
729
- src={theme.images.general.chat}
730
- width={16}
731
- color={theme.colors.disabled}
732
- />
733
- </TouchableOpacity>
734
- </Icons>
735
- </View>
736
- <OText
737
- size={12}
738
- lineHeight={18}
739
- color={theme.colors.textNormal}
740
- mBottom={2}>
741
- {order?.business?.email}
742
- </OText>
743
- {!!order?.business?.cellphone && (
546
+ </Icons>
547
+ </View>
744
548
  <OText
745
549
  size={12}
746
550
  lineHeight={18}
747
551
  color={theme.colors.textNormal}
748
552
  mBottom={2}>
749
- {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}
750
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
+ />
751
587
  )}
752
- <OText size={12} lineHeight={18} color={theme.colors.textNormal}>
753
- {order?.business?.address}
754
- </OText>
755
- </View>
756
- {directionTypes.includes(order?.delivery_type) && (
757
- <OButton
758
- text={t('GET_DIRECTIONS', 'Get Directions')}
759
- imgRightSrc=''
760
- textStyle={{ color: theme.colors.white }}
761
- style={{
762
- alignSelf: 'center',
763
- borderRadius: 10,
764
- marginTop: 30
765
- }}
766
- onClick={() => showLocation({
767
- latitude: order?.business?.location?.lat,
768
- longitude: order?.business?.location?.lng,
769
- naverCallerName: 'com.reactnativeappstemplate5',
770
- dialogTitle: t('GET_DIRECTIONS', 'Get Directions'),
771
- dialogMessage: t('WHAT_APP_WOULD_YOU_USE', 'What app would you like to use?'),
772
- cancelText: t('CANCEL', 'Cancel'),
773
- })}
774
- />
775
- )}
776
- </OrderBusiness>
588
+ </OrderBusiness>
589
+ )}
777
590
 
778
- {placeSpotTypes.includes(order?.delivery_type) && (
591
+ {!isGiftCardOrder && placeSpotTypes.includes(order?.delivery_type) && (
779
592
  <PlaceSpotWrapper>
780
593
  <PlaceSpot
781
594
  isInputMode
@@ -801,7 +614,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
801
614
  weight={'500'}
802
615
  color={theme.colors.textNormal}
803
616
  mBottom={12}>
804
- {t('TO', 'To')}
617
+ {isGiftCardOrder ? t('CUSTOMER', 'Customer') : t('TO', 'To')}
805
618
  </OText>
806
619
  <Customer>
807
620
  <InfoBlock>
@@ -830,7 +643,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
830
643
  )}
831
644
  </InfoBlock>
832
645
  </Customer>
833
- {order?.delivery_option !== undefined && order?.delivery_type === 1 && (
646
+ {!isGiftCardOrder && order?.delivery_option !== undefined && order?.delivery_type === 1 && (
834
647
  <View style={{ marginTop: 15 }}>
835
648
  <OText size={16} style={{ textAlign: 'left' }} color={theme.colors.textNormal}>
836
649
  {t('DELIVERY_PREFERENCE', 'Delivery Preference')}
@@ -852,7 +665,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
852
665
  <>
853
666
  {order?.driver?.location && mapValidStatuses.includes(parseInt(order?.status)) && (
854
667
  <Map>
855
- <GoogleMap
668
+ <GoogleMap
856
669
  location={typeof order?.driver?.location?.location === 'string'
857
670
  ? {
858
671
  lat: parseFloat(driverLocationString[0]),
@@ -1012,7 +825,9 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
1012
825
  </Table>
1013
826
  ))
1014
827
  }
1015
- <Divider />
828
+ {!isGiftCardOrder && (
829
+ <Divider />
830
+ )}
1016
831
  {order?.summary?.subtotal_with_discount > 0 && order?.summary?.discount > 0 && order?.summary?.total >= 0 && (
1017
832
  <Table>
1018
833
  <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{t('SUBTOTAL_WITH_DISCOUNT', 'Subtotal with discount')}</OText>
@@ -1094,7 +909,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
1094
909
  </Table>
1095
910
  ))
1096
911
  }
1097
- {order?.summary?.delivery_price > 0 && (
912
+ {typeof order?.summary?.delivery_price === 'number' && (
1098
913
  <Table>
1099
914
  <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{t('DELIVERY_FEE', 'Delivery Fee')}</OText>
1100
915
  <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{parsePrice(order?.summary?.delivery_price)}</OText>
@@ -1169,13 +984,13 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
1169
984
  <OText>
1170
985
  {event?.wallet_event
1171
986
  ? walletName[event?.wallet_event?.wallet?.type]?.name
1172
- : event?.paymethod?.name}
987
+ : t(event?.paymethod?.name.toUpperCase()?.replace(/ /g, '_'), event?.paymethod?.name)}
1173
988
  </OText>
1174
- {event?.data?.charge_id && (
989
+ {/* {event?.data?.charge_id && (
1175
990
  <OText>
1176
991
  {`${t('CODE', 'Code')}: ${event?.data?.charge_id}`}
1177
992
  </OText>
1178
- )}
993
+ )} */}
1179
994
  </View>
1180
995
  <OText>
1181
996
  -{parsePrice(event.amount, { isTruncable: true })}
@@ -1186,6 +1001,23 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
1186
1001
  </View>
1187
1002
  )}
1188
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
+ )}
1189
1021
  </OrderContent>
1190
1022
  </>
1191
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