ordering-ui-react-native 0.17.37 → 0.17.38-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 (214) 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/StripeMethodForm/index.tsx +103 -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 +79 -44
  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 +159 -90
  72. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +9 -7
  73. package/themes/original/src/components/BusinessController/index.tsx +154 -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 +351 -326
  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/UpsellingRedirect.tsx +1 -1
  84. package/themes/original/src/components/BusinessProductsListing/index.tsx +684 -524
  85. package/themes/original/src/components/BusinessProductsListing/styles.tsx +4 -6
  86. package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
  87. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  88. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +106 -79
  89. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
  90. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  91. package/themes/original/src/components/Cart/index.tsx +102 -69
  92. package/themes/original/src/components/CartContent/index.tsx +115 -19
  93. package/themes/original/src/components/CartContent/styles.tsx +17 -7
  94. package/themes/original/src/components/Checkout/index.tsx +375 -179
  95. package/themes/original/src/components/Checkout/styles.tsx +4 -2
  96. package/themes/original/src/components/CitiesControl/index.tsx +89 -0
  97. package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
  98. package/themes/original/src/components/CouponControl/index.tsx +10 -3
  99. package/themes/original/src/components/DriverTips/index.tsx +52 -34
  100. package/themes/original/src/components/Favorite/index.tsx +7 -4
  101. package/themes/original/src/components/Favorite/styles.tsx +1 -1
  102. package/themes/original/src/components/FavoriteList/index.tsx +51 -80
  103. package/themes/original/src/components/FloatingButton/index.tsx +1 -2
  104. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  105. package/themes/original/src/components/GPSButton/index.tsx +6 -4
  106. package/themes/original/src/components/GPSButton/styles.ts +3 -3
  107. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +96 -0
  108. package/themes/original/src/components/GiftCard/GiftCardUI/styles.tsx +5 -0
  109. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +100 -0
  110. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +8 -0
  111. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +191 -0
  112. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +8 -0
  113. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +165 -0
  114. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +9 -0
  115. package/themes/original/src/components/GoogleMap/index.tsx +15 -4
  116. package/themes/original/src/components/Help/index.tsx +8 -8
  117. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +11 -22
  118. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +6 -0
  119. package/themes/original/src/components/HelpGuide/index.tsx +12 -16
  120. package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
  121. package/themes/original/src/components/HelpOrder/index.tsx +12 -25
  122. package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
  123. package/themes/original/src/components/Home/index.tsx +13 -4
  124. package/themes/original/src/components/LastOrder/index.tsx +1 -34
  125. package/themes/original/src/components/LoginForm/Otp/index.tsx +139 -75
  126. package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
  127. package/themes/original/src/components/LoginForm/index.tsx +71 -28
  128. package/themes/original/src/components/LottieAnimation/index.tsx +103 -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 +219 -117
  134. package/themes/original/src/components/MultiCheckout/index.tsx +298 -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 +53 -51
  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 +199 -359
  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 +93 -114
  150. package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
  151. package/themes/original/src/components/OrderSummary/index.tsx +87 -59
  152. package/themes/original/src/components/OrderTypeSelector/index.tsx +1 -1
  153. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +24 -19
  154. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +14 -14
  155. package/themes/original/src/components/OrdersOption/index.tsx +70 -65
  156. package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
  157. package/themes/original/src/components/PageBanner/index.tsx +171 -0
  158. package/themes/original/src/components/PageBanner/styles.tsx +11 -0
  159. package/themes/original/src/components/PaymentOptionCard/index.tsx +180 -0
  160. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
  161. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  162. package/themes/original/src/components/PaymentOptions/index.tsx +64 -7
  163. package/themes/original/src/components/PhoneInputNumber/index.tsx +3 -3
  164. package/themes/original/src/components/PlaceSpot/index.tsx +12 -6
  165. package/themes/original/src/components/ProductForm/index.tsx +223 -232
  166. package/themes/original/src/components/ProductForm/styles.tsx +5 -8
  167. package/themes/original/src/components/ProductItemAccordion/index.tsx +59 -29
  168. package/themes/original/src/components/ProductOptionSubOption/index.tsx +19 -11
  169. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +1 -2
  170. package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
  171. package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -50
  172. package/themes/original/src/components/ProfessionalProfile/index.tsx +36 -7
  173. package/themes/original/src/components/Promotions/index.tsx +234 -220
  174. package/themes/original/src/components/Promotions/styles.tsx +10 -3
  175. package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
  176. package/themes/original/src/components/ReviewOrder/index.tsx +26 -9
  177. package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
  178. package/themes/original/src/components/ReviewProducts/index.tsx +23 -11
  179. package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
  180. package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
  181. package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
  182. package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
  183. package/themes/original/src/components/ServiceForm/index.tsx +74 -19
  184. package/themes/original/src/components/Sessions/index.tsx +11 -8
  185. package/themes/original/src/components/Sessions/styles.tsx +5 -0
  186. package/themes/original/src/components/SignupForm/index.tsx +42 -19
  187. package/themes/original/src/components/SingleOrderCard/index.tsx +156 -65
  188. package/themes/original/src/components/SingleOrderCard/styles.tsx +11 -9
  189. package/themes/original/src/components/SingleProductCard/index.tsx +100 -56
  190. package/themes/original/src/components/SingleProductCard/styles.tsx +22 -13
  191. package/themes/original/src/components/SingleProductReview/styles.tsx +1 -1
  192. package/themes/original/src/components/StripeCardsList/index.tsx +13 -3
  193. package/themes/original/src/components/StripeElementsForm/index.tsx +28 -15
  194. package/themes/original/src/components/UpsellingProducts/index.tsx +238 -224
  195. package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
  196. package/themes/original/src/components/UserDetails/index.tsx +8 -4
  197. package/themes/original/src/components/UserFormDetails/index.tsx +47 -7
  198. package/themes/original/src/components/UserProfile/index.tsx +5 -7
  199. package/themes/original/src/components/UserProfileForm/index.tsx +25 -28
  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 +79 -36
  204. package/themes/original/src/components/Wallets/styles.tsx +5 -4
  205. package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
  206. package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
  207. package/themes/original/src/components/shared/OBottomPopup.tsx +1 -1
  208. package/themes/original/src/components/shared/OButton.tsx +6 -2
  209. package/themes/original/src/components/shared/OInput.tsx +16 -2
  210. package/themes/original/src/components/shared/OModal.tsx +3 -3
  211. package/themes/original/src/layouts/Container.tsx +13 -9
  212. package/themes/original/src/types/index.tsx +38 -9
  213. package/themes/original/src/utils/index.tsx +364 -58
  214. 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,6 +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]
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
121
128
 
