ordering-ui-react-native 0.16.52 → 0.16.53-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 (209) hide show
  1. package/package.json +6 -5
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/ActiveOrders/index.tsx +61 -63
  4. package/src/components/ActiveOrders/styles.tsx +8 -14
  5. package/src/components/BusinessInformation/index.tsx +33 -4
  6. package/src/components/BusinessInformation/styles.tsx +2 -2
  7. package/src/components/BusinessProductsList/index.tsx +10 -10
  8. package/src/components/BusinessesListing/index.tsx +1 -1
  9. package/src/components/Checkout/index.tsx +2 -1
  10. package/src/components/LanguageSelector/index.tsx +21 -16
  11. package/src/components/Messages/index.tsx +2 -2
  12. package/src/components/NotificationSetting/index.tsx +85 -0
  13. package/src/components/OrdersOption/index.tsx +54 -56
  14. package/src/components/PaymentOptions/index.tsx +298 -345
  15. package/src/components/PaymentOptionsWebView/index.tsx +120 -121
  16. package/src/components/SingleProductReview/index.tsx +7 -4
  17. package/src/components/StripeElementsForm/index.tsx +25 -16
  18. package/src/components/VerifyPhone/styles.tsx +1 -2
  19. package/src/components/shared/OBottomPopup.tsx +6 -2
  20. package/src/components/shared/OToast.tsx +4 -4
  21. package/src/index.tsx +2 -0
  22. package/src/types/@fatnlazycat/react-native-recaptcha-v3/index.d.ts +1 -0
  23. package/src/utils/index.tsx +2 -1
  24. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +260 -238
  25. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
  26. package/themes/business/src/components/BusinessController/index.tsx +2 -2
  27. package/themes/business/src/components/Chat/index.tsx +40 -32
  28. package/themes/business/src/components/DriverMap/index.tsx +7 -5
  29. package/themes/business/src/components/DriverSchedule/index.tsx +36 -19
  30. package/themes/business/src/components/LoginForm/index.tsx +111 -74
  31. package/themes/business/src/components/MapView/index.tsx +12 -1
  32. package/themes/business/src/components/MessagesOption/index.tsx +11 -1
  33. package/themes/business/src/components/NewOrderNotification/index.tsx +26 -41
  34. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +40 -30
  35. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +3 -3
  36. package/themes/business/src/components/OrdersListManager/index.tsx +10 -3
  37. package/themes/business/src/components/OrdersOption/index.tsx +76 -77
  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 +440 -245
  50. package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
  51. package/themes/business/src/components/ProductItemAccordion/index.tsx +3 -2
  52. package/themes/business/src/components/ReviewCustomer/index.tsx +39 -15
  53. package/themes/business/src/components/ScheduleBlocked/index.tsx +2 -2
  54. package/themes/business/src/components/UserFormDetails/index.tsx +5 -2
  55. package/themes/business/src/components/UserProfileForm/index.tsx +2 -0
  56. package/themes/business/src/components/shared/ODropDown.tsx +42 -8
  57. package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
  58. package/themes/business/src/components/shared/OLink.tsx +24 -12
  59. package/themes/business/src/components/shared/OText.tsx +3 -2
  60. package/themes/business/src/types/index.tsx +25 -11
  61. package/themes/business/src/utils/index.tsx +10 -0
  62. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  63. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  64. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  65. package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
  66. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  67. package/themes/kiosk/src/components/LoginForm/index.tsx +121 -10
  68. package/themes/kiosk/src/components/LoginForm/styles.tsx +5 -0
  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/ProductForm/index.tsx +1 -14
  73. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  74. package/themes/kiosk/src/types/index.d.ts +2 -0
  75. package/themes/original/index.tsx +8 -6
  76. package/themes/original/src/components/AddressDetails/index.tsx +10 -8
  77. package/themes/original/src/components/AddressForm/index.tsx +157 -140
  78. package/themes/original/src/components/AddressList/index.tsx +1 -1
  79. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  80. package/themes/original/src/components/BusinessBasicInformation/index.tsx +218 -147
  81. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +2 -2
  82. package/themes/original/src/components/BusinessController/index.tsx +192 -91
  83. package/themes/original/src/components/BusinessController/styles.tsx +14 -9
  84. package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
  85. package/themes/original/src/components/BusinessItemAccordion/index.tsx +12 -6
  86. package/themes/original/src/components/BusinessListingSearch/BusinessControllerSkeletons/index.tsx +57 -0
  87. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +59 -0
  88. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/styles.tsx +13 -0
  89. package/themes/original/src/components/BusinessListingSearch/index.tsx +85 -137
  90. package/themes/original/src/components/BusinessListingSearch/styles.tsx +10 -12
  91. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +87 -0
  92. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/styles.tsx +12 -0
  93. package/themes/original/src/components/BusinessProductsList/index.tsx +59 -61
  94. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  95. package/themes/original/src/components/BusinessProductsListing/index.tsx +179 -83
  96. package/themes/original/src/components/BusinessProductsListing/styles.tsx +19 -12
  97. package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -2
  98. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +28 -29
  99. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +299 -148
  100. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +47 -11
  101. package/themes/original/src/components/BusinessesListing/index.tsx +51 -71
  102. package/themes/original/src/components/Cart/index.tsx +82 -15
  103. package/themes/original/src/components/Cart/styles.tsx +4 -0
  104. package/themes/original/src/components/CartContent/index.tsx +27 -17
  105. package/themes/original/src/components/CartContent/styles.tsx +1 -1
  106. package/themes/original/src/components/Checkout/index.tsx +114 -118
  107. package/themes/original/src/components/Checkout/styles.tsx +4 -3
  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 +4 -4
  111. package/themes/original/src/components/DriverTips/styles.tsx +2 -1
  112. package/themes/original/src/components/FavoriteList/index.tsx +69 -45
  113. package/themes/original/src/components/FloatingButton/index.tsx +13 -11
  114. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  115. package/themes/original/src/components/GPSButton/index.tsx +20 -19
  116. package/themes/original/src/components/GPSButton/styles.ts +3 -3
  117. package/themes/original/src/components/GoogleMap/index.tsx +20 -12
  118. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +25 -10
  119. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +4 -0
  120. package/themes/original/src/components/HelpGuide/index.tsx +9 -8
  121. package/themes/original/src/components/HelpOrder/index.tsx +9 -8
  122. package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
  123. package/themes/original/src/components/LoginForm/Otp/index.tsx +89 -73
  124. package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
  125. package/themes/original/src/components/LoginForm/index.tsx +98 -41
  126. package/themes/original/src/components/LottieAnimation/index.tsx +69 -0
  127. package/themes/original/src/components/Messages/index.tsx +35 -20
  128. package/themes/original/src/components/MomentOption/index.tsx +8 -6
  129. package/themes/original/src/components/MultiCart/index.tsx +63 -0
  130. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -93
  131. package/themes/original/src/components/MultiCheckout/index.tsx +10 -2
  132. package/themes/original/src/components/MultiOrdersDetails/index.tsx +34 -16
  133. package/themes/original/src/components/MyOrders/index.tsx +88 -24
  134. package/themes/original/src/components/NavBar/index.tsx +11 -5
  135. package/themes/original/src/components/NetworkError/index.tsx +5 -3
  136. package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
  137. package/themes/original/src/components/Notifications/index.tsx +148 -0
  138. package/themes/original/src/components/Notifications/styles.tsx +20 -0
  139. package/themes/original/src/components/OrderDetails/index.tsx +162 -50
  140. package/themes/original/src/components/OrderDetails/styles.tsx +15 -2
  141. package/themes/original/src/components/OrderItAgain/index.tsx +75 -0
  142. package/themes/original/src/components/OrderItAgain/styles.tsx +10 -0
  143. package/themes/original/src/components/OrderProgress/index.tsx +77 -66
  144. package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
  145. package/themes/original/src/components/OrderSummary/index.tsx +2 -35
  146. package/themes/original/src/components/OrderTypeSelector/index.tsx +85 -36
  147. package/themes/original/src/components/OrderTypeSelector/styles.tsx +19 -1
  148. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +94 -98
  149. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
  150. package/themes/original/src/components/OrdersOption/index.tsx +91 -53
  151. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  152. package/themes/original/src/components/PaymentOptions/index.tsx +1 -2
  153. package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
  154. package/themes/original/src/components/PlaceSpot/index.tsx +249 -47
  155. package/themes/original/src/components/PlaceSpot/styles.tsx +0 -2
  156. package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
  157. package/themes/original/src/components/ProductForm/index.tsx +365 -384
  158. package/themes/original/src/components/ProductForm/styles.tsx +7 -12
  159. package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
  160. package/themes/original/src/components/ProductOption/index.tsx +1 -1
  161. package/themes/original/src/components/ProductOptionSubOption/index.tsx +16 -8
  162. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +0 -1
  163. package/themes/original/src/components/ProfessionalFilter/index.tsx +2 -1
  164. package/themes/original/src/components/ProfessionalProfile/index.tsx +19 -8
  165. package/themes/original/src/components/Promotions/index.tsx +232 -219
  166. package/themes/original/src/components/Promotions/styles.tsx +7 -2
  167. package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
  168. package/themes/original/src/components/ReviewOrder/index.tsx +120 -108
  169. package/themes/original/src/components/ReviewOrder/styles.tsx +5 -7
  170. package/themes/original/src/components/ReviewProducts/index.tsx +8 -5
  171. package/themes/original/src/components/ReviewTrigger/index.tsx +136 -0
  172. package/themes/original/src/components/{Reviews/ReviewOrder → ReviewTrigger}/styles.tsx +10 -22
  173. package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
  174. package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
  175. package/themes/original/src/components/ServiceForm/index.tsx +330 -266
  176. package/themes/original/src/components/SignupForm/index.tsx +134 -89
  177. package/themes/original/src/components/SingleOrderCard/index.tsx +219 -129
  178. package/themes/original/src/components/SingleOrderCard/styles.tsx +10 -8
  179. package/themes/original/src/components/SingleProductCard/index.tsx +180 -104
  180. package/themes/original/src/components/SingleProductCard/styles.tsx +3 -10
  181. package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
  182. package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
  183. package/themes/original/src/components/StripeElementsForm/index.tsx +13 -2
  184. package/themes/original/src/components/UpsellingProducts/index.tsx +15 -5
  185. package/themes/original/src/components/UserDetails/index.tsx +5 -3
  186. package/themes/original/src/components/UserFormDetails/index.tsx +6 -48
  187. package/themes/original/src/components/UserProfile/index.tsx +58 -35
  188. package/themes/original/src/components/UserProfile/styles.ts +17 -0
  189. package/themes/original/src/components/WalletTransactions/index.tsx +76 -0
  190. package/themes/original/src/components/WalletTransactions/styles.tsx +13 -0
  191. package/themes/original/src/components/Wallets/index.tsx +176 -164
  192. package/themes/original/src/components/Wallets/styles.tsx +12 -8
  193. package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
  194. package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
  195. package/themes/original/src/components/shared/OBottomPopup.tsx +36 -22
  196. package/themes/original/src/components/shared/OButton.tsx +10 -3
  197. package/themes/original/src/components/shared/OIcon.tsx +8 -1
  198. package/themes/original/src/components/shared/OInput.tsx +10 -1
  199. package/themes/original/src/layouts/Container.tsx +13 -9
  200. package/themes/original/src/layouts/FloatingBottomContainer.tsx +5 -1
  201. package/themes/original/src/types/index.tsx +65 -13
  202. package/themes/original/src/utils/index.tsx +103 -58
  203. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
  204. package/themes/original/src/components/Reviews/ReviewDriver/index.tsx +0 -301
  205. package/themes/original/src/components/Reviews/ReviewDriver/styles.tsx +0 -39
  206. package/themes/original/src/components/Reviews/ReviewOrder/index.tsx +0 -326
  207. package/themes/original/src/components/Reviews/ReviewProducts/index.tsx +0 -101
  208. package/themes/original/src/components/Reviews/ReviewProducts/styles.tsx +0 -17
  209. package/themes/original/src/components/Reviews/index.tsx +0 -9
