ordering-ui-react-native 0.16.85 → 0.16.86-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 (215) hide show
  1. package/package.json +5 -5
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/ActiveOrders/styles.tsx +8 -14
  4. package/src/components/BusinessInformation/index.tsx +19 -4
  5. package/src/components/BusinessInformation/styles.tsx +2 -2
  6. package/src/components/BusinessProductsList/index.tsx +8 -8
  7. package/src/components/BusinessesListing/index.tsx +1 -1
  8. package/src/components/LanguageSelector/index.tsx +21 -16
  9. package/src/components/Messages/index.tsx +2 -2
  10. package/src/components/OrderCreating/index.tsx +1 -21
  11. package/src/components/OrdersOption/index.tsx +54 -56
  12. package/src/components/PaymentOptionsWebView/index.tsx +119 -120
  13. package/src/components/SingleProductReview/index.tsx +7 -4
  14. package/src/components/VerifyPhone/styles.tsx +1 -2
  15. package/src/components/shared/OToast.tsx +4 -4
  16. package/src/utils/index.tsx +2 -1
  17. package/themes/business/index.tsx +2 -0
  18. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +265 -240
  19. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
  20. package/themes/business/src/components/BusinessController/index.tsx +2 -2
  21. package/themes/business/src/components/Chat/index.tsx +31 -31
  22. package/themes/business/src/components/DriverMap/index.tsx +22 -9
  23. package/themes/business/src/components/GoogleMap/index.tsx +58 -57
  24. package/themes/business/src/components/LoginForm/Otp/index.tsx +120 -0
  25. package/themes/business/src/components/LoginForm/Otp/styles.tsx +7 -0
  26. package/themes/business/src/components/LoginForm/index.tsx +236 -80
  27. package/themes/business/src/components/LoginForm/styles.tsx +10 -0
  28. package/themes/business/src/components/MapView/index.tsx +19 -8
  29. package/themes/business/src/components/MessagesOption/index.tsx +11 -1
  30. package/themes/business/src/components/NewOrderNotification/index.tsx +31 -41
  31. package/themes/business/src/components/OrderDetails/Delivery.tsx +4 -3
  32. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +96 -50
  33. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +59 -62
  34. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +195 -0
  35. package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
  36. package/themes/business/src/components/OrderMessage/index.tsx +18 -17
  37. package/themes/business/src/components/OrdersOption/index.tsx +79 -87
  38. package/themes/business/src/components/OrdersOption/styles.tsx +5 -1
  39. package/themes/business/src/components/OrdersOptionBusiness/index.tsx +15 -1
  40. package/themes/business/src/components/OrdersOptionCity/index.tsx +15 -1
  41. package/themes/business/src/components/OrdersOptionDate/index.tsx +19 -6
  42. package/themes/business/src/components/OrdersOptionDelivery/index.tsx +15 -1
  43. package/themes/business/src/components/OrdersOptionDriver/index.tsx +15 -1
  44. package/themes/business/src/components/OrdersOptionPaymethod/index.tsx +15 -1
  45. package/themes/business/src/components/OrdersOptionStatus/index.tsx +10 -1
  46. package/themes/business/src/components/PreviousMessages/index.tsx +17 -18
  47. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +250 -0
  48. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
  49. package/themes/business/src/components/PreviousOrders/index.tsx +447 -247
  50. package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
  51. package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
  52. package/themes/business/src/components/ReviewCustomer/index.tsx +54 -27
  53. package/themes/business/src/components/shared/ODropDown.tsx +42 -8
  54. package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
  55. package/themes/business/src/components/shared/OLink.tsx +33 -13
  56. package/themes/business/src/components/shared/OModal.tsx +16 -9
  57. package/themes/business/src/components/shared/OText.tsx +8 -2
  58. package/themes/business/src/types/index.tsx +35 -3
  59. package/themes/business/src/utils/index.tsx +53 -0
  60. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  61. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  62. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  63. package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
  64. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  65. package/themes/kiosk/src/components/LoginForm/Otp/index.tsx +92 -0
  66. package/themes/kiosk/src/components/LoginForm/Otp/styles.tsx +7 -0
  67. package/themes/kiosk/src/components/LoginForm/index.tsx +473 -151
  68. package/themes/kiosk/src/components/LoginForm/styles.tsx +14 -1
  69. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  70. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  71. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  72. package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +1 -0
  73. package/themes/kiosk/src/components/PhoneInputNumber/styles.tsx +1 -3
  74. package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
  75. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  76. package/themes/kiosk/src/components/shared/OModal.tsx +14 -11
  77. package/themes/kiosk/src/layouts/Container.tsx +7 -1
  78. package/themes/kiosk/src/types/index.d.ts +13 -0
  79. package/themes/kiosk/src/utils/index.tsx +15 -0
  80. package/themes/original/index.tsx +8 -0
  81. package/themes/original/src/components/AddressDetails/index.tsx +10 -8
  82. package/themes/original/src/components/AddressForm/index.tsx +155 -139
  83. package/themes/original/src/components/AddressList/index.tsx +18 -18
  84. package/themes/original/src/components/AddressList/styles.tsx +4 -2
  85. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  86. package/themes/original/src/components/BusinessBasicInformation/index.tsx +118 -76
  87. package/themes/original/src/components/BusinessController/index.tsx +100 -47
  88. package/themes/original/src/components/BusinessController/styles.tsx +14 -9
  89. package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
  90. package/themes/original/src/components/BusinessItemAccordion/index.tsx +9 -3
  91. package/themes/original/src/components/BusinessListingSearch/index.tsx +87 -34
  92. package/themes/original/src/components/BusinessListingSearch/styles.tsx +6 -0
  93. package/themes/original/src/components/BusinessPreorder/index.tsx +96 -15
  94. package/themes/original/src/components/BusinessProductsList/index.tsx +10 -8
  95. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  96. package/themes/original/src/components/BusinessProductsListing/index.tsx +564 -495
  97. package/themes/original/src/components/BusinessProductsListing/styles.tsx +13 -12
  98. package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -2
  99. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +2 -1
  100. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +116 -81
  101. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
  102. package/themes/original/src/components/BusinessesListing/index.tsx +6 -6
  103. package/themes/original/src/components/Cart/index.tsx +83 -42
  104. package/themes/original/src/components/CartContent/index.tsx +77 -15
  105. package/themes/original/src/components/CartContent/styles.tsx +11 -1
  106. package/themes/original/src/components/Checkout/index.tsx +75 -86
  107. package/themes/original/src/components/Checkout/styles.tsx +4 -2
  108. package/themes/original/src/components/CitiesControl/index.tsx +89 -0
  109. package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
  110. package/themes/original/src/components/DriverTips/index.tsx +52 -37
  111. package/themes/original/src/components/DriverTips/styles.tsx +2 -1
  112. package/themes/original/src/components/Favorite/index.tsx +7 -4
  113. package/themes/original/src/components/Favorite/styles.tsx +1 -1
  114. package/themes/original/src/components/FavoriteList/index.tsx +70 -80
  115. package/themes/original/src/components/FloatingButton/index.tsx +1 -2
  116. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  117. package/themes/original/src/components/GPSButton/index.tsx +20 -19
  118. package/themes/original/src/components/GPSButton/styles.ts +3 -3
  119. package/themes/original/src/components/GoogleMap/index.tsx +10 -1
  120. package/themes/original/src/components/Help/index.tsx +8 -8
  121. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +11 -22
  122. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +6 -0
  123. package/themes/original/src/components/HelpGuide/index.tsx +12 -16
  124. package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
  125. package/themes/original/src/components/HelpOrder/index.tsx +12 -25
  126. package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
  127. package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
  128. package/themes/original/src/components/LastOrder/index.tsx +1 -34
  129. package/themes/original/src/components/LoginForm/Otp/index.tsx +89 -73
  130. package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
  131. package/themes/original/src/components/LoginForm/index.tsx +28 -8
  132. package/themes/original/src/components/LottieAnimation/index.tsx +78 -0
  133. package/themes/original/src/components/MessageListing/index.tsx +7 -40
  134. package/themes/original/src/components/Messages/index.tsx +26 -10
  135. package/themes/original/src/components/MomentOption/index.tsx +195 -88
  136. package/themes/original/src/components/MultiCart/index.tsx +50 -0
  137. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -93
  138. package/themes/original/src/components/MultiCheckout/index.tsx +179 -77
  139. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
  140. package/themes/original/src/components/MultiOrdersDetails/index.tsx +67 -20
  141. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
  142. package/themes/original/src/components/MyOrders/index.tsx +66 -17
  143. package/themes/original/src/components/NavBar/index.tsx +6 -11
  144. package/themes/original/src/components/NetworkError/index.tsx +5 -3
  145. package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
  146. package/themes/original/src/components/Notifications/index.tsx +144 -0
  147. package/themes/original/src/components/Notifications/styles.tsx +20 -0
  148. package/themes/original/src/components/OrderDetails/index.tsx +108 -218
  149. package/themes/original/src/components/OrderDetails/styles.tsx +10 -1
  150. package/themes/original/src/components/OrderItAgain/index.tsx +44 -42
  151. package/themes/original/src/components/OrderProgress/index.tsx +74 -104
  152. package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
  153. package/themes/original/src/components/OrderSummary/index.tsx +2 -2
  154. package/themes/original/src/components/OrderTypeSelector/index.tsx +9 -3
  155. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +29 -20
  156. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
  157. package/themes/original/src/components/OrdersOption/index.tsx +76 -83
  158. package/themes/original/src/components/PageBanner/index.tsx +146 -0
  159. package/themes/original/src/components/PageBanner/styles.tsx +11 -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 +2 -2
  163. package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
  164. package/themes/original/src/components/PlaceSpot/index.tsx +12 -6
  165. package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
  166. package/themes/original/src/components/ProductForm/index.tsx +240 -256
  167. package/themes/original/src/components/ProductForm/styles.tsx +5 -8
  168. package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
  169. package/themes/original/src/components/ProductOptionSubOption/index.tsx +18 -10
  170. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +1 -2
  171. package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
  172. package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -49
  173. package/themes/original/src/components/ProfessionalProfile/index.tsx +54 -14
  174. package/themes/original/src/components/Promotions/index.tsx +234 -220
  175. package/themes/original/src/components/Promotions/styles.tsx +7 -2
  176. package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
  177. package/themes/original/src/components/ReviewOrder/index.tsx +43 -11
  178. package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
  179. package/themes/original/src/components/ReviewProducts/index.tsx +8 -5
  180. package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
  181. package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
  182. package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
  183. package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
  184. package/themes/original/src/components/ServiceForm/index.tsx +377 -270
  185. package/themes/original/src/components/Sessions/index.tsx +11 -8
  186. package/themes/original/src/components/Sessions/styles.tsx +5 -0
  187. package/themes/original/src/components/SignupForm/index.tsx +78 -66
  188. package/themes/original/src/components/SingleOrderCard/index.tsx +125 -56
  189. package/themes/original/src/components/SingleOrderCard/styles.tsx +10 -8
  190. package/themes/original/src/components/SingleProductCard/index.tsx +104 -45
  191. package/themes/original/src/components/SingleProductCard/styles.tsx +14 -13
  192. package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
  193. package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
  194. package/themes/original/src/components/StripeCardsList/index.tsx +1 -1
  195. package/themes/original/src/components/StripeElementsForm/index.tsx +4 -1
  196. package/themes/original/src/components/UpsellingProducts/index.tsx +243 -218
  197. package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
  198. package/themes/original/src/components/UserDetails/index.tsx +8 -4
  199. package/themes/original/src/components/UserFormDetails/index.tsx +53 -54
  200. package/themes/original/src/components/UserProfile/index.tsx +58 -35
  201. package/themes/original/src/components/UserProfile/styles.ts +17 -0
  202. package/themes/original/src/components/UserProfileForm/index.tsx +21 -28
  203. package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
  204. package/themes/original/src/components/Wallets/index.tsx +96 -93
  205. package/themes/original/src/components/Wallets/styles.tsx +2 -0
  206. package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
  207. package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
  208. package/themes/original/src/components/shared/OBottomPopup.tsx +1 -1
  209. package/themes/original/src/components/shared/OButton.tsx +1 -1
  210. package/themes/original/src/components/shared/OIcon.tsx +8 -1
  211. package/themes/original/src/components/shared/OInput.tsx +10 -1
  212. package/themes/original/src/layouts/Container.tsx +13 -9
  213. package/themes/original/src/types/index.tsx +36 -5
  214. package/themes/original/src/utils/index.tsx +321 -58
  215. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -4,8 +4,8 @@ import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