122
129
  const walletName: any = {
123
130
  cash: {
@@ -128,205 +135,6 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
128
135
  }
129
136
  }
130
137
 
131
- const getOrderStatus = (s: string) => {
132
- const status = parseInt(s);
133
- const orderStatus = [
134
- {
135
- key: 0,
136
- value: t('PENDING', 'Pending'),
137
- slug: 'PENDING',
138
- percentage: 0.25,
139
- image: theme.images.order.status0,
140
- },
141
- {
142
- key: 1,
143
- value: t('COMPLETED', 'Completed'),
144
- slug: 'COMPLETED',
145
- percentage: 1,
146
- image: theme.images.order.status1,
147
- },
148
- {
149
- key: 2,
150
- value: t('REJECTED', 'Rejected'),
151
- slug: 'REJECTED',
152
- percentage: 0,
153
- image: theme.images.order.status2,
154
- },
155
- {
156
- key: 3,
157
- value: t('DRIVER_IN_BUSINESS', 'Driver in business'),
158
- slug: 'DRIVER_IN_BUSINESS',
159
- percentage: 0.6,
160
- image: theme.images.order.status3,
161
- },
162
- {
163
- key: 4,
164
- value: t('PREPARATION_COMPLETED', 'Preparation Completed'),
165
- slug: 'PREPARATION_COMPLETED',
166
- percentage: 0.7,
167
- image: theme.images.order.status4,
168
- },
169
- {
170
- key: 5,
171
- value: t('REJECTED_BY_BUSINESS', 'Rejected by business'),
172
- slug: 'REJECTED_BY_BUSINESS',
173
- percentage: 0,
174
- image: theme.images.order.status5,
175
- },
176
- {
177
- key: 6,
178
- value: t('REJECTED_BY_DRIVER', 'Rejected by Driver'),
179
- slug: 'REJECTED_BY_DRIVER',
180
- percentage: 0,
181
- image: theme.images.order.status6,
182
- },
183
- {
184
- key: 7,
185
- value: t('ACCEPTED_BY_BUSINESS', 'Accepted by business'),
186
- slug: 'ACCEPTED_BY_BUSINESS',
187
- percentage: 0.35,
188
- image: theme.images.order.status7,
189
- },
190
- {
191
- key: 8,
192
- value: t('ACCEPTED_BY_DRIVER', 'Accepted by driver'),
193
- slug: 'ACCEPTED_BY_DRIVER',
194
- percentage: 0.45,
195
- image: theme.images.order.status8,
196
- },
197
- {
198
- key: 9,
199
- value: t('PICK_UP_COMPLETED_BY_DRIVER', 'Pick up completed by driver'),
200
- slug: 'PICK_UP_COMPLETED_BY_DRIVER',
201
- percentage: 0.8,
202
- image: theme.images.order.status9,
203
- },
204
- {
205
- key: 10,
206
- value: t('PICK_UP_FAILED_BY_DRIVER', 'Pick up Failed by driver'),
207
- slug: 'PICK_UP_FAILED_BY_DRIVER',
208
- percentage: 0,
209
- image: theme.images.order.status10,
210
- },
211
- {
212
- key: 11,
213
- value: t(
214
- 'DELIVERY_COMPLETED_BY_DRIVER',
215
- 'Delivery completed by driver',
216
- ),
217
- slug: 'DELIVERY_COMPLETED_BY_DRIVER',
218
- percentage: 1,
219
- image: theme.images.order.status11,
220
- },
221
- {
222
- key: 12,
223
- value: t('DELIVERY_FAILED_BY_DRIVER', 'Delivery Failed by driver'),
224
- slug: 'DELIVERY_FAILED_BY_DRIVER',
225
- percentage: 0,
226
- image: theme.images.order.status12,
227
- },
228
- {
229
- key: 13,
230
- value: t('PREORDER', 'PreOrder'),
231
- slug: 'PREORDER',
232
- percentage: 0,
233
- image: theme.images.order.status13,
234
- },
235
- {
236
- key: 14,
237
- value: t('ORDER_NOT_READY', 'Order not ready'),
238
- slug: 'ORDER_NOT_READY',
239
- percentage: 0,
240
- image: theme.images.order.status13,
241
- },
242
- {
243
- key: 15,
244
- value: t(
245
- 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
246
- 'Order picked up completed by customer',
247
- ),
248
- slug: 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
249
- percentage: 100,
250
- image: theme.images.order.status1,
251
- },
252
- {
253
- key: 16,
254
- value: t('CANCELLED_BY_CUSTOMER', 'Cancelled by customer'),
255
- slug: 'CANCELLED_BY_CUSTOMER',
256
- percentage: 0,
257
- image: theme.images.order.status2,
258
- },
259
- {
260
- key: 17,
261
- value: t(
262
- 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
263
- 'Order not picked up by customer',
264
- ),
265
- slug: 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
266
- percentage: 0,
267
- image: theme.images.order.status2,
268
- },
269
- {
270
- key: 18,
271
- value: t(
272
- 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
273
- 'Driver almost arrived to business',
274
- ),
275
- slug: 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
276
- percentage: 0.15,
277
- image: theme.images.order.status3,
278
- },
279
- {
280
- key: 19,
281
- value: t(
282
- 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER',
283
- 'Driver almost arrived to customer',
284
- ),
285
- slug: 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER',
286
- percentage: 0.9,
287
- image: theme.images.order.status11,
288
- },
289
- {
290
- key: 20,
291
- value: t(
292
- 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
293
- 'Customer almost arrived to business',
294
- ),
295
- slug: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
296
- percentage: 90,
297
- image: theme.images.order.status7,
298
- },
299
- {
300
- key: 21,
301
- value: t(
302
- 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
303
- 'Customer arrived to business',
304
- ),
305
- slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
306
- percentage: 95,
307
- image: theme.images.order.status7,
308
- },
309
- {
310
- key: 22,
311
- value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver'),
312
- slug: 'ORDER_LOOKING_FOR_DRIVER',
313
- percentage: 35,
314
- image: theme.images.order.status8
315
- },
316
- {
317
- key: 23,
318
- value: t('ORDER_DRIVER_ON_WAY', 'Driver on way'),
319
- slug: 'ORDER_DRIVER_ON_WAY',
320
- percentage: 45,
321
- image: theme.images.order.status8
322
- }
323
- ];
324
-
325
- const objectStatus = orderStatus.find((o) => o.key === status);
326
-
327
- return objectStatus && objectStatus;
328
- };
329
-
330
138
  const handleGoToMessages = (type: string) => {
331
139
  readMessages && readMessages();
332
140
  navigation.navigate(
@@ -593,181 +401,194 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
593
401
  style={{ marginTop: Platform.OS === 'ios' ? 0 : 20 }}
594
402
  titleWrapStyle={{ paddingHorizontal: 0 }}
595
403
  titleStyle={{ marginRight: 0, marginLeft: 0 }}
596
- subTitle={<OText size={12} lineHeight={18} color={theme.colors.textNormal}>
597
- {order?.delivery_datetime_utc
598
- ? parseDate(order?.delivery_datetime_utc)
599
- : 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
+ )}
600
410
  </OText>}
601
411
  />
602
- <OrderInfo>
603
- <OrderData>
604
- <View style={styles.linkWrapper}>
605
- {
606
- (
607
- parseInt(order?.status) === 1 ||
608
- parseInt(order?.status) === 11 ||
609
- parseInt(order?.status) === 15
610
- ) && !order.review && !isReviewed && (
611
- <TouchableOpacity
612
- activeOpacity={0.7}
613
- style={{ marginTop: 6, marginRight: 10 }}
614
- onPress={() => handleClickOrderReview(order)}
615
- >
616
- <OText
617
- size={10}
618
- lineHeight={15}
619
- color={theme.colors.primary}
620
- 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)}
621
433
  >
622
- {t('REVIEW_YOUR_ORDER', 'Review your order')}
623
- </OText>
624
- </TouchableOpacity>
625
- )}
626
- <TouchableOpacity
627
- activeOpacity={0.7}
628
- style={{ marginTop: 6 }}
629
- onPress={() => setIsOrderHistory(true)}
630
-
631
- >
632
- <OText
633
- size={10}
634
- lineHeight={15}
635
- color={theme.colors.primary}
636
- 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
+
637
449
  >