@@ -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
 
19
20
 
20
21
  const FavoriteListUI = (props: FavoriteParams) => {
21
- const {
22
+ const {
22
23
  favoriteList,
23
24
  handleUpdateFavoriteList,
24
25
  pagination,
@@ -30,9 +31,9 @@ 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()
@@ -78,34 +79,39 @@ const FavoriteListUI = (props: FavoriteParams) => {
78
79
  const businessId = product?.category?.business?.id
79
80
  if (!categoryId || !businessId) return
80
81
  onNavigationRedirect && onNavigationRedirect('ProductDetails', {
81
- productId: product?.id,
82
- categoryId: categoryId,
83
- businessId: businessId
84
- })
82
+ isRedirect: 'business',
83
+ productId: product?.id,
84
+ businessId: businessId,
85
+ categoryId: categoryId,
86
+ business: {
87
+ store: product?.category?.business.slug,
88
+ header: product?.category?.header,
89
+ }
90
+ })
85
91
  }
86
92
 
87
93
  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
94
+ const _businessId = 'businessId:' + reorderState?.result?.business_id
95
+ if (reorderState?.error) {
96
+ if (reorderState?.result?.business_id) {
97
+ _setStoreData('adjust-cart-products', JSON.stringify(_businessId))
98
+ onNavigationRedirect && onNavigationRedirect('Business', { store: reorderState?.result?.business?.slug })
99
+ }
100
+ }
101
+ if (!reorderState?.error && reorderState.loading === false && reorderState?.result?.business_id) {
102
+ const cartProducts = carts?.[_businessId]?.products
103
+ const available = cartProducts.every((product: any) => product.valid === true)
104
+ const orderProducts = favoriteList?.favorites.find((order: any) => order?.id === reorderState?.result?.orderId)?.products
99
105
 
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])
106
+ if (available && reorderState?.result?.uuid && (cartProducts?.length === orderProducts?.length)) {
107
+ onNavigationRedirect && onNavigationRedirect('CheckoutNavigator', { cartUuid: reorderState?.result.uuid })
108
+ } else {
109
+ _setStoreData('adjust-cart-products', JSON.stringify(_businessId))
110
+ cartProducts?.length !== orderProducts?.length && _setStoreData('already-removed', JSON.stringify('removed'))
111
+ onNavigationRedirect && onNavigationRedirect('Business', { store: reorderState?.result?.business?.slug })
112
+ }
113
+ }
114
+ }, [reorderState])
109
115
 
