ordering-ui-react-native 0.16.34 → 0.16.35-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 (199) hide show
  1. package/package.json +7 -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/BusinessBasicInformation/index.tsx +11 -19
  6. package/src/components/BusinessInformation/index.tsx +33 -4
  7. package/src/components/BusinessInformation/styles.tsx +2 -2
  8. package/src/components/BusinessProductsList/index.tsx +10 -10
  9. package/src/components/BusinessesListing/index.tsx +1 -1
  10. package/src/components/Checkout/index.tsx +2 -1
  11. package/src/components/LanguageSelector/index.tsx +21 -16
  12. package/src/components/LoginForm/index.tsx +15 -0
  13. package/src/components/Messages/index.tsx +2 -2
  14. package/src/components/NotificationSetting/index.tsx +85 -0
  15. package/src/components/OrderDetails/index.tsx +2 -20
  16. package/src/components/OrdersOption/index.tsx +54 -56
  17. package/src/components/PaymentOptions/index.tsx +335 -365
  18. package/src/components/PaymentOptionsWebView/index.tsx +120 -121
  19. package/src/components/ReviewDriver/index.tsx +1 -1
  20. package/src/components/ReviewOrder/index.tsx +2 -1
  21. package/src/components/ReviewProducts/index.tsx +11 -0
  22. package/src/components/SignupForm/index.tsx +15 -0
  23. package/src/components/SingleProductReview/index.tsx +8 -5
  24. package/src/components/StripeElementsForm/index.tsx +25 -16
  25. package/src/components/VerifyPhone/styles.tsx +1 -2
  26. package/src/components/shared/OBottomPopup.tsx +6 -2
  27. package/src/index.tsx +2 -0
  28. package/src/pages/BusinessesListing.tsx +7 -6
  29. package/src/pages/OrderDetails.tsx +1 -1
  30. package/src/pages/ReviewDriver.tsx +2 -2
  31. package/src/pages/ReviewOrder.tsx +2 -2
  32. package/src/types/@fatnlazycat/react-native-recaptcha-v3/index.d.ts +1 -0
  33. package/src/utils/index.tsx +2 -1
  34. package/themes/business/index.tsx +4 -0
  35. package/themes/business/src/components/BusinessController/index.tsx +2 -2
  36. package/themes/business/src/components/Chat/index.tsx +38 -30
  37. package/themes/business/src/components/DriverMap/index.tsx +7 -5
  38. package/themes/business/src/components/DriverSchedule/index.tsx +71 -0
  39. package/themes/business/src/components/DriverSchedule/styles.tsx +6 -0
  40. package/themes/business/src/components/LoginForm/index.tsx +111 -74
  41. package/themes/business/src/components/MapView/index.tsx +12 -1
  42. package/themes/business/src/components/MessagesOption/index.tsx +11 -1
  43. package/themes/business/src/components/NewOrderNotification/index.tsx +26 -41
  44. package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
  45. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +25 -19
  46. package/themes/business/src/components/OrdersListManager/index.tsx +10 -3
  47. package/themes/business/src/components/OrdersOption/index.tsx +65 -21
  48. package/themes/business/src/components/OrdersOption/styles.tsx +5 -1
  49. package/themes/business/src/components/OrdersOptionBusiness/index.tsx +15 -1
  50. package/themes/business/src/components/OrdersOptionCity/index.tsx +15 -1
  51. package/themes/business/src/components/OrdersOptionDate/index.tsx +19 -6
  52. package/themes/business/src/components/OrdersOptionDelivery/index.tsx +15 -1
  53. package/themes/business/src/components/OrdersOptionDriver/index.tsx +15 -1
  54. package/themes/business/src/components/OrdersOptionPaymethod/index.tsx +15 -1
  55. package/themes/business/src/components/OrdersOptionStatus/index.tsx +10 -1
  56. package/themes/business/src/components/PreviousMessages/index.tsx +17 -18
  57. package/themes/business/src/components/PreviousOrders/index.tsx +21 -23
  58. package/themes/business/src/components/ProductItemAccordion/index.tsx +3 -2
  59. package/themes/business/src/components/ReviewCustomer/index.tsx +27 -13
  60. package/themes/business/src/components/ScheduleBlocked/index.tsx +53 -0
  61. package/themes/business/src/components/UserFormDetails/index.tsx +5 -2
  62. package/themes/business/src/components/UserProfileForm/index.tsx +28 -4
  63. package/themes/business/src/components/shared/ODropDown.tsx +42 -8
  64. package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
  65. package/themes/business/src/components/shared/OModal.tsx +40 -37
  66. package/themes/business/src/types/index.tsx +15 -9
  67. package/themes/business/src/utils/index.tsx +10 -0
  68. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  69. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  70. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  71. package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
  72. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  73. package/themes/kiosk/src/components/LoginForm/index.tsx +121 -10
  74. package/themes/kiosk/src/components/LoginForm/styles.tsx +5 -0
  75. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  76. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  77. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  78. package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
  79. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  80. package/themes/kiosk/src/types/index.d.ts +2 -0
  81. package/themes/original/index.tsx +4 -0
  82. package/themes/original/src/components/AddressDetails/index.tsx +2 -2
  83. package/themes/original/src/components/AddressForm/index.tsx +151 -140
  84. package/themes/original/src/components/AddressList/index.tsx +1 -1
  85. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  86. package/themes/original/src/components/BusinessBasicInformation/index.tsx +324 -162
  87. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +6 -2
  88. package/themes/original/src/components/BusinessController/index.tsx +190 -113
  89. package/themes/original/src/components/BusinessController/styles.tsx +0 -7
  90. package/themes/original/src/components/BusinessItemAccordion/index.tsx +12 -6
  91. package/themes/original/src/components/BusinessListingSearch/BusinessControllerSkeletons/index.tsx +57 -0
  92. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +59 -0
  93. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/styles.tsx +13 -0
  94. package/themes/original/src/components/BusinessListingSearch/index.tsx +80 -128
  95. package/themes/original/src/components/BusinessListingSearch/styles.tsx +10 -12
  96. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +87 -0
  97. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/styles.tsx +12 -0
  98. package/themes/original/src/components/BusinessProductsList/index.tsx +49 -52
  99. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  100. package/themes/original/src/components/BusinessProductsListing/index.tsx +179 -104
  101. package/themes/original/src/components/BusinessProductsListing/styles.tsx +18 -11
  102. package/themes/original/src/components/BusinessReviews/index.tsx +6 -1
  103. package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -2
  104. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +37 -25
  105. package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -4
  106. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +278 -104
  107. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +47 -10
  108. package/themes/original/src/components/BusinessesListing/index.tsx +95 -7
  109. package/themes/original/src/components/Cart/index.tsx +54 -16
  110. package/themes/original/src/components/Cart/styles.tsx +4 -0
  111. package/themes/original/src/components/CartContent/index.tsx +22 -16
  112. package/themes/original/src/components/Checkout/index.tsx +109 -64
  113. package/themes/original/src/components/Checkout/styles.tsx +0 -1
  114. package/themes/original/src/components/DriverTips/index.tsx +4 -4
  115. package/themes/original/src/components/DriverTips/styles.tsx +2 -1
  116. package/themes/original/src/components/Favorite/index.tsx +1 -0
  117. package/themes/original/src/components/FavoriteList/index.tsx +32 -2
  118. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  119. package/themes/original/src/components/GPSButton/index.tsx +20 -19
  120. package/themes/original/src/components/GoogleMap/index.tsx +20 -12
  121. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +25 -10
  122. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +4 -0
  123. package/themes/original/src/components/HelpGuide/index.tsx +9 -8
  124. package/themes/original/src/components/HelpOrder/index.tsx +9 -8
  125. package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
  126. package/themes/original/src/components/LoginForm/Otp/index.tsx +95 -72
  127. package/themes/original/src/components/LoginForm/index.tsx +90 -46
  128. package/themes/original/src/components/LottieAnimation/index.tsx +69 -0
  129. package/themes/original/src/components/Messages/index.tsx +17 -17
  130. package/themes/original/src/components/MomentOption/index.tsx +8 -6
  131. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -92
  132. package/themes/original/src/components/MultiCheckout/index.tsx +6 -0
  133. package/themes/original/src/components/MultiOrdersDetails/index.tsx +20 -16
  134. package/themes/original/src/components/MyOrders/index.tsx +70 -6
  135. package/themes/original/src/components/NavBar/index.tsx +15 -9
  136. package/themes/original/src/components/NetworkError/index.tsx +5 -3
  137. package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
  138. package/themes/original/src/components/Notifications/index.tsx +148 -0
  139. package/themes/original/src/components/Notifications/styles.tsx +17 -0
  140. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +167 -0
  141. package/themes/original/src/components/OrderDetails/index.tsx +200 -37
  142. package/themes/original/src/components/OrderDetails/styles.tsx +15 -2
  143. package/themes/original/src/components/OrderItAgain/index.tsx +75 -0
  144. package/themes/original/src/components/OrderItAgain/styles.tsx +10 -0
  145. package/themes/original/src/components/OrderProgress/index.tsx +77 -66
  146. package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
  147. package/themes/original/src/components/OrderSummary/index.tsx +3 -36
  148. package/themes/original/src/components/OrderTypeSelector/index.tsx +85 -36
  149. package/themes/original/src/components/OrderTypeSelector/styles.tsx +19 -1
  150. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +97 -106
  151. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
  152. package/themes/original/src/components/OrdersOption/index.tsx +71 -55
  153. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  154. package/themes/original/src/components/PaymentOptions/index.tsx +41 -23
  155. package/themes/original/src/components/PhoneInputNumber/index.tsx +5 -11
  156. package/themes/original/src/components/PlaceSpot/index.tsx +243 -47
  157. package/themes/original/src/components/PlaceSpot/styles.tsx +0 -2
  158. package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
  159. package/themes/original/src/components/ProductForm/index.tsx +635 -664
  160. package/themes/original/src/components/ProductForm/styles.tsx +9 -8
  161. package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
  162. package/themes/original/src/components/ProductOption/index.tsx +1 -1
  163. package/themes/original/src/components/ProfessionalFilter/index.tsx +2 -1
  164. package/themes/original/src/components/ProfessionalProfile/index.tsx +26 -14
  165. package/themes/original/src/components/ReviewDriver/index.tsx +7 -7
  166. package/themes/original/src/components/ReviewOrder/index.tsx +18 -3
  167. package/themes/original/src/components/ReviewProducts/index.tsx +2 -2
  168. package/themes/original/src/components/ReviewTrigger/index.tsx +118 -0
  169. package/themes/original/src/components/ReviewTrigger/styles.tsx +34 -0
  170. package/themes/original/src/components/SearchBar/index.tsx +5 -3
  171. package/themes/original/src/components/ServiceForm/index.tsx +410 -258
  172. package/themes/original/src/components/SignupForm/index.tsx +350 -206
  173. package/themes/original/src/components/SingleOrderCard/index.tsx +229 -181
  174. package/themes/original/src/components/SingleOrderCard/styles.tsx +0 -7
  175. package/themes/original/src/components/SingleProductCard/index.tsx +200 -110
  176. package/themes/original/src/components/SingleProductCard/styles.tsx +2 -10
  177. package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
  178. package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
  179. package/themes/original/src/components/StripeElementsForm/index.tsx +18 -7
  180. package/themes/original/src/components/UpsellingProducts/index.tsx +15 -5
  181. package/themes/original/src/components/UserDetails/index.tsx +11 -2
  182. package/themes/original/src/components/UserFormDetails/index.tsx +67 -77
  183. package/themes/original/src/components/UserProfile/index.tsx +56 -31
  184. package/themes/original/src/components/UserProfile/styles.ts +17 -0
  185. package/themes/original/src/components/UserProfileForm/index.tsx +10 -10
  186. package/themes/original/src/components/WalletTransactions/index.tsx +76 -0
  187. package/themes/original/src/components/WalletTransactions/styles.tsx +13 -0
  188. package/themes/original/src/components/Wallets/index.tsx +176 -164
  189. package/themes/original/src/components/Wallets/styles.tsx +12 -8
  190. package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
  191. package/themes/original/src/components/shared/OBottomPopup.tsx +48 -15
  192. package/themes/original/src/components/shared/OButton.tsx +10 -3
  193. package/themes/original/src/components/shared/OIcon.tsx +8 -1
  194. package/themes/original/src/components/shared/OInput.tsx +13 -3
  195. package/themes/original/src/layouts/Container.tsx +13 -9
  196. package/themes/original/src/layouts/FloatingBottomContainer.tsx +5 -1
  197. package/themes/original/src/types/index.tsx +91 -30
  198. package/themes/original/src/utils/index.tsx +121 -10
  199. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -0,0 +1,69 @@