638
- {t('VIEW_DETAILS', 'View Details')}
639
- </OText>
640
- </TouchableOpacity>
641
- </View>
642
-
643
- <StaturBar>
644
- <LinearGradient
645
- start={{ x: 0.0, y: 0.0 }}
646
- end={{
647
- x: getOrderStatus(order?.status)?.percentage || 0,
648
- y: 0,
649
- }}
650
- locations={[0.9999, 0.9999]}
651
- colors={[theme.colors.primary, theme.colors.backgroundGray100]}
652
- style={styles.statusBar}
653
- />
654
- </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>
655
495
  <OText
656
496
  size={16}
657
497
  lineHeight={24}
658
- weight={'600'}
659
- color={theme.colors.textNormal}>
660
- {getOrderStatus(order?.status)?.value}
498
+ weight={'500'}
499
+ color={theme.colors.textNormal}
500
+ mBottom={12}>
501
+ {t('FROM', 'From')}
661
502
  </OText>
662
- </OrderData>
663
- <View
664
- style={{
665
- height: 8,
666
- backgroundColor: theme.colors.backgroundGray100,
667
- marginTop: 18,
668
- marginHorizontal: -40,
669
- }}
670
- />
671
- </OrderInfo>
672
- </Header>
673
- <OrderContent>
674
- <OrderBusiness>
675
- <OText
676
- size={16}
677
- lineHeight={24}
678
- weight={'500'}
679
- color={theme.colors.textNormal}
680
- mBottom={12}>
681
- {t('FROM', 'From')}
682
- </OText>
683
- <View
684
- style={{
685
- display: 'flex',
686
- flexDirection: 'column',
687
- alignItems: 'flex-start',
688
- }}>
689
503
  <View