110
116
  const handleBusinessClick = (business: any) => {
111
117
  onNavigationRedirect && onNavigationRedirect('Business', {
@@ -194,12 +200,12 @@ const FavoriteListUI = (props: FavoriteParams) => {
194
200
  )
195
201
  }
196
202
 
197
- return (
198
- <Container>
203
+ return (
204
+ <Container>
199
205
  {isBusiness && (
200
206
  <>
201
207
  {favoriteList?.favorites?.length > 0 && (
202
- favoriteList.favorites?.sort((a: any, b: any) => a?.name?.toLowerCase() > b?.name?.toLowerCase()).map((business: any, i:number) => (
208
+ favoriteList.favorites?.sort((a: any, b: any) => a?.name?.toLowerCase() > b?.name?.toLowerCase()).map((business: any, i: number) => (
203
209
  <BusinessController
204
210
  key={`${business.id}_` + i}
205
211
  business={business}
@@ -224,13 +230,19 @@ const FavoriteListUI = (props: FavoriteParams) => {
224
230
  <BusinessSkeleton key={i} />
225
231
  ))
226
232
  )}
233
+ {!favoriteList?.loading && !favoriteList?.favorites?.length && (
234
+ <NotFoundSource
235
+ content={t('NOT_FOUND_FAVORITES_LIST', 'No favorites to show at this time.')
236
+ }
237
+ />
238
+ )}
227
239
  </>
228
240
  )}
229
241
 
230
242
  {isOrder && (
231
243
  <>
232
244
  {favoriteList?.favorites?.length > 0 && (
233
- favoriteList.favorites?.sort((a: any, b:any) => moment(a?.delivery_datetime_utc).valueOf() - moment(b?.delivery_datetime_utc).valueOf())
245
+ favoriteList.favorites?.sort((a: any, b: any) => moment(a?.delivery_datetime_utc).valueOf() - moment(b?.delivery_datetime_utc).valueOf())
234
246
  .map((order: any, i: number) => (
235
247
  <SingleOrderCard
236
248
  key={`${order?.id}_${i}`}
@@ -243,13 +255,19 @@ const FavoriteListUI = (props: FavoriteParams) => {
243
255
  handleReorder={handleReorder}
244
256
  reorderLoading={reorderState?.loading}
245
257
  />
246
- ))
258
+ ))
247
259
  )}
248
260
  {favoriteList?.loading && (
249
261
  [...Array(5).keys()].map(i => (
250
262
  <OrderSkeleton key={i} />
251
263
  ))
252
264
  )}
265
+ {!favoriteList?.loading && !favoriteList?.favorites?.length && (
266
+ <NotFoundSource
267
+ content={t('NOT_FOUND_FAVORITES_LIST', 'No favorites to show at this time.')
268
+ }
269
+ />
270
+ )}
253
271
  </>
254
272
  )}
255
273
 
@@ -271,22 +289,28 @@ const FavoriteListUI = (props: FavoriteParams) => {
271
289
  <ProductSkeleton key={i} />
272
290
  ))
273
291
  )}
292
+ {!favoriteList?.loading && !favoriteList?.favorites?.length && (
293
+ <NotFoundSource
294
+ content={t('NOT_FOUND_FAVORITES_LIST', 'No favorites to show at this time.')
295
+ }
296
+ />
297
+ )}
274
298
  </>
275
299
  )}
276
300
 
277
301
  {!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
- )}
302
+ <WrappButton>
303
+ <OButton
304
+ onClick={() => getFavoriteList(pagination?.currentPage + 1)}
305
+ text={t('LOAD_MORE_ITEMS', 'Load more items')}
306
+ imgRightSrc={null}
307
+ textStyle={{ color: theme.colors.white }}
308
+ style={{ borderRadius: 7.6, shadowOpacity: 0, marginTop: 20 }}
309
+ />
310
+ </WrappButton>
311
+ )}
288
312
  </Container>