4
4
  import { FavoriteParams } from '../../types';
5
5
  import { SingleOrderCard } from '../SingleOrderCard';
6
6
  import {
7
- FavoriteList as FavoriteListController,
8
- useOrder,
7
+ FavoriteList as FavoriteListController,
8
+ useOrder,
9
9
  useLanguage
10
10
  } from 'ordering-components/native';
11
11
  import { useTheme } from 'styled-components/native';
@@ -14,11 +14,12 @@ import { Container, WrappButton } from './styles'
14
14
  import { OButton } from '../shared';
15
15
  import { BusinessController } from '../BusinessController';
16
16
  import { SingleProductCard } from '../SingleProductCard';
17
+ import { NotFoundSource } from '../NotFoundSource';
17
18
  import moment from 'moment';
18
-
19
+ import { getOrderStatus } from '../../utils'
19
20
 
20
21
  const FavoriteListUI = (props: FavoriteParams) => {
21
- const {
22
+ const {
22
23
  favoriteList,
23
24
  handleUpdateFavoriteList,
24
25
  pagination,
@@ -30,82 +31,53 @@ const FavoriteListUI = (props: FavoriteParams) => {
30
31
  isBusiness,
31
32
  isOrder,
32
33
  isProduct
33
- } = props
34
+ } = props
34
35
 
35
- const theme = useTheme();
36
+ const theme = useTheme();
36
37
  const [, t] = useLanguage()
37
38
  const [orderState] = useOrder();
38
39
  const [{ carts }] = useOrder()
39
40
 
40
41
  const pastOrders = [1, 2, 5, 6, 10, 11, 12, 15, 16, 17]
41
42
 
42
- const getOrderStatus = (s: any) => {
43
- const status = parseInt(s)
44
- const orderStatus = [
45
- { key: 0, value: t('PENDING', theme?.defaultLanguages?.PENDING || 'Pending') },
46
- { key: 1, value: t('COMPLETED', theme?.defaultLanguages?.COMPLETED || 'Completed') },
47
- { key: 2, value: t('REJECTED', theme?.defaultLanguages?.REJECTED || 'Rejected') },
48
- { key: 3, value: t('DRIVER_IN_BUSINESS', theme?.defaultLanguages?.DRIVER_IN_BUSINESS || 'Driver in business') },
49
- { key: 4, value: t('PREPARATION_COMPLETED', theme?.defaultLanguages?.PREPARATION_COMPLETED || 'Preparation Completed') },
50
- { key: 5, value: t('REJECTED_BY_BUSINESS', theme?.defaultLanguages?.REJECTED_BY_BUSINESS || 'Rejected by business') },
51
- { key: 6, value: t('REJECTED_BY_DRIVER', theme?.defaultLanguages?.REJECTED_BY_DRIVER || 'Rejected by Driver') },
52
- { key: 7, value: t('ACCEPTED_BY_BUSINESS', theme?.defaultLanguages?.ACCEPTED_BY_BUSINESS || 'Accepted by business') },
53
- { key: 8, value: t('ACCEPTED_BY_DRIVER', theme?.defaultLanguages?.ACCEPTED_BY_DRIVER || 'Accepted by driver') },
54
- { key: 9, value: t('PICK_UP_COMPLETED_BY_DRIVER', theme?.defaultLanguages?.PICK_UP_COMPLETED_BY_DRIVER || 'Pick up completed by driver') },
55
- { key: 10, value: t('PICK_UP_FAILED_BY_DRIVER', theme?.defaultLanguages?.PICK_UP_FAILED_BY_DRIVER || 'Pick up Failed by driver') },
56
- { key: 11, value: t('DELIVERY_COMPLETED_BY_DRIVER', theme?.defaultLanguages?.DELIVERY_COMPLETED_BY_DRIVER || 'Delivery completed by driver') },
57
- { key: 12, value: t('DELIVERY_FAILED_BY_DRIVER', theme?.defaultLanguages?.DELIVERY_FAILED_BY_DRIVER || 'Delivery Failed by driver') },
58
- { key: 13, value: t('PREORDER', theme?.defaultLanguages?.PREORDER || 'PreOrder') },
59
- { key: 14, value: t('ORDER_NOT_READY', theme?.defaultLanguages?.ORDER_NOT_READY || 'Order not ready') },
60
- { key: 15, value: t('ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER', theme?.defaultLanguages?.ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER || 'Order picked up completed by customer') },
61
- { key: 16, value: t('ORDER_STATUS_CANCELLED_BY_CUSTOMER', theme?.defaultLanguages?.ORDER_STATUS_CANCELLED_BY_CUSTOMER || 'Order cancelled by customer') },
62
- { key: 17, value: t('ORDER_NOT_PICKEDUP_BY_CUSTOMER', theme?.defaultLanguages?.ORDER_NOT_PICKEDUP_BY_CUSTOMER || 'Order not picked up by customer') },
63
- { key: 18, value: t('ORDER_DRIVER_ALMOST_ARRIVED_BUSINESS', theme?.defaultLanguages?.ORDER_DRIVER_ALMOST_ARRIVED_BUSINESS || 'Driver almost arrived to business') },
64
- { key: 19, value: t('ORDER_DRIVER_ALMOST_ARRIVED_CUSTOMER', theme?.defaultLanguages?.ORDER_DRIVER_ALMOST_ARRIVED_CUSTOMER || 'Driver almost arrived to customer') },
65
- { key: 20, value: t('ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', theme?.defaultLanguages?.ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS || 'Customer almost arrived to business') },
66
- { key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', theme?.defaultLanguages?.ORDER_CUSTOMER_ARRIVED_BUSINESS || 'Customer arrived to business') },
67
- { key: 22, value: t('ORDER_LOOKING_FOR_DRIVER', theme?.defaultLanguages?.ORDER_LOOKING_FOR_DRIVER || 'Looking for driver') },
68
- { key: 23, value: t('ORDER_DRIVER_ON_WAY', theme?.defaultLanguages?.ORDER_DRIVER_ON_WAY || 'Driver on way') }
69
- ]
70
-
71
- const objectStatus = orderStatus.find((o) => o.key === status)
72
-
73
- return objectStatus && objectStatus
74
- }
75
-
76
43
  const onProductClick = (product: any) => {
77
44
  const categoryId = product?.category?.id
78
45
  const businessId = product?.category?.business?.id
79
46
  if (!categoryId || !businessId) return
80
47
  onNavigationRedirect && onNavigationRedirect('ProductDetails', {
81
- productId: product?.id,
82
- categoryId: categoryId,
83
- businessId: businessId
84
- })
48
+ isRedirect: 'business',
49
+ productId: product?.id,
50
+ businessId: businessId,
51
+ categoryId: categoryId,
52
+ business: {
53
+ store: product?.category?.business.slug,
54
+ header: product?.category?.header,
55
+ }
56
+ })
85
57
  }
86
58
 
87
59
  useEffect(() => {
88
- const _businessId = 'businessId:' + reorderState?.result?.business_id
89
- if (reorderState?.error) {
90
- if (reorderState?.result?.business_id) {
91
- _setStoreData('adjust-cart-products', JSON.stringify(_businessId))
92
- onNavigationRedirect && onNavigationRedirect('Business', { store: reorderState?.result?.business?.slug })
93
- }
94
- }
95
- if (!reorderState?.error && reorderState.loading === false && reorderState?.result?.business_id) {
96
- const cartProducts = carts?.[_businessId]?.products
97
- const available = cartProducts.every((product: any) => product.valid === true)
98
- const orderProducts = favoriteList?.favorites.find((order: any) => order?.id === reorderState?.result?.orderId)?.products
60
+ const _businessId = 'businessId:' + reorderState?.result?.business_id
61
+ if (reorderState?.error) {
62
+ if (reorderState?.result?.business_id) {
63
+ _setStoreData('adjust-cart-products', JSON.stringify(_businessId))
64
+ onNavigationRedirect && onNavigationRedirect('Business', { store: reorderState?.result?.business?.slug })
65
+ }
66
+ }
67
+ if (!reorderState?.error && reorderState.loading === false && reorderState?.result?.business_id) {
68
+ const cartProducts = carts?.[_businessId]?.products
69
+ const available = cartProducts.every((product: any) => product.valid === true)
70
+ const orderProducts = favoriteList?.favorites.find((order: any) => order?.id === reorderState?.result?.orderId)?.products
99
71
 
100
- if (available && reorderState?.result?.uuid && (cartProducts?.length === orderProducts?.length)) {
101
- onNavigationRedirect && onNavigationRedirect('CheckoutNavigator', { cartUuid: reorderState?.result.uuid })
102
- } else {
103
- _setStoreData('adjust-cart-products', JSON.stringify(_businessId))
104
- cartProducts?.length !== orderProducts?.length && _setStoreData('already-removed', JSON.stringify('removed'))
105
- onNavigationRedirect && onNavigationRedirect('Business', { store: reorderState?.result?.business?.slug })
106
- }
107
- }
108
- }, [reorderState])
72
+ if (available && reorderState?.result?.uuid && (cartProducts?.length === orderProducts?.length)) {
73
+ onNavigationRedirect && onNavigationRedirect('CheckoutNavigator', { cartUuid: reorderState?.result.uuid })
74
+ } else {
75
+ _setStoreData('adjust-cart-products', JSON.stringify(_businessId))
76
+ cartProducts?.length !== orderProducts?.length && _setStoreData('already-removed', JSON.stringify('removed'))
77
+ onNavigationRedirect && onNavigationRedirect('Business', { store: reorderState?.result?.business?.slug })
78
+ }
79
+ }
80
+ }, [reorderState])
109
81
 