690
504
  style={{
691
- flexDirection: 'row',
692
- alignItems: 'center',
693
- justifyContent: 'space-between',
505
+ display: 'flex',
506
+ flexDirection: 'column',
507
+ alignItems: 'flex-start',
694
508
  }}>
695
- <OText
696
- size={13}
697
- lineHeight={20}
698
- color={theme.colors.textNormal}
699
- style={{ flexGrow: 1, flexBasis: '80%' }}>
700
- {order?.business?.name}
701
- </OText>
702
- <Icons>
703
- {!!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
+ )}
704
537
  <TouchableOpacity
705
- onPress={() => order?.business?.cellphone &&
706
- Linking.openURL(`tel:${order?.business?.cellphone}`)
707
- }
708
- style={{ paddingEnd: 5 }}
709
- >
538
+ style={{ paddingStart: 5 }}
539
+ onPress={() => handleGoToMessages('business')}>
710
540
  <OIcon
711
- src={theme.images.general.phone}
541
+ src={theme.images.general.chat}
712
542
  width={16}
713
543
  color={theme.colors.disabled}
714
544
  />
715
545
  </TouchableOpacity>
716
- )}
717
- <TouchableOpacity
718
- style={{ paddingStart: 5 }}
719
- onPress={() => handleGoToMessages('business')}>
720
- <OIcon
721
- src={theme.images.general.chat}
722
- width={16}
723
- color={theme.colors.disabled}
724
- />
725
- </TouchableOpacity>
726
- </Icons>
727
- </View>
728
- <OText
729
- size={12}
730
- lineHeight={18}
731
- color={theme.colors.textNormal}
732
- mBottom={2}>
733
- {order?.business?.email}
734
- </OText>
735
- {!!order?.business?.cellphone && (
546
+ </Icons>
547
+ </View>
736
548
  <OText
737
549
  size={12}
738
550
  lineHeight={18}
739
551
  color={theme.colors.textNormal}
740
552
  mBottom={2}>
741
- {order?.business?.cellphone}
553
+ {order?.business?.email}
742
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}
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
+ />
743
587
  )}