289
- )
313
+ )
290
314
  }
291
315
 
292
316
  export const FavoriteList = (props: any) => {
@@ -22,7 +22,8 @@ const FloatingButtonUI = (props: FloatingButtonParams) => {
22
22
  disabled,
23
23
  isSecondaryBtn,
24
24
  handleEmpty,
25
- iosBottom
25
+ iosBottom,
26
+ hideButton
26
27
  } = props;
27
28
 
28
29
  const [, t] = useLanguage();
@@ -77,16 +78,17 @@ const FloatingButtonUI = (props: FloatingButtonParams) => {
77
78
  </View>
78
79
  )}
79
80
  </View>
80
- <Button
81
- style={[isSecondaryBtn ? styles.secondaryBtn : styles.primaryBtn]}
82
- onPress={handleButtonClick}
83
- disabled={disabled}
84
- >
85
- <OText color={isSecondaryBtn ? theme.colors.textSecondary : theme.colors.white} lineHeight={24} size={14} weight={'400'}>
86
- {btnText}
87
- </OText>
88
- </Button>
89
-
81
+ {!hideButton && (
82
+ <Button
83
+ style={[isSecondaryBtn ? styles.secondaryBtn : styles.primaryBtn]}
84
+ onPress={handleButtonClick}
85
+ disabled={disabled}
86
+ >
87
+ <OText color={isSecondaryBtn ? theme.colors.textSecondary : theme.colors.white} lineHeight={24} size={14} weight={'400'}>
88
+ {btnText}
89
+ </OText>
90
+ </Button>
91
+ )}
90
92
  </Container>