110
82
  const handleBusinessClick = (business: any) => {
111
83
  onNavigationRedirect && onNavigationRedirect('Business', {
@@ -194,12 +166,12 @@ const FavoriteListUI = (props: FavoriteParams) => {
194
166
  )
195
167
  }
196
168
 
197
- return (
198
- <Container>
169
+ return (
170
+ <Container>
199
171
  {isBusiness && (
200
172
  <>
201
173
  {favoriteList?.favorites?.length > 0 && (
202
- favoriteList.favorites?.sort((a: any, b: any) => a?.name?.toLowerCase() > b?.name?.toLowerCase()).map((business: any, i:number) => (
174
+ favoriteList.favorites?.sort((a: any, b: any) => a?.name?.toLowerCase() > b?.name?.toLowerCase()).map((business: any, i: number) => (
203
175
  <BusinessController
204
176
  key={`${business.id}_` + i}
205
177
  business={business}
@@ -224,13 +196,19 @@ const FavoriteListUI = (props: FavoriteParams) => {
224
196
  <BusinessSkeleton key={i} />
225
197
  ))
226
198
  )}
199
+ {!favoriteList?.loading && !favoriteList?.favorites?.length && (
200
+ <NotFoundSource
201
+ content={t('NOT_FOUND_FAVORITES_LIST', 'No favorites to show at this time.')
202
+ }
203
+ />
204
+ )}
227
205
  </>
228
206
  )}
229
207
 
230
208
  {isOrder && (
231
209
  <>
232
210
  {favoriteList?.favorites?.length > 0 && (
233
- favoriteList.favorites?.sort((a: any, b:any) => moment(a?.delivery_datetime_utc).valueOf() - moment(b?.delivery_datetime_utc).valueOf())
211
+ favoriteList.favorites?.sort((a: any, b: any) => moment(a?.delivery_datetime_utc).valueOf() - moment(b?.delivery_datetime_utc).valueOf())
234
212
  .map((order: any, i: number) => (
235
213
  <SingleOrderCard
236
214
  key={`${order?.id}_${i}`}
@@ -243,13 +221,19 @@ const FavoriteListUI = (props: FavoriteParams) => {
243
221
  handleReorder={handleReorder}
244
222
  reorderLoading={reorderState?.loading}
245
223
  />
246
- ))
224
+ ))
247
225
  )}
248
226
  {favoriteList?.loading && (
249
227
  [...Array(5).keys()].map(i => (
250
228
  <OrderSkeleton key={i} />
251
229
  ))
252
230
  )}
231
+ {!favoriteList?.loading && !favoriteList?.favorites?.length && (
232
+ <NotFoundSource
233
+ content={t('NOT_FOUND_FAVORITES_LIST', 'No favorites to show at this time.')
234
+ }
235
+ />
236
+ )}
253
237
  </>
254
238
  )}
255
239
 
@@ -271,22 +255,28 @@ const FavoriteListUI = (props: FavoriteParams) => {
271
255
  <ProductSkeleton key={i} />
272
256
  ))
273
257
  )}
258
+ {!favoriteList?.loading && !favoriteList?.favorites?.length && (
259
+ <NotFoundSource
260
+ content={t('NOT_FOUND_FAVORITES_LIST', 'No favorites to show at this time.')
261
+ }
262
+ />
263
+ )}
274
264
  </>
275
265
  )}
276
266
 
277
267
  {!favoriteList?.loading && pagination.totalPages && pagination.currentPage < pagination.totalPages && (
278
- <WrappButton>
279
- <OButton
280
- onClick={() => getFavoriteList(pagination?.currentPage + 1)}
281
- text={t('LOAD_MORE_ITEMS', 'Load more items')}
282
- imgRightSrc={null}
283
- textStyle={{ color: theme.colors.white }}
284
- style={{ borderRadius: 7.6, shadowOpacity: 0, marginTop: 20 }}
285
- />
286
- </WrappButton>
287
- )}
268
+ <WrappButton>
269
+ <OButton
270
+ onClick={() => getFavoriteList(pagination?.currentPage + 1)}
271
+ text={t('LOAD_MORE_ITEMS', 'Load more items')}
272
+ imgRightSrc={null}
273
+ textStyle={{ color: theme.colors.white }}
274
+ style={{ borderRadius: 7.6, shadowOpacity: 0, marginTop: 20 }}
275
+ />
276
+ </WrappButton>
277
+ )}
288
278
  </Container>