1
+ import React, { useRef } from 'react'
2
+ import Lottie from 'lottie-react-native';
3
+ import { TouchableOpacity, Easing, ViewStyle, Animated } from 'react-native';
4
+ import IconAntDesign from 'react-native-vector-icons/AntDesign'
5
+ import { useTheme } from 'styled-components';
6
+
7
+ interface Props {
8
+ initialValue: number,
9
+ onClick: any,
10
+ disableAnimation?: boolean
11
+ toValue: number,
12
+ style?: ViewStyle,
13
+ duration?: number,
14
+ type: 'favorite', // animation types
15
+ isActive: boolean,
16
+ animationType?: ((value : number) => number);
17
+ useNativeDriver?: boolean,
18
+ iconProps?: {color?: string, size?: number, style?: ViewStyle}
19
+ }
20
+
21
+ export const LottieAnimation = (props: Props) => {
22
+ const {
23
+ initialValue,
24
+ onClick,
25
+ disableAnimation,
26
+ toValue,
27
+ style,
28
+ duration,
29
+ type,
30
+ isActive,
31
+ useNativeDriver,
32
+ animationType,
33
+ iconProps
34
+ } = props
35
+ const theme = useTheme()
36
+ const animationProgress = useRef(new Animated.Value(initialValue))
37
+ const favoriteArray = ['heart', 'hearto']
38
+ const icon = type === 'favorite' ? favoriteArray : []
39
+ const animationGif = type === 'favorite' ? theme.images?.general?.heart : ''
40
+ const onPressLottie = () => {
41
+ if (!disableAnimation) {
42
+ Animated.timing(animationProgress.current, {
43
+ toValue,
44
+ duration: duration || 5000,
45
+ easing: animationType || Easing.linear,
46
+ useNativeDriver: useNativeDriver ?? true
47
+ }).start();
48
+ }
49
+ onClick()
50
+ }
51
+
52
+ return (
53
+ <TouchableOpacity
54
+ onPress={onPressLottie}
55
+ style={style}
56
+ >
57
+ <Lottie
58
+ progress={animationProgress.current}
59
+ source={animationGif}
60
+ />
61
+ <IconAntDesign
62
+ name={isActive ? icon[0] : icon[1]}
63
+ color={iconProps?.color || theme.colors.danger5}
64
+ size={iconProps?.size || 16}
65
+ style={iconProps?.style}
66
+ />
67
+ </TouchableOpacity>
68
+ )
69
+ }
@@ -5,6 +5,7 @@ import { launchImageLibrary } from 'react-native-image-picker'
5
5
  import { GiftedChat, Actions, ActionsProps, InputToolbar, Composer, Send, Bubble, MessageImage, InputToolbarProps, ComposerProps } from 'react-native-gifted-chat'