91
93
  );
92
94
  };
@@ -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: 9999;
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
+ `
@@ -32,6 +32,7 @@ export const GoogleMap = (props: GoogleMapsParams) => {
32
32
  latitudeDelta: 0.0010,
33
33
  longitudeDelta: 0.0010 * ASPECT_RATIO
34
34
  })
35
+ const [MARKERS, SETMARKERS] = useState(locations)
35
36
  let mapRef = useRef<any>(null)
36
37
  const googleMapsApiKey = configState?.configs?.google_maps_api_key?.value
37
38
 
@@ -41,12 +42,7 @@ export const GoogleMap = (props: GoogleMapsParams) => {
41
42
  ERROR_NOT_FOUND_ADDRESS: 'Sorry, we couldn\'t find an address',
42
43
  ERROR_MAX_LIMIT_LOCATION: `Sorry, You can only set the position to ${maxLimitLocation}m`
43
44
  }
44
- const MARKERS = locations && locations.map((location: { lat: number, lng: number }) => {
45
- return {
46
- latitude: location.lat,
47
- longitude: location.lng
48
- }
49
- })
45
+
50
46
  const geocodePosition = (pos: { latitude: number, longitude: number }) => {
51
47
  Geocoder.from({
52
48
  latitude: pos.latitude,
@@ -93,7 +89,9 @@ export const GoogleMap = (props: GoogleMapsParams) => {
93
89
  return
94
90
  }
95
91
 
96
- if (distance <= maxLimitLocation) {
92
+ const _maxLimitLocation = typeof maxLimitLocation === 'string' ? parseInt(maxLimitLocation, 10) : maxLimitLocation
93
+
94
+ if (distance <= _maxLimitLocation) {
97
95
  setMarkerPosition(curPos)
98
96
  setRegion({ ...region, longitude: curPos.longitude, latitude: curPos.latitude })
99
97
  } else {
@@ -147,7 +145,7 @@ export const GoogleMap = (props: GoogleMapsParams) => {
147
145
  }
148
146
 
149
147
  const fitAllMarkers = () => {
150
- mapRef.current.fitToCoordinates(MARKERS, {
148
+ mapRef.current.fitToCoordinates(MARKERS?.map(location => ({ latitude: location.lat, longitude: location.lng })), {
151
149
  edgePadding: { top: 80, right: 80, bottom: 80, left: 80 },
152
150
  animated: true,
153
151
  });
@@ -157,6 +155,13 @@ export const GoogleMap = (props: GoogleMapsParams) => {
157
155
  Geocoder.init(googleMapsApiKey)
158
156
  }, [])
159
157
 
158
+ useEffect(() => {
159
+ mapRef.current.animateToRegion({
160
+ ...region,
161
+ latitude: location?.lat,
162
+ longitude: location?.lng,
163
+ })
164
+ }, [location])
160
165
 
161
166
  useEffect(() => {
162
167
  if (saveLocation) {
@@ -170,6 +175,9 @@ export const GoogleMap = (props: GoogleMapsParams) => {
170
175
  fitAllMarkers()
171
176
  }
172
177
  }, 1000)
178
+ if (locations) {
179
+ SETMARKERS(locations)
180
+ }
173
181
  return () => clearInterval(interval)
174
182
  }, [locations])
175
183
 
@@ -189,16 +197,16 @@ export const GoogleMap = (props: GoogleMapsParams) => {
189
197
  >
190
198
  {locations ? (
191
199
  <>
192
- {MARKERS && MARKERS.map((location: { latitude: number, longitude: number }, i: number) => (
200
+ {MARKERS && MARKERS.map((location: { lat: number, lng: number }, i: number) => (
193
201
  <React.Fragment key={i}>
194
202
  {
195
203
  <Marker
196
204
  zIndex={i}
197
- coordinate={location}
198
- title={locations[i]?.title}
205
+ coordinate={{ latitude: location.lat ?? 0, longitude: location.lng ?? 0 }}
206
+ title={MARKERS[i]?.title}
199
207
  >
200
208
  <View>
201
- <OIcon url={locations[i].icon} width={50} height={50} />
209
+ <OIcon url={MARKERS[i].icon} width={50} height={50} />
202
210
  </View>
203
211
  </Marker>
204
212
  }
@@ -1,12 +1,15 @@
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'
5
6
  import { useTheme } from 'styled-components/native'
6
- import { StyleSheet } from 'react-native'
7
+ import { StyleSheet, TouchableOpacity } from 'react-native'
8
+ import AntDesignIcon from 'react-native-vector-icons/AntDesign'
7
9
 
8
10
  import {
9
- Content
11
+ Content,
12
+ HeaderWrapper
10
13
  } from './styles'
11
14
 
12
15
  export const HelpAccountAndPayment = (props: HelpAccountAndPaymentParams) => {
@@ -37,13 +40,25 @@ export const HelpAccountAndPayment = (props: HelpAccountAndPaymentParams) => {
37
40
 
38
41
  return (
39
42
  <>
40
- <OButton
41
- imgLeftSrc={theme.images.general.arrow_left}
42
- imgRightSrc={null}
43
- style={styles.btnBackArrow}
44
- onClick={() => goToBack()}
45
- />
46
- <OText size={22} weight={600}>{t('ACCOUNT_PAYMENT_OPTIONS', 'Account and Payment Options')}</OText>
43
+ <HeaderWrapper>
44
+ <OButton
45
+ imgRightSrc={null}
46
+ style={styles.btnBackArrow}
47
+ onClick={() => goToBack()}
48
+ icon={AntDesignIcon}
49
+ iconProps={{
50
+ name: 'arrowleft',
51
+ size: 26
52
+ }}
53
+ />
54
+ <OText
55
+ size={24}
56
+ weight={Platform.OS === 'ios' ? '600' : 'bold'}
57
+ color={theme.colors.textNormal}
58
+ >
59
+ {t('ACCOUNT_PAYMENT_OPTIONS', 'Account and Payment Options')}
60
+ </OText>
61
+ </HeaderWrapper>
47
62
  <Content>
48
63
  <OText mBottom={20}>
49
64
  -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vel in congue nisl, nisi. Mauris, condimentum auctor sed cras cursus arcu pellentesque.
@@ -65,4 +80,4 @@ export const HelpAccountAndPayment = (props: HelpAccountAndPaymentParams) => {
65
80
  </Content>
66
81
  </>
67
82
  )
68
- }
83
+ }
@@ -4,3 +4,7 @@ export const Content = styled.View`
4
4
  padding-vertical: 20px;