289
- )
279
+ )
290
280
  }
291
281
 
292
282
  export const FavoriteList = (props: any) => {
@@ -62,7 +62,7 @@ const FloatingButtonUI = (props: FloatingButtonParams) => {
62
62
  return (
63
63
  <Container
64
64
  style={{
65
- paddingBottom: Platform.OS === 'ios' ? iosBottom ?? 0 : bottom + 16
65
+ paddingBottom: Platform.OS === 'ios' ? 20 : bottom + 16
66
66
  }}>
67
67
 
68
68
  <View style={styles.infoCont}>
@@ -86,7 +86,6 @@ const FloatingButtonUI = (props: FloatingButtonParams) => {
86
86
  {btnText}
87
87
  </OText>
88
88
  </Button>
89
-
90
89
  </Container>
91
90
  );
92
91
  };
@@ -12,7 +12,7 @@ export const Container = styled.View`
12
12
  width: 100%;
13
13
  justify-content: space-between;
14
14
  background-color: #FFF;
15
- z-index: 1000;
15
+ z-index: 20001;
16
16
  justify-content: space-between;
17
17
  `
18
18
 
@@ -1,17 +1,16 @@
1
1
  import React, { useEffect, useState } from 'react'
2
- import { getTrackingStatus, requestTrackingPermission } from 'react-native-tracking-transparency'
3
- import Geolocation from '@react-native-community/geolocation'
4
2
  import Geocoder from 'react-native-geocoding'
5
- import { GpsButtonStyle } from './styles'
6
- import { View } from 'react-native'
7
- import { OText } from '../shared'
8
3
  import { ActivityIndicator } from 'react-native-paper'
4
+ import Geolocation from '@react-native-community/geolocation'
5
+ import { getTrackingStatus, requestTrackingPermission } from 'react-native-tracking-transparency'
6
+
7
+ import { OText } from '../shared'
8
+ import { GpsButtonStyle } from './styles'
9
9
 
10
10
  export const GPSButton = (props: any) => {
11
11
  const {
12
12
  handleGPS,
13
13
  apiKey,
14
- googleReady,
15
14
  IconButton,
16
15
  IconLoadingButton
17
16
  } = props
@@ -56,25 +55,27 @@ export const GPSButton = (props: any) => {
56
55
  })
57
56
  }
58
57
 
59
- const getCurrentPosition = async () => {
58
+ const getCurrentPosition = async () => {
60
59
  let trackingStatus = await getTrackingStatus()
61
- if (trackingStatus === 'not-determined') {
62
- trackingStatus = await requestTrackingPermission()
63
- }
64
- if (trackingStatus === 'authorized' || trackingStatus === 'unavailable') {
65
- setLoading(true);
60
+ if (trackingStatus === 'not-determined') {
61
+ trackingStatus = await requestTrackingPermission()
62
+ }
63
+ if (trackingStatus === 'authorized' || trackingStatus === 'unavailable') {
64
+ setLoading(true)
66
65
  Geolocation.getCurrentPosition((pos) => {
67
- geoCodePosition(pos.coords);
66
+ geoCodePosition(pos.coords)
68
67
  }, (err) => {
69
68
  setLoading(false);
70
- console.log(err);
71
- });
69
+ console.log(`ERROR(${err.code}): ${err.message}`)
70
+ }, {
71
+ enableHighAccuracy: true, timeout: 15000, maximumAge: 10000
72
+ })
72
73
  }
73
- }
74
+ }
74
75
 