744
- <OText size={12} lineHeight={18} color={theme.colors.textNormal}>
745
- {order?.business?.address}
746
- </OText>
747
- </View>
748
- {directionTypes.includes(order?.delivery_type) && (
749
- <OButton
750
- text={t('GET_DIRECTIONS', 'Get Directions')}
751
- imgRightSrc=''
752
- textStyle={{ color: theme.colors.white }}
753
- style={{
754
- alignSelf: 'center',
755
- borderRadius: 10,
756
- marginTop: 30
757
- }}
758
- onClick={() => showLocation({
759
- latitude: order?.business?.location?.lat,
760
- longitude: order?.business?.location?.lng,
761
- naverCallerName: 'com.reactnativeappstemplate5',
762
- dialogTitle: t('GET_DIRECTIONS', 'Get Directions'),
763
- dialogMessage: t('WHAT_APP_WOULD_YOU_USE', 'What app would you like to use?'),
764
- cancelText: t('CANCEL', 'Cancel'),
765
- })}
766
- />
767
- )}
768
- </OrderBusiness>
588
+ </OrderBusiness>
589
+ )}
769
590
 
770
- {placeSpotTypes.includes(order?.delivery_type) && (
591
+ {!isGiftCardOrder && placeSpotTypes.includes(order?.delivery_type) && (
771
592
  <PlaceSpotWrapper>
772
593
  <PlaceSpot
773
594
  isInputMode
@@ -793,7 +614,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
793
614
  weight={'500'}
794
615
  color={theme.colors.textNormal}
795
616
  mBottom={12}>
796
- {t('TO', 'To')}
617
+ {isGiftCardOrder ? t('CUSTOMER', 'Customer') : t('TO', 'To')}
797
618
  </OText>
798
619
  <Customer>
799
620
  <InfoBlock>
@@ -822,7 +643,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
822
643
  )}
823
644
  </InfoBlock>
824
645
  </Customer>
825
- {order?.delivery_option !== undefined && order?.delivery_type === 1 && (
646
+ {!isGiftCardOrder && order?.delivery_option !== undefined && order?.delivery_type === 1 && (
826
647
  <View style={{ marginTop: 15 }}>
827
648
  <OText size={16} style={{ textAlign: 'left' }} color={theme.colors.textNormal}>
828
649
  {t('DELIVERY_PREFERENCE', 'Delivery Preference')}
@@ -844,7 +665,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
844
665
  <>
845
666
  {order?.driver?.location && mapValidStatuses.includes(parseInt(order?.status)) && (
846
667
  <Map>
847
- <GoogleMap
668
+ <GoogleMap
848
669
  location={typeof order?.driver?.location?.location === 'string'
849
670
  ? {
850
671
  lat: parseFloat(driverLocationString[0]),
@@ -1004,7 +825,9 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
1004
825
  </Table>
1005
826
  ))
1006
827
  }
1007
- <Divider />
828
+ {!isGiftCardOrder && (
829
+ <Divider />
830
+ )}
1008
831
  {order?.summary?.subtotal_with_discount > 0 && order?.summary?.discount > 0 && order?.summary?.total >= 0 && (
1009
832
  <Table>
1010
833
  <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{t('SUBTOTAL_WITH_DISCOUNT', 'Subtotal with discount')}</OText>
@@ -1126,8 +949,8 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
1126
949
  )}
1127
950
  <Total>
1128
951
  <Table>
1129
- <OText size={20} lineHeight={30} weight={'600'} color={theme.colors.textNormal}>{t('TOTAL', 'Total')}</OText>
1130
- <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}>
1131
954
  {parsePrice(order?.summary?.total ?? order?.total)}
1132
955
  </OText>
1133
956
  </Table>
@@ -1161,13 +984,13 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
1161
984
  <OText>
1162
985
  {event?.wallet_event
1163
986
  ? walletName[event?.wallet_event?.wallet?.type]?.name
1164
- : event?.paymethod?.name}
987
+ : t(event?.paymethod?.name.toUpperCase()?.replace(/ /g, '_'), event?.paymethod?.name)}
1165
988
  </OText>
1166
- {event?.data?.charge_id && (
989
+ {/* {event?.data?.charge_id && (
1167
990
  <OText>
1168
991
  {`${t('CODE', 'Code')}: ${event?.data?.charge_id}`}
1169
992
  </OText>
1170
- )}
993
+ )} */}
1171
994
  </View>
1172
995
  <OText>
1173
996
  -{parsePrice(event.amount, { isTruncable: true })}
@@ -1178,6 +1001,23 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
1178
1001
  </View>
1179
1002
  )}
1180
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
+ )}
1181
1021
  </OrderContent>
1182
1022
  </>
1183
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