6
6
  import { USER_TYPE } from '../../config/constants'
7
7
  import MaterialCommunityIcon from 'react-native-vector-icons/MaterialCommunityIcons'
8
+ import AntDesignIcon from 'react-native-vector-icons/AntDesign'
8
9
  import { OIcon, OIconButton, OText, OButton } from '../shared'
9
10
  import { TouchableOpacity, ActivityIndicator, StyleSheet, View, Platform, Keyboard } from 'react-native'
10
11
  import { Header, TitleHeader, Wrapper, QuickMessageContainer, ProfileMessageHeader, MessageTypeItem } from './styles'
@@ -36,7 +37,7 @@ const ORDER_STATUS: any = {
36
37
  20: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
37
38
  21: 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
38
39
  22: 'ORDER_LOOKING_FOR_DRIVER',
39
- 23: 'ORDER_DRIVER_ON_WAY'
40
+ 23: 'ORDER_DRIVER_ON_WAY'
40
41
  }
41
42
 
42
43
  const filterSpecialStatus = ['prepared_in', 'delivered_in', 'delivery_datetime']
@@ -122,18 +123,17 @@ const MessagesUI = (props: MessagesParams) => {
122
123
 
123
124
  const messageConsole = (message: any) => {
124
125
  return message.change?.attribute !== 'driver_id'
125
- ?
126
- `${t('ORDER', 'Order')} ${t(message.change.attribute.toUpperCase(), message.change.attribute.replace('_', ' '))} ${t('CHANGED_FROM', 'Changed from')} ${
127
- filterSpecialStatus.includes(message.change.attribute) ?
128
- `${message.change.old === null ? '0' : message.change.old} ${t('TO', 'to')} ${message.change.new} ${t('MINUTES', 'Minutes')}` :
129
- `${message.change.old !== null && t(ORDER_STATUS[parseInt(message.change.old, 10)])} ${t('TO', 'to')} ${t(ORDER_STATUS[parseInt(message.change.new, 10)])}`
130
- }`
131
- : message.change.new
132
126
  ?
133
- `${message.driver?.name} ${message.driver?.lastname !== null ? message.driver.lastname : ''} ${t('WAS_ASSIGNED_AS_DRIVER', 'Was assigned as driver')} ${message.comment ? message.comment.length : ''}`
134
- :
135
- `${t('DRIVER_UNASSIGNED', 'Driver unassigned')}`
136
- }
127
+ `${t('ORDER', 'Order')} ${t(message.change.attribute.toUpperCase(), message.change.attribute.replace('_', ' '))} ${t('CHANGED_FROM', 'Changed from')} ${filterSpecialStatus.includes(message.change.attribute) ?
128
+ `${message.change.old === null ? '0' : message.change.old} ${t('TO', 'to')} ${message.change.new} ${t('MINUTES', 'Minutes')}` :
129
+ `${message.change.old !== null && t(ORDER_STATUS[parseInt(message.change.old, 10)])} ${t('TO', 'to')} ${t(ORDER_STATUS[parseInt(message.change.new, 10)])}`
130
+ }`
131
+ : message.change.new
132
+ ?
133
+ `${message.driver?.name} ${message.driver?.lastname !== null ? message.driver.lastname : ''} ${t('WAS_ASSIGNED_AS_DRIVER', 'Was assigned as driver')} ${message.comment ? message.comment.length : ''}`
134
+ :
135
+ `${t('DRIVER_UNASSIGNED', 'Driver unassigned')}`
136
+ }
137
137
 