75
- useEffect(() => {
76
- Geocoder.init(apiKey);
77
- }, [])
76
+ useEffect(() => {
77
+ Geocoder.init(apiKey);
78
+ }, [])
78
79
 
79
80
  return (
80
81
  <GpsButtonStyle
@@ -1,6 +1,6 @@
1
1
  import styled, { css } from 'styled-components/native'
2
2
 
3
3
  export const GpsButtonStyle = styled.TouchableOpacity`
4
- width: 30px;
5
- height: 30px;
6
- `
4
+ width: 16px;
5
+ height: 16px;
6
+ `
@@ -89,7 +89,9 @@ export const GoogleMap = (props: GoogleMapsParams) => {
89
89
  return
90
90
  }
91
91
 
92
- if (distance <= maxLimitLocation) {
92
+ const _maxLimitLocation = typeof maxLimitLocation === 'string' ? parseInt(maxLimitLocation, 10) : maxLimitLocation
93
+
94
+ if (distance <= _maxLimitLocation) {
93
95
  setMarkerPosition(curPos)
94
96
  setRegion({ ...region, longitude: curPos.longitude, latitude: curPos.latitude })
95
97
  } else {
@@ -153,6 +155,13 @@ export const GoogleMap = (props: GoogleMapsParams) => {
153
155
  Geocoder.init(googleMapsApiKey)
154
156
  }, [])
155
157
 
158
+ useEffect(() => {
159
+ mapRef.current.animateToRegion({
160
+ ...region,
161
+ latitude: location?.lat,
162
+ longitude: location?.lng,
163
+ })
164
+ }, [location])
156
165
 
157
166
  useEffect(() => {
158
167
  if (saveLocation) {
@@ -1,5 +1,5 @@
1
1
  import React, { useState } from 'react'
2
- import { RefreshControl } from 'react-native'
2
+ import { Platform, RefreshControl } from 'react-native'
3
3
  import { HelpParams } from '../../types'
4
4
  import { useLanguage } from 'ordering-components/native'
5
5
  import NavBar from '../NavBar'
@@ -31,20 +31,20 @@ export const Help = (props: HelpParams) => {
31
31
 
32
32
  return (
33
33
  <Container
34
+ pt={Platform.OS === 'ios' ? 20 : 10}
34
35
  noPadding
35
36
  refreshControl={
36
- <RefreshControl
37
- refreshing={refreshing}
38
- onRefresh={() => handleOnRefresh()}
39
- />
40
- }
37
+ <RefreshControl
38
+ refreshing={refreshing}
39
+ onRefresh={() => handleOnRefresh()}
40
+ />
41
+ }
41
42
  >
42
43
  <NavBar
43
44
  title={t('HELP', 'Help')}
44
45
  titleAlign={'center'}
45
46
  onActionLeft={goToBack}
46
47
  showCall={false}
47
- paddingTop={10}
48
48
  btnStyle={{ paddingLeft: 0 }}
49
49
  />
50
50
  <HelpSubItem
@@ -53,7 +53,7 @@ export const Help = (props: HelpParams) => {
53
53
  <OText size={14}>{t('HELP_WITH_ORDER', 'Help with an order')}</OText>
54
54
  </HelpSubItem>
55
55
  <HelpSubItem
56
- onPress={() => onRedirect('HelpAccountAndPayment')}
56
+ onPress={() => onRedirect('HelpAccountAndPayment')}
57
57
  >
58
58
  <OText size={14}>{t('ACCOUNT_PAYMENT_OPTIONS', 'Account and Payment Options')}</OText>
59
59
  </HelpSubItem>
@@ -1,4 +1,5 @@
1
1
  import React from 'react'
2
+ import { Platform } from 'react-native'
2
3
  import { useLanguage } from 'ordering-components/native'
3
4
  import { HelpAccountAndPaymentParams } from '../../types'
4
5
  import { OText, OButton, OIcon } from '../shared'
@@ -7,8 +8,10 @@ import { StyleSheet, TouchableOpacity } from 'react-native'
7
8
  import AntDesignIcon from 'react-native-vector-icons/AntDesign'
8
9
 
9
10
  import {
10
- Content
11
+ Content,
12
+ Container
11
13
  } from './styles'
14
+ import NavBar from '../NavBar'
12
15
 
13
16
  export const HelpAccountAndPayment = (props: HelpAccountAndPaymentParams) => {
14
17
  const {
@@ -18,15 +21,6 @@ export const HelpAccountAndPayment = (props: HelpAccountAndPaymentParams) => {
18
21
  const theme = useTheme()
19
22
 
20
23
  const styles = StyleSheet.create({
21
- btnBackArrow: {
22
- borderWidth: 0,
23
- backgroundColor: theme.colors.white,
24
- borderColor: theme.colors.white,
25
- shadowColor: theme.colors.white,
26
- display: 'flex',
27
- justifyContent: 'flex-start',
28
- paddingLeft: 0,
29
- },
30
24
  imageStyle: {
31
25
  width: '100%',
32
26
  height: 300,
@@ -37,18 +31,13 @@ export const HelpAccountAndPayment = (props: HelpAccountAndPaymentParams) => {
37
31
  const goToBack = () => navigation?.canGoBack() && navigation.goBack()
38
32
 
39
33
  return (
40
- <>
41
- <OButton
42
- imgRightSrc={null}
43
- style={styles.btnBackArrow}
44
- onClick={() => goToBack()}
45
- icon={AntDesignIcon}
46
- iconProps={{
47
- name: 'arrowleft',
48
- size: 26
49
- }}
34
+ <Container>
35
+ <NavBar
36
+ title={t('ACCOUNT_PAYMENT_OPTIONS', 'Account and Payment Options')}
37
+ onActionLeft={goToBack}
38
+ btnStyle={{ paddingLeft: 0 }}
39
+ showCall={false}
50
40
  />
51
- <OText size={22} weight={600}>{t('ACCOUNT_PAYMENT_OPTIONS', 'Account and Payment Options')}</OText>
52
41
  <Content>
53
42
  <OText mBottom={20}>
54
43
  -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vel in congue nisl, nisi. Mauris, condimentum auctor sed cras cursus arcu pellentesque.
@@ -68,6 +57,6 @@ export const HelpAccountAndPayment = (props: HelpAccountAndPaymentParams) => {
68
57
  cover
69
58
  />
70
59
  </Content>
71
- </>
60
+ </Container>
72
61
  )
73
62
  }
@@ -4,3 +4,9 @@ export const Content = styled.View`
4
4
  padding-vertical: 20px;
5
5
  margin-bottom: 20px;
6
6
  `
7
+
8
+ export const Container = styled.ScrollView`
9
+ position: relative;
10
+ flex: 1;
11
+ margin: 10px 0;
12
+ `
@@ -1,13 +1,14 @@
1
1
  import React from 'react'
2
2
  import { useLanguage } from 'ordering-components/native'
3
3
  import { HelpGuideParams } from '../../types'
4
- import { OText, OButton, OIcon } from '../shared'
4
+ import { OText, OIcon } from '../shared'
5
5
  import { useTheme } from 'styled-components/native'
6
- import { StyleSheet, TouchableOpacity } from 'react-native'
6
+ import { Platform, StyleSheet } from 'react-native'
7
+ import NavBar from '../NavBar'
7
8
  import {
8
- Content
9
+ Content,
10
+ Container
9
11
  } from './styles'
10
- import AntDesignIcon from 'react-native-vector-icons/AntDesign'
11
12
 
12
13
  export const HelpGuide = (props: HelpGuideParams) => {
13
14
  const {
@@ -36,18 +37,13 @@ export const HelpGuide = (props: HelpGuideParams) => {
36
37
  const goToBack = () => navigation?.canGoBack() && navigation.goBack()
37
38
 
38
39
  return (
39
- <>
40
- <OButton
41
- imgRightSrc={null}
42
- style={styles.btnBackArrow}
43
- onClick={() => goToBack()}
44
- icon={AntDesignIcon}
45
- iconProps={{
46
- name: 'arrowleft',
47
- size: 26
48
- }}
40
+ <Container pdng={Platform.OS === 'ios' ? '10px' : '0px'}>
41
+ <NavBar
42
+ title={t('GUIDE_TO_ORDERING', 'Guide to Ordering')}
43
+ onActionLeft={goToBack}
44
+ btnStyle={{ paddingLeft: 0 }}
45
+ showCall={false}
49
46
  />
50
- <OText size={22} weight={600}>{t('GUIDE_TO_ORDERING', 'Guide to Ordering')}</OText>
51
47
  <Content>
52
48
  <OText mBottom={15}>
53
49
  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Blandit mauris varius faucibus varius condimentum morbi pretium mus. Aliquam bibendum erat venenatis feugiat sed.
@@ -67,6 +63,6 @@ export const HelpGuide = (props: HelpGuideParams) => {
67
63
  cover
68
64
  />
69
65
  </Content>
70
- </>
66
+ </Container>
71
67
  )
72
68
  }
@@ -4,3 +4,9 @@ export const Content = styled.View`
4
4
  padding-vertical: 20px;
5
5
  margin-bottom: 20px;
6
6
  `
7
+ export const Container = styled.ScrollView`
8
+ position: relative;
9
+ flex: 1;
10
+ margin: 10px 0;
11
+ padding-top: ${(props: any) => props.pdng}
12
+ `
@@ -1,14 +1,15 @@
1
1
  import React from 'react'
2
2
  import { useLanguage } from 'ordering-components/native'
3
3
  import { HelpOrderParams } from '../../types'
4
- import { OText, OButton, OIcon } from '../shared'
4
+ import { OText, OIcon } from '../shared'
5
5
  import { useTheme } from 'styled-components/native'
6
- import { StyleSheet, TouchableOpacity } from 'react-native'
6
+ import { StyleSheet } from 'react-native'
7
7
  import { WebView } from 'react-native-webview'
8
- import AntDesignIcon from 'react-native-vector-icons/AntDesign'
8
+ import NavBar from '../NavBar'
9
9
 
10
10
  import {
11
- Content
11
+ Content,
12
+ Container
12
13
  } from './styles'
13
14
 
14
15
  export const HelpOrder = (props: HelpOrderParams) => {
@@ -19,15 +20,6 @@ export const HelpOrder = (props: HelpOrderParams) => {
19
20
  const theme = useTheme()
20
21
 
21
22
  const styles = StyleSheet.create({
22
- btnBackArrow: {
23
- borderWidth: 0,
24
- backgroundColor: theme.colors.white,
25
- borderColor: theme.colors.white,
26
- shadowColor: theme.colors.white,
27
- display: 'flex',
28
- justifyContent: 'flex-start',
29
- paddingLeft: 0,
30
- },
31
23
  imageStyle: {
32
24
  width: '100%',
33
25
  height: 120
@@ -41,18 +33,13 @@ export const HelpOrder = (props: HelpOrderParams) => {
41
33
  const goToBack = () => navigation?.canGoBack() && navigation.goBack()
42
34
 
43
35
  return (
44
- <>
45
- <OButton
46
- imgRightSrc={null}
47
- style={styles.btnBackArrow}
48
- onClick={() => goToBack()}
49
- icon={AntDesignIcon}
50
- iconProps={{
51
- name: 'arrowleft',
52
- size: 26
53
- }}
36
+ <Container>
37
+ <NavBar
38
+ title={t('HELP_WITH_ORDER', 'Help with an order')}
39
+ onActionLeft={goToBack}
40
+ btnStyle={{ paddingLeft: 0 }}
41
+ showCall={false}
54
42
  />
55
- <OText size={22} weight={600}>{t('HELP_WITH_ORDER', 'Help with an order')}</OText>
56
43
  <Content>
57
44
  <OText mBottom={20}>
58
45
  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vel in congue nisl, nisi. Mauris, condimentum auctor sed cras cursus arcu pellentesque. Sed tempus et, cursus ultricies nisl nisl, in eros.
@@ -79,6 +66,6 @@ export const HelpOrder = (props: HelpOrderParams) => {
79
66
  style={styles.videoStyle}
80
67
  />
81
68
  </Content>
82
- </>
69
+ </Container>
83
70
  )
84
71
  }
@@ -3,4 +3,11 @@ import styled from 'styled-components/native'
3
3
  export const Content = styled.View`
4
4
  padding-vertical: 20px;
5
5
  margin-bottom: 20px;
6
- `
6
+ `
7
+
8
+ export const Container = styled.ScrollView`
9
+ position: relative;
10
+ flex: 1;
11
+ margin: 10px 0;
12
+ `
13
+