5
5
  margin-bottom: 20px;
6
6
  `
7
+ export const HeaderWrapper = styled.View`
8
+ padding: 10px 20px 20px 0;
9
+ flex-direction: row;
10
+ `
@@ -3,10 +3,12 @@ import { useLanguage } from 'ordering-components/native'
3
3
  import { HelpGuideParams } from '../../types'
4
4
  import { OText, OButton, OIcon } from '../shared'
5
5
  import { useTheme } from 'styled-components/native'
6
- import { StyleSheet } from 'react-native'
6
+ import { StyleSheet, TouchableOpacity } from 'react-native'
7
+ import NavBar from '../NavBar'
7
8
  import {
8
9
  Content
9
10
  } from './styles'
11
+ import AntDesignIcon from 'react-native-vector-icons/AntDesign'
10
12
 
11
13
  export const HelpGuide = (props: HelpGuideParams) => {
12
14
  const {
@@ -36,13 +38,12 @@ export const HelpGuide = (props: HelpGuideParams) => {
36
38
 
37
39
  return (
38
40
  <>
39
- <OButton
40
- imgLeftSrc={theme.images.general.arrow_left}
41
- imgRightSrc={null}
42
- style={styles.btnBackArrow}
43
- onClick={() => goToBack()}
41
+ <NavBar
42
+ title={t('GUIDE_TO_ORDERING', 'Guide to Ordering')}
43
+ onActionLeft={goToBack}
44
+ btnStyle={{ paddingLeft: 0 }}
45
+ showCall={false}
44
46
  />
45
- <OText size={22} weight={600}>{t('GUIDE_TO_ORDERING', 'Guide to Ordering')}</OText>
46
47
  <Content>
47
48
  <OText mBottom={15}>
48
49
  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Blandit mauris varius faucibus varius condimentum morbi pretium mus. Aliquam bibendum erat venenatis feugiat sed.
@@ -64,4 +65,4 @@ export const HelpGuide = (props: HelpGuideParams) => {
64
65
  </Content>
65
66
  </>
66
67
  )
67
- }
68
+ }
@@ -3,8 +3,10 @@ import { useLanguage } from 'ordering-components/native'
3
3
  import { HelpOrderParams } from '../../types'
4
4
  import { OText, OButton, OIcon } from '../shared'
5
5
  import { useTheme } from 'styled-components/native'
6
- import { StyleSheet } from 'react-native'
6
+ import { StyleSheet, TouchableOpacity } from 'react-native'
7
7
  import { WebView } from 'react-native-webview'
8
+ import AntDesignIcon from 'react-native-vector-icons/AntDesign'
9
+ import NavBar from '../NavBar'
8
10
 
9
11
  import {
10
12
  Content
@@ -41,13 +43,12 @@ export const HelpOrder = (props: HelpOrderParams) => {
41
43
 
42
44
  return (
43
45
  <>
44
- <OButton
45
- imgLeftSrc={theme.images.general.arrow_left}
46
- imgRightSrc={null}
47
- style={styles.btnBackArrow}
48
- onClick={() => goToBack()}
46
+ <NavBar
47
+ title={t('HELP_WITH_ORDER', 'Help with an order')}
48
+ onActionLeft={goToBack}
49
+ btnStyle={{ paddingLeft: 0 }}
50
+ showCall={false}
49
51
  />
50
- <OText size={22} weight={600}>{t('HELP_WITH_ORDER', 'Help with an order')}</OText>
51
52
  <Content>
52
53
  <OText mBottom={20}>
53
54
  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.
@@ -76,4 +77,4 @@ export const HelpOrder = (props: HelpOrderParams) => {
76
77
  </Content>
77
78
  </>
78
79
  )
79
- }
80
+ }
@@ -1,7 +1,7 @@
1
- import React from 'react'
2
- import { LanguageSelector as LanguageSelectorController, useOrder } from 'ordering-components/native'
1
+ import React, { useState } from 'react'
2
+ import { LanguageSelector as LanguageSelectorController, useOrder, useLanguage } from 'ordering-components/native'
3
3
  import { useTheme } from 'styled-components/native';
4
- import { Platform, StyleSheet, View } from 'react-native'
4
+ import { StyleSheet, View } from 'react-native'
5
5
 
6
6
  import RNPickerSelect from 'react-native-picker-select'
7
7
  import { Container, DummyContainer } from './styles'
@@ -9,9 +9,17 @@ import { LanguageSelectorParams } from '../../types'
9
9
  import { OIcon } from '../shared'
10
10
 
11
11
  const LanguageSelectorUI = (props: LanguageSelectorParams) => {
12
+ const {
13
+ languagesState,
14
+ currentLanguage,
15
+ handleChangeLanguage,
16
+ iconColor,
17
+ pickerStyle
18
+ } = props
12
19
 
13
20
  const [orderState] = useOrder()
14
-
21
+ const [state] = useLanguage()
22
+ const [languagePressed, setLanguagePressed] = useState(currentLanguage)
15
23
  const theme = useTheme();
16
24
 
17
25
  const _pickerStyle = StyleSheet.create({
@@ -41,14 +49,11 @@ const LanguageSelectorUI = (props: LanguageSelectorParams) => {
41
49
  color: theme.colors.secundaryContrast
42
50
  }
43
51
  })
44
-
45
- const {
46
- languagesState,
47
- currentLanguage,
48
- handleChangeLanguage,
49
- iconColor,
50
- pickerStyle
51
- } = props
52
+
53
+ const changeLanguage = (lang : string) => {
54
+ setLanguagePressed(lang)
55
+ handleChangeLanguage(lang)
56
+ }
52
57
 
53
58
  const _languages = languagesState?.languages?.map((language: any) => {
54
59
  return {
@@ -67,14 +72,14 @@ const LanguageSelectorUI = (props: LanguageSelectorParams) => {
67
72
  <>
68
73
  {iconColor && <OIcon src={theme.images.general.language} color={iconColor} style={{ marginEnd: 14 }} width={16} />}
69
74
  <RNPickerSelect
70
- onValueChange={handleChangeLanguage}
75
+ onValueChange={changeLanguage}
71
76
  items={_languages || []}
72
77
  value={currentLanguage}
73
78
  style={pickerStyle ? pickerStyle : _pickerStyle}
74
79
  useNativeAndroidPickerStyle={false}
75
80
  placeholder={{}}
76
81
  Icon={() => <View style={pickerStyle ? pickerStyle.icon : _pickerStyle.icon}><OIcon src={theme.images.general.arrow_down} color={theme.colors.white} style={{ width: '100%' }} /></View>}
77
- disabled={orderState.loading}
82
+ disabled={orderState.loading || state.loading || state?.language?.code !== languagePressed}
78
83
  />
79
84
  </>
80
85
  ) : <DummyContainer />}