138
138
  useEffect(() => {
139
139
  let newMessages: Array<any> = []
@@ -402,7 +402,9 @@ const MessagesUI = (props: MessagesParams) => {
402
402
  <Wrapper>
403
403
  {!isMeesageListing ? (
404
404
  <Header>
405
- <OIconButton icon={theme.images.general.arrow_left} style={{ paddingStart: 10, borderColor: theme.colors.clear }} onClick={onClose} />
405
+ <TouchableOpacity onPress={onClose} style={{ paddingStart: 10, borderColor: theme.colors.clear }}>
406
+ <AntDesignIcon name='arrowleft' size={26} />
407
+ </TouchableOpacity>
406
408
  <View style={{ marginRight: 10, shadowColor: theme.colors.black, shadowOpacity: 0.1, shadowOffset: { width: 0, height: 1 }, shadowRadius: 2 }}>
407
409
  <OIcon
408
410
  url={type === USER_TYPE.DRIVER ? order?.driver?.photo : order?.business?.logo}
@@ -419,10 +421,8 @@ const MessagesUI = (props: MessagesParams) => {
419
421
  ) : (
420
422
  <ProfileMessageHeader>
421
423
  <View style={{ ...styles.headerTitle }}>
422
- <TouchableOpacity
423
- style={styles.headerItem}
424
- onPress={onClose}>
425
- <OIcon src={theme.images.general.arrow_left} width={16} />
424
+ <TouchableOpacity onPress={onClose} style={styles.headerItem}>
425
+ <AntDesignIcon name='arrowleft' size={26} />
426
426
  </TouchableOpacity>
427
427
  <OText size={18}>{t('ORDER', theme?.defaultLanguages?.ORDER || 'Order')} #{order?.id}</OText>
428
428
  </View>
@@ -28,6 +28,7 @@ import {
28
28
  TimeItem
29
29
  } from './styles';
30
30
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
31
+ import { locale, monthsEnum } from '../../utils';
31
32
 
32
33
  const MomentOptionUI = (props: MomentOptionParams) => {
33
34
  const {
@@ -258,7 +259,7 @@ const MomentOptionUI = (props: MomentOptionParams) => {
258
259
  onActionLeft={() => goToBack()}
259
260
  btnStyle={{ paddingLeft: 0 }}
260
261
  paddingTop={0}
261
- style={{ paddingBottom: 0, flexDirection: 'column', alignItems: 'flex-start' }}
262
+ style={{ paddingBottom: 0 }}
262
263
  title={t('QUESTION_WHEN_ORDER', 'When do you want your order?')}
263
264
  titleAlign={'center'}
264
265
  titleStyle={{ fontSize: 14, marginRight: 0, marginLeft: 0 }}
@@ -281,7 +282,7 @@ const MomentOptionUI = (props: MomentOptionParams) => {
281
282
  style={{ marginEnd: 24 }}
282
283
  />
283
284
  )}
284
- <OText color={optionSelected.isAsap ? theme.colors.textNormal : theme.colors.disabled}>{t('ASAP_ABBREVIATION', 'ASAP') + ` (${moment().format('dddd, MMM D, yyyy h:mm A')} + delivery time)`}</OText>
285
+ <OText color={optionSelected.isAsap ? theme.colors.textNormal : theme.colors.disabled}>{t('ASAP_ABBREVIATION', 'ASAP') + ` (${t(moment().format('dddd')?.toLocaleUpperCase(), moment().format('dddd'))}, ${t(monthsEnum[moment().format('MMM')], moment().format('MMM'))}${moment().format(' D, yyyy h:mm A')} + ${t('DELIVERY_TIME', 'delivery time')})`}</OText>
285
286
  </WrapSelectOption>
286
287
  <WrapSelectOption
287
288
  onPress={() => setOptionSelected({ isAsap: false, isSchedule: true })}
@@ -308,6 +309,7 @@ const MomentOptionUI = (props: MomentOptionParams) => {
308
309
  {selectDate && datesWhitelist[0]?.start !== null && (
309
310
  <CalendarStrip
310
311
  scrollable
312
+ locale={locale}
311
313
  style={styles.calendar}
312
314
  calendarHeaderContainerStyle={styles.calendarHeaderContainer}
313
315
  calendarHeaderStyle={styles.calendarHeader}
@@ -342,12 +344,12 @@ const MomentOptionUI = (props: MomentOptionParams) => {
342
344
  style={{
343
345
  lineHeight: 24
344
346
  }}
345
- >{is12hours ? (
346
- time.startTime.includes('12')
347
+ >{is12hours ? (
348
+ time.startTime.includes('12')
347
349
  ? `${time.startTime}PM`
348
350
  : parseTime(moment(time.startTime, 'HH:mm'), { outputFormat: 'hh:mma' })
349
- ) : time.startTime
350
- }</OText>
351
+ ) : time.startTime
352
+ }</OText>
351
353
  </TimeItem>
352
354
  </TouchableOpacity>
353
355
  ))}
@@ -7,7 +7,7 @@ import {
7
7
  } from 'ordering-components/native'
8
8
  import { useTheme } from 'styled-components/native'
9
9
  import { View, TouchableOpacity, FlatList, StyleSheet, KeyboardAvoidingView, Platform } from 'react-native'
10
- import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder'
10
+ import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder'
11
11
  import { OText, OIcon, OModal, OButton } from '../shared'
12
12
  import { getIconCard, flatArray } from '../../utils'
13
13
  import { StripeElementsForm } from '../StripeElementsForm'
@@ -37,7 +37,7 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
37
37
  const [{ configs }] = useConfig()
38
38
  const [{ parsePrice }] = useUtils()
39
39
 
40
- const [addCardOpen, setAddCardOpen] = useState({ stripe: false, stripeConnect: false });
40
+ const [addCardOpen, setAddCardOpen] = useState({ stripe: false, stripeConnect: false });
41
41
 
42
42
  const isWalletCashEnabled = configs?.wallet_cash_enabled?.value === '1'
43
43
  const isWalletPointsEnabled = configs?.wallet_credit_point_enabled?.value === '1'
@@ -54,52 +54,52 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
54
54
  }
55
55
 
56
56
  const getPayIcon = (method: string) => {
57
- switch (method) {
58
- case 'cash':
59
- return theme.images.general.cash
60
- case 'card_delivery':
61
- return theme.images.general.carddelivery
62
- case 'paypal':
63
- return theme.images.general.paypal
64
- case 'stripe':
65
- return theme.images.general.stripe
66
- case 'stripe_direct':
67
- return theme.images.general.stripecc
68
- case 'stripe_connect':
69
- return theme.images.general.stripes
70
- case 'stripe_redirect':
71
- return theme.images.general.stripesb
72
- default:
73
- return theme.images.general.creditCard
74
- }
75
- }
57
+ switch (method) {
58
+ case 'cash':
59
+ return theme.images.general.cash
60
+ case 'card_delivery':
61
+ return theme.images.general.carddelivery
62
+ case 'paypal':
63
+ return theme.images.general.paypal
64
+ case 'stripe':
65
+ return theme.images.general.stripe
66
+ case 'stripe_direct':
67
+ return theme.images.general.stripecc
68
+ case 'stripe_connect':
69
+ return theme.images.general.stripes
70
+ case 'stripe_redirect':
71
+ return theme.images.general.stripesb
72
+ default:
73
+ return theme.images.general.creditCard
74
+ }
75
+ }
76
76
 
77
77
  const renderPaymethods = ({ item }: any) => {
78
- return (
79
- <TouchableOpacity
80
- onPress={() => handleSelectPaymethod(item)}
81
- >
82
- <PMItem
83
- key={item.id}
84
- isActive={paymethodSelected?.paymethod_id === item.paymethod_id}
85
- >
86
- <OIcon
87
- src={getPayIcon(item.paymethod?.gateway)}
88
- width={20}
89
- height={20}
90
- color={paymethodSelected?.paymethod_id === item.paymethod_id ? theme.colors.white : theme.colors.backgroundDark}
91
- />
92
- <OText
93
- size={10}
94
- style={{ margin: 0, marginTop: 4 }}
95
- color={paymethodSelected?.paymethod_id === item.paymethod_id ? theme.colors.white : '#000'}
96
- >
97
- {t(item?.paymethod?.gateway.toUpperCase(), item?.paymethod?.name)}
98
- </OText>
99
- </PMItem>
100
- </TouchableOpacity>
101
- )
102
- }
78
+ return (
79
+ <TouchableOpacity
80
+ onPress={() => handleSelectPaymethod(item)}
81
+ >
82
+ <PMItem
83
+ key={item.id}
84
+ isActive={paymethodSelected?.paymethod_id === item.paymethod_id}
85
+ >
86
+ <OIcon
87
+ src={getPayIcon(item.paymethod?.gateway)}
88
+ width={20}
89
+ height={20}
90
+ color={paymethodSelected?.paymethod_id === item.paymethod_id ? theme.colors.white : theme.colors.backgroundDark}
91
+ />
92
+ <OText
93
+ size={10}
94
+ style={{ margin: 0, marginTop: 4 }}
95
+ color={paymethodSelected?.paymethod_id === item.paymethod_id ? theme.colors.white : '#000'}
96
+ >
97
+ {t(item?.paymethod?.gateway.toUpperCase(), item?.paymethod?.name)}
98
+ </OText>
99
+ </PMItem>
100
+ </TouchableOpacity>
101
+ )
102
+ }
103
103
 
104
104
  return (
105
105
  <PMContainer>
@@ -123,10 +123,10 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
123
123
  ) : (
124
124
  <FlatList
125
125
  horizontal
126
- showsHorizontalScrollIndicator={false}
127
- data={businessPaymethods.result.filter((paymethod: any) => paymethodsAndWallets.paymethods.find((item: any) => item.id === paymethod.paymethod_id))}
128
- renderItem={renderPaymethods}
129
- keyExtractor={(paymethod: any) => paymethod?.id?.toString?.()}
126
+ showsHorizontalScrollIndicator={false}
127
+ data={businessPaymethods?.result?.filter((paymethod: any) => paymethodsAndWallets.paymethods.find((item: any) => item.id === paymethod.paymethod_id))}
128
+ renderItem={renderPaymethods}
129
+ keyExtractor={(paymethod: any) => paymethod?.id?.toString?.()}
130
130
  />
131
131
  )}
132
132
  {!paymethodsAndWallets.loading && !paymethodsAndWallets.error && paymethodsAndWallets.paymethods.length === 0 && (
@@ -138,22 +138,22 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
138
138
  {paymethodSelected?.paymethod?.gateway === 'stripe' && (
139
139
  <View>
140
140
  <OButton
141
- text={t('ADD_PAYMENT_CARD', 'Add New Payment Card')}
142
- bgColor={theme.colors.white}
143
- borderColor={theme.colors.primary}
144
- style={styles.btnAddStyle}
145
- textStyle={{ color: theme.colors.primary, fontSize: 12 }}
146
- imgRightSrc={null}
147
- onClick={() => setAddCardOpen({ ...addCardOpen, stripe: true })}
148
- />
141
+ text={t('ADD_PAYMENT_CARD', 'Add New Payment Card')}
142
+ bgColor={theme.colors.white}
143
+ borderColor={theme.colors.primary}
144
+ style={styles.btnAddStyle}
145
+ textStyle={{ color: theme.colors.primary, fontSize: 12 }}
146
+ imgRightSrc={null}
147
+ onClick={() => setAddCardOpen({ ...addCardOpen, stripe: true })}
148
+ />
149
149
  <StripeCardsList
150
- paymethod={paymethodSelected?.paymethod}
151
- businessId={businessIds[0]}
150
+ paymethod={paymethodSelected?.paymethod}
151
+ businessId={businessIds[0]}
152
152
  businessIds={businessIds}
153
- publicKey={paymethodSelected?.data?.publishable}
154
- payType={paymethodSelected?.paymethod?.name}
155
- onSelectCard={handlePaymethodDataChange}
156
- />
153
+ publicKey={paymethodSelected?.data?.publishable}
154
+ payType={paymethodSelected?.paymethod?.name}
155
+ onSelectCard={handlePaymethodDataChange}
156
+ />
157
157
  </View>
158
158
  )}
159
159
 
@@ -170,7 +170,7 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
170
170
  </>
171
171
  ) : (
172
172
  <>
173
- {walletsState.result.filter((wallet: any) => paymethodsAndWallets.wallets.find((item: any) => item.type === wallet.type)).map((wallet: any, idx: any) => walletName[wallet.type]?.isActive && (
173
+ {walletsState?.result?.filter((wallet: any) => paymethodsAndWallets.wallets.find((item: any) => item.type === wallet.type)).map((wallet: any, idx: any) => walletName[wallet.type]?.isActive && (
174
174
  <WalletItem
175
175
  key={wallet.type}
176
176
  isBottomBorder={idx === paymethodsAndWallets.wallets?.length - 1}
@@ -197,40 +197,40 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
197
197
  )}
198
198
 
199
199
  <OModal
200
- entireModal
201
- title={t('ADD_CREDIT_OR_DEBIT_CARD', 'Add credit or debit card')}
202
- open={addCardOpen.stripe}
203
- onClose={() => setAddCardOpen({ ...addCardOpen, stripe: false })}
204
- style={{ backgroundColor: 'red' }}
205
- >
206
- <KeyboardAvoidingView
207
- behavior={Platform.OS == 'ios' ? 'padding' : 'height'}
208
- keyboardVerticalOffset={Platform.OS == 'ios' ? 0 : 0}
209
- enabled={Platform.OS === 'ios' ? true : false}
210
- >
211
- <StripeElementsForm
212
- toSave
213
- businessId={businessIds[0]}
200
+ entireModal
201
+ title={t('ADD_CREDIT_OR_DEBIT_CARD', 'Add credit or debit card')}
202
+ open={addCardOpen.stripe}
203
+ onClose={() => setAddCardOpen({ ...addCardOpen, stripe: false })}
204
+ style={{ backgroundColor: 'red' }}
205
+ >
206
+ <KeyboardAvoidingView
207
+ behavior={Platform.OS == 'ios' ? 'padding' : 'height'}
208
+ keyboardVerticalOffset={Platform.OS == 'ios' ? 0 : 0}
209
+ enabled={Platform.OS === 'ios' ? true : false}
210
+ >
211
+ <StripeElementsForm
212
+ toSave
213
+ businessId={businessIds[0]}
214
214
  businessIds={businessIds}
215
215
  publicKey={paymethodSelected?.data?.publishable}
216
- requirements={props.clientSecret}
217
- onSelectCard={handlePaymethodDataChange}
218
- onCancel={() => setAddCardOpen({ ...addCardOpen, stripe: false })}
219
- />
220
- </KeyboardAvoidingView>
221
- </OModal>
216
+ requirements={props.clientSecret}
217
+ onSelectCard={handlePaymethodDataChange}
218
+ onCancel={() => setAddCardOpen({ ...addCardOpen, stripe: false })}
219
+ />
220
+ </KeyboardAvoidingView>
221
+ </OModal>
222
222
  </PMContainer>
223
223
  )
224
224
  }
225
225
 
226
226
  const styles = StyleSheet.create({
227
- btnAddStyle: {
228
- marginVertical: 20,
229
- borderRadius: 7.6,
230
- shadowOpacity: 0,
231
- height: 44,
232
- borderWidth: 1
233
- },
227
+ btnAddStyle: {
228
+ marginVertical: 20,
229
+ borderRadius: 7.6,
230
+ shadowOpacity: 0,
231
+ height: 44,
232
+ borderWidth: 1
233
+ },
234
234
  })
235
235
 
236
236
 
@@ -79,6 +79,7 @@ const MultiCheckoutUI = (props: any) => {
79
79
  const isPreOrder = configs?.preorder_status_enabled?.value === '1'
80
80
  const maximumCarts = 5
81
81
  const isDisablePlaceOrderButton = !(paymethodSelected?.paymethod_id || paymethodSelected?.wallet_id) || openCarts.length > maximumCarts
82
+ const walletCarts = (Object.values(carts)?.filter((cart: any) => cart?.products && cart?.products?.length && cart?.status !== 2 && cart?.valid_schedule && cart?.valid_products && cart?.valid_address && cart?.valid_maximum && cart?.valid_minimum && cart?.wallets) || null) || []
82
83
 
83
84
  const [isUserDetailsEdit, setIsUserDetailsEdit] = useState(false);
84
85
  const [phoneUpdate, setPhoneUpdate] = useState(false);
@@ -253,6 +254,11 @@ const MultiCheckoutUI = (props: any) => {
253
254
  </OText>
254
255
  </CCNotCarts>
255
256
  )}
257
+ {walletCarts.length > 0 && (
258
+ <OText size={14} color={theme.colors.danger5} style={{ marginVertical: 20 }}>
259
+ {t('WARNING_PARTIAL_WALLET_CARTS', 'Important: One or more carts can`t be completed due a partial payment with cash/points wallet and requires to be paid individually')}
260
+ </OText>
261
+ )}
256
262
  {openCarts.length > 0 && (
257
263
  <ChCartsTotal>
258
264
  <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
@@ -1,11 +1,12 @@
1
1
  import React, { useEffect } from 'react'
2
- import { useLanguage, useUtils, useToast, ToastType, MultiOrdersDetails as MultiOrdersDetailsController } from 'ordering-components/native'
3
- import { View, StyleSheet, BackHandler } from 'react-native'
2
+ import { useLanguage, useUtils, useToast, ToastType, MultiOrdersDetails as MultiOrdersDetailsController } from 'ordering-components/native'
3
+ import { View, StyleSheet, BackHandler, TouchableOpacity } from 'react-native'
4
4
  import { useTheme } from 'styled-components/native'
5
5
  import { OText, OButton } from '../shared'
6
6
  import { Container } from '../../layouts/Container'
7
7
  import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder'
8
8
  import { SingleOrderCard } from './SingleOrderCard'
9
+ import AntDesignIcon from 'react-native-vector-icons/AntDesign'
9
10
 
10
11
  import {
11
12
  OrdersDetailsContainer,
@@ -29,20 +30,20 @@ export const MultiOrdersDetailsUI = (props: any) => {
29
30
  } = props
30
31
 
31
32
  const theme = useTheme()
32
- const styles = StyleSheet.create({
33
+ const styles = StyleSheet.create({
33
34
  btnBackArrow: {
34
- borderWidth: 0,
35
- backgroundColor: theme.colors.clear,
36
- shadowColor: theme.colors.clear,
37
- padding: 0,
35
+ borderWidth: 0,
36
+ backgroundColor: theme.colors.clear,
37
+ shadowColor: theme.colors.clear,
38
+ padding: 0,
38
39
  marginLeft: -20
39
- },
40
- })
41
-
40
+ },
41
+ })
42
+
42
43
  const { loading, orders, error } = props.ordersList
43
44
  const [, t] = useLanguage()
44
45
  const [{ parsePrice, parseNumber, parseDate }] = useUtils();
45
- const [, { showToast }] = useToast();
46
+ const [, { showToast }] = useToast();
46
47
 
47
48
  const walletName: any = {
48
49
  cash: {
@@ -60,7 +61,7 @@ export const MultiOrdersDetailsUI = (props: any) => {
60
61
  }
61
62
  navigation.navigate('BusinessList');
62
63
  return true
63
- }
64
+ }
64
65
 
65
66
  const handleGoToOrderDetails = (uuid: any) => {
66
67
  navigation.navigate('OrderDetails', { orderId: uuid })
@@ -68,7 +69,7 @@ export const MultiOrdersDetailsUI = (props: any) => {
68
69
 
69
70
  useEffect(() => {
70
71
  if (error) {
71
- showToast(ToastType.Error, error)
72
+ showToast(ToastType.Error, error)
72
73
  }
73
74
  }, [error])
74
75
 
@@ -83,11 +84,14 @@ export const MultiOrdersDetailsUI = (props: any) => {
83
84
  <OrdersDetailsContainer keyboardShouldPersistTaps="handled" contentContainerStyle={{ paddingHorizontal: 40 }}>
84
85
  <View style={{ flexDirection: 'row' }}>
85
86
  <OButton
86
- imgLeftSrc={theme.images.general.arrow_left}
87
87
  imgRightSrc={null}
88
88
  style={styles.btnBackArrow}
89
89
  onClick={() => handleArrowBack()}
90
- imgLeftStyle={{ tintColor: theme.colors.textNormal, width: 16 }}
90
+ icon={AntDesignIcon}
91
+ iconProps={{
92
+ name: 'arrowleft',
93
+ size: 26
94
+ }}
91
95
  />
92
96
  </View>
93
97
  <Header>
@@ -202,7 +206,7 @@ export const MultiOrdersDetailsUI = (props: any) => {
202
206
  </Row>
203
207
  <Row>
204
208
  <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
205
- {t('ESTIMATED_TAX_TO_BE_COLLECTED', 'Estimated tax to be collected')}:
209
+ {t('ESTIMATED_TAX_TO_BE_COLLECTED', 'Estimated tax to be collected')}:
206
210
  </OText>
207
211
  <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
208
212
  {parsePrice(ordersSummary?.tax)}
@@ -1,9 +1,10 @@
1
1
  import React, { useState, useEffect } from 'react'
2
2
  import { useLanguage } from 'ordering-components/native';
3
- import { View, StyleSheet, RefreshControl } from 'react-native';
3
+ import { View, StyleSheet, RefreshControl, Platform } from 'react-native';
4
+ import AntDesignIcon from 'react-native-vector-icons/AntDesign'
4
5
 
5
6
  import { OrdersOption } from '../OrdersOption'
6
- import { HeaderTitle, OText } from '../shared'
7
+ import { HeaderTitle, OButton, OText } from '../shared'
7
8
  import { ScrollView } from 'react-native-gesture-handler';
8
9
  import { Tab } from './styles'
9
10
  import { useTheme } from 'styled-components/native';
@@ -11,6 +12,7 @@ import { Container } from '../../layouts/Container';
11
12
 
12
13
  export const MyOrders = (props: any) => {
13
14
  const {
15
+ navigation,
14
16
  hideOrders,
15
17
  businessesSearchList
16
18
  } = props
@@ -33,6 +35,10 @@ export const MyOrders = (props: any) => {
33
35
  { key: 'business', value: t('BUSINESS', 'Business') },
34
36
  { key: 'products', value: t('PRODUCTS', 'Products') }
35
37
  ]
38
+ const isChewLayout = theme?.business_view?.components?.header?.components?.layout?.type === 'chew'
39
+ const showNavbar = theme?.bar_menu?.components?.orders?.hidden
40
+
41
+ const goToBack = () => navigation?.canGoBack() && navigation.goBack()
36
42
 
37
43
  const handleOnRefresh = () => {
38
44
  setRefreshOrders(true);
@@ -67,7 +73,48 @@ export const MyOrders = (props: any) => {
67
73
  onRefresh={() => handleOnRefresh()}
68
74
  />
69
75
  }>
70
- {!hideOrders && (
76
+ {(isChewLayout || showNavbar) && (
77
+ <View style={{
78
+ width: '100%',
79
+ display: 'flex',
80
+ flexDirection: 'row',
81
+ alignItems: 'center',
82
+ paddingHorizontal: 40,
83
+ marginTop: Platform.OS === 'android' ? 50 : 30,
84
+ }}>
85
+ <OButton
86
+ imgLeftStyle={{ width: 18 }}
87
+ imgRightSrc={null}
88
+ style={{
89
+ borderWidth: 0,
90
+ width: 26,
91
+ height: 26,
92
+ backgroundColor: '#FFF',
93
+ borderColor: '#FFF',
94
+ shadowColor: '#FFF',
95
+ paddingLeft: 0,
96
+ paddingRight: 0
97
+ }}
98
+ onClick={goToBack}
99
+ icon={AntDesignIcon}
100
+ iconProps={{
101
+ name: 'arrowleft',
102
+ size: 26
103
+ }}
104
+ />
105
+ <OText
106
+ size={24}
107
+ style={{
108
+ textTransform: 'capitalize',
109
+ marginLeft: 20,
110
+ top: 2
111
+ }}
112
+ >
113
+ {t('MY_ORDERS', 'My Orders')}
114
+ </OText>
115
+ </View>
116
+ )}
117
+ {!hideOrders && !isChewLayout && !showNavbar && (
71
118
  <HeaderTitle text={t('MY_ORDERS', 'My Orders')} />
72
119
  )}
73
120
  {!allEmpty && (
@@ -119,14 +166,31 @@ export const MyOrders = (props: any) => {
119
166
  </View>
120
167
  </>
121
168
  )}
122
- {notOrderOptions.includes(selectedOption) && (
169
+ {selectedOption === 'business' && (
170
+ <OrdersOption
171
+ {...props}
172
+ isBusiness
173
+ titleContent={t('PREVIOUSLY_ORDERED', 'Previously ordered')}
174
+ hideOrders
175
+ horizontal
176
+ activeOrders
177
+ pastOrders
178
+ preOrders
179
+ businessesSearchList={businessesSearchList}
180
+ setIsEmptyBusinesses={setIsEmptyBusinesses}
181
+ businessOrderIds={businessOrderIds}
182
+ setBusinessOrderIds={setBusinessOrderIds}
183
+ ordersLength={ordersLength}
184
+ setOrdersLength={setOrdersLength}
185
+ />
186
+ )}
187
+ {selectedOption === 'products' && (
123
188
  <OrdersOption
124
189
  {...props}
190
+ isProducts
125
191
  titleContent={t('PREVIOUSLY_ORDERED', 'Previously ordered')}
126
192
  hideOrders
127
193
  horizontal
128
- isBusiness={selectedOption === 'business'}
129
- isProducts={selectedOption === 'products'}
130
194
  activeOrders
131
195
  pastOrders
132
196
  preOrders