ordering-ui-react-native 0.17.97 → 0.17.98-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 (224) hide show
  1. package/package.json +9 -7
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/BusinessInformation/index.tsx +10 -9
  4. package/src/components/BusinessesListing/index.tsx +1 -1
  5. package/src/components/OrderCreating/index.tsx +0 -20
  6. package/src/components/PaymentOptionsWebView/index.tsx +29 -8
  7. package/src/components/PhoneInputNumber/index.tsx +6 -2
  8. package/src/components/StripeMethodForm/index.tsx +136 -102
  9. package/src/components/VerifyPhone/styles.tsx +1 -2
  10. package/src/components/shared/OToast.tsx +3 -2
  11. package/src/types/index.tsx +5 -0
  12. package/src/utils/index.tsx +7 -2
  13. package/themes/business/index.tsx +2 -0
  14. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +36 -26
  15. package/themes/business/src/components/BusinessController/index.tsx +0 -1
  16. package/themes/business/src/components/Chat/index.tsx +163 -123
  17. package/themes/business/src/components/DriverMap/index.tsx +17 -6
  18. package/themes/business/src/components/DriverSchedule/index.tsx +45 -8
  19. package/themes/business/src/components/FloatingButton/index.tsx +34 -31
  20. package/themes/business/src/components/GoogleMap/index.tsx +58 -57
  21. package/themes/business/src/components/LoginForm/index.tsx +5 -2
  22. package/themes/business/src/components/MapView/index.tsx +14 -10
  23. package/themes/business/src/components/MessagesOption/index.tsx +22 -94
  24. package/themes/business/src/components/NewOrderNotification/index.tsx +123 -96
  25. package/themes/business/src/components/NotFoundSource/index.tsx +2 -2
  26. package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
  27. package/themes/business/src/components/OrderDetails/Delivery.tsx +209 -15
  28. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +84 -37
  29. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +87 -66
  30. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +200 -0
  31. package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
  32. package/themes/business/src/components/OrderMessage/index.tsx +19 -18
  33. package/themes/business/src/components/OrderSummary/index.tsx +114 -123
  34. package/themes/business/src/components/OrdersListManager/index.tsx +7 -2
  35. package/themes/business/src/components/OrdersListManager/utils.tsx +1 -1
  36. package/themes/business/src/components/OrdersOption/index.tsx +60 -47
  37. package/themes/business/src/components/PreviousMessages/FooterMessageComponent.tsx +103 -0
  38. package/themes/business/src/components/PreviousMessages/index.tsx +97 -55
  39. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +21 -29
  40. package/themes/business/src/components/PreviousOrders/OrderList.tsx +93 -0
  41. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +1 -1
  42. package/themes/business/src/components/PreviousOrders/index.tsx +198 -221
  43. package/themes/business/src/components/PreviousOrders/styles.tsx +10 -0
  44. package/themes/business/src/components/ProductItemAccordion/index.tsx +7 -1
  45. package/themes/business/src/components/ReviewCustomer/index.tsx +18 -13
  46. package/themes/business/src/components/StoresList/index.tsx +3 -4
  47. package/themes/business/src/components/UserProfileForm/index.tsx +14 -15
  48. package/themes/business/src/components/WebsocketStatus/index.tsx +171 -0
  49. package/themes/business/src/components/WebsocketStatus/styles.tsx +28 -0
  50. package/themes/business/src/components/shared/OModal.tsx +16 -9
  51. package/themes/business/src/types/index.tsx +24 -10
  52. package/themes/business/src/utils/index.tsx +29 -2
  53. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  54. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  55. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  56. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  57. package/themes/kiosk/src/components/Intro/index.tsx +16 -1
  58. package/themes/kiosk/src/components/LoginForm/index.tsx +7 -5
  59. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  60. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  61. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  62. package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +2 -2
  63. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  64. package/themes/original/index.tsx +7 -3
  65. package/themes/original/src/components/AddressDetails/index.tsx +19 -3
  66. package/themes/original/src/components/AddressForm/index.tsx +33 -15
  67. package/themes/original/src/components/AddressList/index.tsx +5 -8
  68. package/themes/original/src/components/AnalyticsSegment/index.tsx +193 -10
  69. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  70. package/themes/original/src/components/AppleLogin/styles.tsx +3 -1
  71. package/themes/original/src/components/BusinessBasicInformation/index.tsx +72 -36
  72. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +10 -12
  73. package/themes/original/src/components/BusinessController/index.tsx +35 -44
  74. package/themes/original/src/components/BusinessController/styles.tsx +12 -5
  75. package/themes/original/src/components/BusinessFeaturedController/index.tsx +21 -54
  76. package/themes/original/src/components/BusinessFeaturedController/styles.tsx +8 -0
  77. package/themes/original/src/components/BusinessInformation/index.tsx +140 -85
  78. package/themes/original/src/components/BusinessItemAccordion/index.tsx +21 -23
  79. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +1 -1
  80. package/themes/original/src/components/BusinessListingSearch/index.tsx +346 -340
  81. package/themes/original/src/components/BusinessListingSearch/styles.tsx +0 -18
  82. package/themes/original/src/components/BusinessPreorder/index.tsx +103 -19
  83. package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -2
  84. package/themes/original/src/components/BusinessProductsList/index.tsx +15 -7
  85. package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
  86. package/themes/original/src/components/BusinessProductsListing/UpsellingRedirect.tsx +1 -1
  87. package/themes/original/src/components/BusinessProductsListing/index.tsx +137 -32
  88. package/themes/original/src/components/BusinessProductsListing/styles.tsx +2 -3
  89. package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
  90. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +69 -0
  91. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +406 -0
  92. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListing.tsx +76 -0
  93. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +36 -403
  94. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  95. package/themes/original/src/components/Cart/index.tsx +44 -81
  96. package/themes/original/src/components/CartContent/index.tsx +70 -30
  97. package/themes/original/src/components/CartContent/styles.tsx +6 -6
  98. package/themes/original/src/components/Checkout/index.tsx +262 -35
  99. package/themes/original/src/components/CitiesControl/index.tsx +1 -1
  100. package/themes/original/src/components/CouponControl/index.tsx +10 -3
  101. package/themes/original/src/components/DatePicker/index.tsx +17 -0
  102. package/themes/original/src/components/DatePicker/styles.tsx +20 -0
  103. package/themes/original/src/components/DriverTips/index.tsx +12 -4
  104. package/themes/original/src/components/FacebookLogin/styles.tsx +3 -1
  105. package/themes/original/src/components/Favorite/index.tsx +1 -5
  106. package/themes/original/src/components/GPSButton/index.tsx +6 -4
  107. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
  108. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +42 -5
  109. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +2 -0
  110. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +84 -8
  111. package/themes/original/src/components/GoogleLogin/styles.tsx +1 -1
  112. package/themes/original/src/components/GoogleMap/index.tsx +63 -7
  113. package/themes/original/src/components/Home/index.tsx +13 -4
  114. package/themes/original/src/components/LastOrder/index.tsx +2 -1
  115. package/themes/original/src/components/LastOrders/index.tsx +2 -1
  116. package/themes/original/src/components/LoginForm/Otp/index.tsx +91 -25
  117. package/themes/original/src/components/LoginForm/index.tsx +64 -34
  118. package/themes/original/src/components/LottieAnimation/index.tsx +88 -63
  119. package/themes/original/src/components/MessageListing/index.tsx +9 -2
  120. package/themes/original/src/components/Messages/index.tsx +15 -4
  121. package/themes/original/src/components/MomentOption/index.tsx +41 -36
  122. package/themes/original/src/components/MomentOption/styles.tsx +0 -15
  123. package/themes/original/src/components/MomentSelector/index.tsx +1 -1
  124. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +161 -49
  125. package/themes/original/src/components/MultiCheckout/index.tsx +347 -69
  126. package/themes/original/src/components/MultiCheckout/styles.tsx +3 -1
  127. package/themes/original/src/components/MultiOrdersDetails/index.tsx +1 -1
  128. package/themes/original/src/components/MyOrders/index.tsx +12 -1
  129. package/themes/original/src/components/NavBar/index.tsx +20 -13
  130. package/themes/original/src/components/NotFoundSource/index.tsx +14 -10
  131. package/themes/original/src/components/OrderDetails/OrderEta.tsx +76 -0
  132. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +21 -5
  133. package/themes/original/src/components/OrderDetails/index.tsx +50 -38
  134. package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
  135. package/themes/original/src/components/OrderItAgain/index.tsx +3 -1
  136. package/themes/original/src/components/OrderProgress/index.tsx +34 -25
  137. package/themes/original/src/components/OrderSummary/index.tsx +59 -56
  138. package/themes/original/src/components/OrderTypeSelector/index.tsx +5 -6
  139. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +13 -13
  140. package/themes/original/src/components/OrdersOption/index.tsx +43 -20
  141. package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
  142. package/themes/original/src/components/PageBanner/index.tsx +65 -29
  143. package/themes/original/src/components/PageBanner/styles.tsx +0 -3
  144. package/themes/original/src/components/PaymentOptionCard/index.tsx +180 -0
  145. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +3 -0
  146. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  147. package/themes/original/src/components/PaymentOptions/index.tsx +100 -34
  148. package/themes/original/src/components/PhoneInputNumber/index.tsx +18 -4
  149. package/themes/original/src/components/ProductForm/index.tsx +65 -34
  150. package/themes/original/src/components/ProductForm/styles.tsx +3 -3
  151. package/themes/original/src/components/ProductItemAccordion/index.tsx +8 -6
  152. package/themes/original/src/components/ProductOptionSubOption/index.tsx +49 -20
  153. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +10 -9
  154. package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
  155. package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -50
  156. package/themes/original/src/components/ProfessionalProfile/index.tsx +36 -7
  157. package/themes/original/src/components/Promotions/index.tsx +2 -2
  158. package/themes/original/src/components/Promotions/styles.tsx +3 -1
  159. package/themes/original/src/components/ReviewProducts/index.tsx +16 -7
  160. package/themes/original/src/components/ScheduleAccordion/index.tsx +3 -3
  161. package/themes/original/src/components/ServiceForm/index.tsx +40 -20
  162. package/themes/original/src/components/SignupForm/index.tsx +27 -16
  163. package/themes/original/src/components/SingleOrderCard/index.tsx +44 -20
  164. package/themes/original/src/components/SingleOrderCard/styles.tsx +1 -1
  165. package/themes/original/src/components/SingleProductCard/index.tsx +13 -10
  166. package/themes/original/src/components/SingleProductCard/styles.tsx +8 -3
  167. package/themes/original/src/components/SingleProductReview/styles.tsx +1 -1
  168. package/themes/original/src/components/StripeCardsList/index.tsx +61 -5
  169. package/themes/original/src/components/StripeElementsForm/index.tsx +48 -34
  170. package/themes/original/src/components/StripeElementsForm/naked.tsx +12 -1
  171. package/themes/original/src/components/UpsellingProducts/index.tsx +3 -8
  172. package/themes/original/src/components/UserDetails/index.tsx +3 -1
  173. package/themes/original/src/components/UserFormDetails/index.tsx +84 -19
  174. package/themes/original/src/components/UserFormDetails/styles.tsx +1 -1
  175. package/themes/original/src/components/UserProfile/index.tsx +7 -25
  176. package/themes/original/src/components/UserProfileForm/index.tsx +30 -31
  177. package/themes/original/src/components/UserVerification/index.tsx +55 -50
  178. package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
  179. package/themes/original/src/components/WalletTransactions/index.tsx +3 -3
  180. package/themes/original/src/components/Wallets/index.tsx +51 -61
  181. package/themes/original/src/components/Wallets/styles.tsx +2 -4
  182. package/themes/original/src/components/shared/OButton.tsx +3 -3
  183. package/themes/original/src/components/shared/OInput.tsx +4 -5
  184. package/themes/original/src/components/shared/OModal.tsx +3 -3
  185. package/themes/original/src/config/constants.tsx +0 -10
  186. package/themes/original/src/types/index.tsx +31 -15
  187. package/themes/original/src/utils/index.tsx +180 -13
  188. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
  189. package/src/navigators/BottomNavigator.tsx +0 -117
  190. package/src/navigators/CheckoutNavigator.tsx +0 -66
  191. package/src/navigators/HomeNavigator.tsx +0 -202
  192. package/src/navigators/NavigationRef.tsx +0 -7
  193. package/src/navigators/RootNavigator.tsx +0 -269
  194. package/src/pages/Account.tsx +0 -34
  195. package/src/pages/AddressForm.tsx +0 -62
  196. package/src/pages/AddressList.tsx +0 -24
  197. package/src/pages/BusinessProductsList.tsx +0 -81
  198. package/src/pages/BusinessesListing.tsx +0 -43
  199. package/src/pages/CartList.tsx +0 -49
  200. package/src/pages/Checkout.tsx +0 -101
  201. package/src/pages/ForgotPassword.tsx +0 -24
  202. package/src/pages/Help.tsx +0 -23
  203. package/src/pages/HelpAccountAndPayment.tsx +0 -23
  204. package/src/pages/HelpGuide.tsx +0 -23
  205. package/src/pages/HelpOrder.tsx +0 -23
  206. package/src/pages/Home.tsx +0 -36
  207. package/src/pages/IntroductoryTutorial.tsx +0 -170
  208. package/src/pages/Login.tsx +0 -47
  209. package/src/pages/MomentOption.tsx +0 -30
  210. package/src/pages/MultiCheckout.tsx +0 -31
  211. package/src/pages/MultiOrdersDetails.tsx +0 -27
  212. package/src/pages/MyOrders.tsx +0 -40
  213. package/src/pages/NetworkError.tsx +0 -24
  214. package/src/pages/NotFound.tsx +0 -22
  215. package/src/pages/OrderDetails.tsx +0 -25
  216. package/src/pages/ProductDetails.tsx +0 -55
  217. package/src/pages/Profile.tsx +0 -36
  218. package/src/pages/ReviewDriver.tsx +0 -30
  219. package/src/pages/ReviewOrder.tsx +0 -32
  220. package/src/pages/ReviewProducts.tsx +0 -30
  221. package/src/pages/Sessions.tsx +0 -22
  222. package/src/pages/Signup.tsx +0 -53
  223. package/src/pages/SpinnerLoader.tsx +0 -10
  224. package/src/pages/Splash.tsx +0 -21
@@ -41,6 +41,16 @@ export const Timestatus = styled.View`
41
41
  height: 55px;
42
42
  border-radius: 20px;
43
43
  top: 5px;
44
+
45
+ ${({ timeState }: any) => timeState === 'in_time' && css`
46
+ background-color: #00D27A;
47
+ `}
48
+ ${({ timeState }: any) => timeState === 'at_risk' && css`
49
+ background-color: #FFC700;
50
+ `}
51
+ ${({ timeState }: any) => timeState === 'delayed' && css`
52
+ background-color: #E63757;
53
+ `}
44
54
  `
45
55
 
46
56
  export const AccordionSection = styled.View`
@@ -3,6 +3,10 @@ import { View, Animated, TouchableOpacity } from 'react-native';
3
3
  import MaterialCommunityIcon from 'react-native-vector-icons/MaterialCommunityIcons';
4
4
  import { useUtils, useLanguage } from 'ordering-components/native';
5
5
  import { useTheme } from 'styled-components/native';
6
+ import { DeviceOrientationMethods } from '../../../../../src/hooks/DeviceOrientation'
7
+
8
+ const { useDeviceOrientation } = DeviceOrientationMethods
9
+
6
10
  import {
7
11
  Accordion,
8
12
  AccordionSection,
@@ -34,6 +38,8 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
34
38
  const [, t] = useLanguage();
35
39
  const theme = useTheme();
36
40
  const [{ parsePrice }] = useUtils();
41
+ const [orientationState] = useDeviceOrientation();
42
+ const WIDTH_SCREEN = orientationState?.dimensions?.width
37
43
 
38
44
  const [isActive, setActiveState] = useState(false);
39
45
  const [isReadMore, setIsReadMore] = useState(false);
@@ -111,7 +117,7 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
111
117
  }, []);
112
118
 
113
119
  const onTextLayout = useCallback((e: any) => {
114
- setLengthMore(e.nativeEvent.lines.length >= 3); //to check the text is more than 2 lines or not
120
+ setLengthMore((e.nativeEvent.lines.length == 2 && e.nativeEvent.lines[1].width > WIDTH_SCREEN * .76) || e.nativeEvent.lines.length > 2); //to check the text is more than 2 lines or not
115
121
  },[]);
116
122
 
117
123
  return (
@@ -1,3 +1,5 @@
1
+
2
+
1
3
  import React, { useState, useEffect, useRef } from 'react'
2
4
  import {
3
5
  useLanguage,
@@ -86,6 +88,18 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
86
88
  marginBottom: 10,
87
89
  backgroundColor: theme.colors.lightGray
88
90
  },
91
+ btnBackArrow: {
92
+ borderWidth: 0,
93
+ width: 32,
94
+ height: 32,
95
+ tintColor: theme.colors.textGray,
96
+ backgroundColor: theme.colors.clear,
97
+ borderColor: theme.colors.clear,
98
+ shadowColor: theme.colors.clear,
99
+ paddingLeft: 0,
100
+ paddingRight: 0,
101
+ marginBottom: 20
102
+ },
89
103
  inputTextArea: {
90
104
  borderColor: theme.colors.lightGray,
91
105
  borderRadius: 8,
@@ -147,7 +161,7 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
147
161
  useEffect(() => {
148
162
  if (scrollref?.current) {
149
163
  Keyboard.addListener('keyboardDidShow', () => {
150
- scrollref.current.scrollToEnd()
164
+ scrollref?.current?.scrollToEnd && scrollref.current.scrollToEnd()
151
165
  })
152
166
  }
153
167
  }, [scrollref?.current])
@@ -177,18 +191,9 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
177
191
  }}
178
192
  >
179
193
  <View>
180
- <OIconButton
181
- icon={theme.images.general.arrow_left}
182
- borderColor={theme.colors.clear}
183
- iconStyle={{ width: 20, height: 16 }}
184
- style={{
185
- maxWidth: 40,
186
- height: 20,
187
- justifyContent: 'flex-end',
188
- marginBottom: 20,
189
- }}
190
- onClick={() => closeModal()}
191
- />
194
+ <TouchableOpacity onPress={() => closeModal()} style={styles.btnBackArrow}>
195
+ <OIcon src={theme.images.general.arrow_left} color={theme.colors.textGray} />
196
+ </TouchableOpacity>
192
197
  <OText
193
198
  size={20}
194
199
  weight="600"
@@ -1,6 +1,5 @@
1
1
  import React, { useEffect, useState } from 'react';
2
- import { View, StyleSheet, Dimensions, Linking } from 'react-native';
3
- import { ScrollView, TouchableOpacity } from 'react-native-gesture-handler';
2
+ import { View, StyleSheet, Dimensions, Linking, ScrollView, TouchableOpacity } from 'react-native';
4
3
  import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder';
5
4
  import NetInfo from '@react-native-community/netinfo';
6
5
  import { useTheme } from 'styled-components/native';
@@ -149,10 +148,10 @@ const StoresListUI = (props: BusinessesListingParams) => {
149
148
  width={12}
150
149
  height={12}
151
150
  color={theme.colors.skyBlue}
152
- style={{ marginRight: 5, marginTop: 3 }}
151
+ style={{ marginRight: 5 }}
153
152
  />
154
153
  <OText size={12}>
155
- {t('MORE_SETTINGS_GO_TO', 'For more settings go to')}{' '}
154
+ {t('MORE_SETTINGS_GO_TO', 'For more settings go to ')}
156
155
  </OText>
157
156
  <TouchableOpacity onPress={() => { Linking.openURL(t('LINK_MORE_SETTINGS_GO_TO', 'https://app.ordering.co')) }}>
158
157
  <OText size={12} color={theme.colors.skyBlue}>
@@ -49,7 +49,8 @@ const ProfileUI = (props: ProfileParams) => {
49
49
  handleToggleAvalaibleStatusDriver,
50
50
  userState,
51
51
  isAvailableLoading,
52
- isAlsea
52
+ isAlsea,
53
+ isHideDriverStatus
53
54
  } = props;
54
55
 
55
56
  const [{ user }] = useSession();
@@ -345,7 +346,7 @@ const ProfileUI = (props: ProfileParams) => {
345
346
  />
346
347
  </CenterView>
347
348
 
348
- {user?.level === 4 && (
349
+ {user?.level === 4 && !isHideDriverStatus && (
349
350
  <EnabledStatusDriver>
350
351
  <View style={{ flex: 1 }}>
351
352
  <OText
@@ -478,19 +479,17 @@ const ProfileUI = (props: ProfileParams) => {
478
479
  />
479
480
  </EditButton>
480
481
  )}
481
- {!!user?.schedule && (
482
- <Pressable style={{ marginBottom: 10 }} onPress={() => setOpenModal(true)}>
483
- <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
484
- <OText size={16}>{t('SCHEDULE', 'Schedule')}</OText>
485
- <AntDesignIcon size={18} name='right' />
486
- </View>
487
- <View style={{
488
- borderBottomColor: theme.colors.tabBar,
489
- borderBottomWidth: 1,
490
- marginTop: 10
491
- }} />
492
- </Pressable>
493
- )}
482
+ <Pressable style={{ marginBottom: 10 }} onPress={() => setOpenModal(true)}>
483
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
484
+ <OText size={16}>{t('SCHEDULE', 'Schedule')}</OText>
485
+ <AntDesignIcon size={18} name='right' />
486
+ </View>
487
+ <View style={{
488
+ borderBottomColor: theme.colors.tabBar,
489
+ borderBottomWidth: 1,
490
+ marginTop: 10
491
+ }} />
492
+ </Pressable>
494
493
  <Actions>
495
494
  <LanguageSelector />
496
495
 
@@ -0,0 +1,171 @@
1
+ import React, { useState } from 'react'
2
+ import { useLanguage, useUtils, WebsocketStatus as WebsocketStatusController } from 'ordering-components/native'
3
+ import { TouchableOpacity, View, StyleSheet } from 'react-native'
4
+ import MaterialIcon from 'react-native-vector-icons/MaterialCommunityIcons';
5
+ import { useTheme } from 'styled-components/native'
6
+ import RNRestart from 'react-native-restart'
7
+ import { OModal, OButton, OText, OIcon } from '../shared'
8
+
9
+ import {
10
+ Container,
11
+ ModalContainer,
12
+ ModalTitle,
13
+ StatusItemWrapper,
14
+ StatusText
15
+ } from './styles'
16
+
17
+ const SocketStatusUI = (props: any) => {
18
+ const {
19
+ socketStatus,
20
+ connectedDate
21
+ } = props
22
+
23
+ const theme = useTheme()
24
+ const [, t] = useLanguage()
25
+ const [{ parseDate }] = useUtils()
26
+ const [openModal, setOpenModal] = useState(false)
27
+
28
+ const styles = StyleSheet.create({
29
+ btnBackArrow: {
30
+ borderWidth: 0,
31
+ width: 32,
32
+ height: 32,
33
+ tintColor: theme.colors.textGray,
34
+ backgroundColor: theme.colors.clear,
35
+ borderColor: theme.colors.clear,
36
+ shadowColor: theme.colors.clear,
37
+ paddingLeft: 0,
38
+ paddingRight: 0,
39
+ marginBottom: 30,
40
+ marginTop: 30
41
+ },
42
+ })
43
+
44
+ const getStatusColor = (status: number) => {
45
+ switch (status) {
46
+ case 0:
47
+ return '#FF9922';
48
+ case 1:
49
+ return '#00D27A';
50
+ case 2:
51
+ return '#E63757';
52
+ default:
53
+ return '#FF9922';
54
+ }
55
+ }
56
+
57
+ return (
58
+ <Container>
59
+ <TouchableOpacity
60
+ style={{
61
+ flexDirection: 'row',
62
+ alignItems: 'center',
63
+ justifyContent: 'center',
64
+ backgroundColor: theme.colors.inputChat,
65
+ borderRadius: 7.6,
66
+ marginVertical: 10,
67
+ paddingVertical: 10,
68
+ paddingHorizontal: 15,
69
+ }}
70
+ activeOpacity={0.6}
71
+ onPress={() => setOpenModal(true)}
72
+ >
73
+ <OText
74
+ style={{ color: theme.colors.backArrow, fontSize: 16, marginBottom: 0, lineHeight: 16 }}
75
+ >
76
+ {t('CONNECTION_STATUS', 'Connection status')}
77
+ </OText>
78
+ <MaterialIcon
79
+ name='circle'
80
+ size={12}
81
+ color={getStatusColor(socketStatus)}
82
+ style={{ marginLeft: 8 }}
83
+ />
84
+ </TouchableOpacity>
85
+
86
+ <OModal
87
+ open={openModal}
88
+ onClose={() => setOpenModal(false)}
89
+ entireModal
90
+ customClose
91
+ >
92
+ <ModalContainer nestedScrollEnabled={true}>
93
+ <TouchableOpacity
94
+ onPress={() => setOpenModal(false)}
95
+ style={styles.btnBackArrow}
96
+ >
97
+ <OIcon src={theme.images.general.arrow_left} color={theme.colors.textGray} />
98
+ </TouchableOpacity>
99
+ <View>
100
+ <ModalTitle>{t('CONNECTION_STATUS', 'Connection status')}</ModalTitle>
101
+ <OText style={{ marginBottom: 20 }}>
102
+ {t('LAST_UPDATE', 'Last update')}: {parseDate(connectedDate)}
103
+ </OText>
104
+ <StatusItemWrapper>
105
+ <MaterialIcon
106
+ name='circle'
107
+ size={12}
108
+ color={getStatusColor(1)}
109
+ style={{ marginTop: 10, marginHorizontal: 8 }}
110
+ />
111
+ <View style={{ marginLeft: 16 }}>
112
+ <StatusText>{t('OK', 'Ok')}</StatusText>
113
+ <OText style={{ color: theme.colors.backArrow, fontSize: 14 }}>{t('WEBSOCKET_OK', 'The websocket works normally.')}</OText>
114
+ </View>
115
+ </StatusItemWrapper>
116
+ <StatusItemWrapper>
117
+ <MaterialIcon
118
+ name='circle'
119
+ size={12}
120
+ color={getStatusColor(0)}
121
+ style={{ marginTop: 10, marginHorizontal: 8 }}
122
+ />
123
+ <View style={{ marginLeft: 16 }}>
124
+ <StatusText>{t('CONNECTING', 'Connecting')}</StatusText>
125
+ <OText style={{ color: theme.colors.backArrow, fontSize: 14 }}>{t('WEBSOCKET_CONNECTING', 'The websocket is connecting.')}</OText>
126
+ </View>
127
+ </StatusItemWrapper>
128
+ <StatusItemWrapper>
129
+ <MaterialIcon
130
+ name='circle'
131
+ size={12}
132
+ color={getStatusColor(2)}
133
+ style={{ marginTop: 10, marginHorizontal: 8 }}
134
+ />
135
+ <View style={{ marginLeft: 16 }}>
136
+ <StatusText>{t('DISCONNECTED', 'Disconnected')}</StatusText>
137
+ <OText style={{ color: theme.colors.backArrow, fontSize: 14 }}>{t('WEBSOCKET_DISCONNECTED', 'The server is slow, please reload.')}</OText>
138
+ </View>
139
+ </StatusItemWrapper>
140
+
141
+ <View style={{ flexDirection: 'row', marginTop: 50 }}>
142
+ <OButton
143
+ onClick={() => setOpenModal(false)}
144
+ bgColor={theme.colors.white}
145
+ borderColor={theme.colors.primary}
146
+ textStyle={{ color: theme.colors.primary }}
147
+ style={{ borderRadius: 8, height: 48 }}
148
+ text={t('CLOSE', 'Close')}
149
+ />
150
+ <OButton
151
+ onClick={() => RNRestart.Restart()}
152
+ borderColor={theme.colors.primary}
153
+ textStyle={{ color: theme.colors.white }}
154
+ style={{ borderRadius: 8, marginLeft: 16, height: 48 }}
155
+ text={t('UPDATE', 'Update')}
156
+ />
157
+ </View>
158
+ </View>
159
+ </ModalContainer>
160
+ </OModal>
161
+ </Container>
162
+ )
163
+ }
164
+
165
+ export const WebsocketStatus = (props: any) => {
166
+ const socketProps = {
167
+ ...props,
168
+ UIComponent: SocketStatusUI
169
+ }
170
+ return <WebsocketStatusController {...socketProps} />
171
+ }
@@ -0,0 +1,28 @@
1
+ import styled from 'styled-components/native'
2
+
3
+ export const Container = styled.View`
4
+ display: flex;
5
+ flex-direction: column;
6
+ `
7
+ export const ModalContainer = styled.ScrollView`
8
+ padding: 0px 30px;
9
+ `
10
+ export const ModalTitle = styled.Text`
11
+ font-family: Poppins;
12
+ font-style: normal;
13
+ font-weight: bold;
14
+ font-size: 20px;
15
+ color: ${(props: any) => props.theme.colors.textGray};
16
+ margin-bottom: 10px;
17
+ `
18
+ export const StatusItemWrapper = styled.View`
19
+ flex-direction: row;
20
+ margin-bottom: 16px;
21
+ `
22
+ export const StatusText = styled.Text`
23
+ font-family: Poppins;
24
+ font-style: normal;
25
+ font-weight: 500;
26
+ font-size: 18px;
27
+ color: ${(props: any) => props.theme.colors.textGray};
28
+ `
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { Modal, StyleSheet, SafeAreaView, View } from 'react-native';
2
+ import { Modal, StyleSheet, SafeAreaView, View, TouchableOpacity } from 'react-native';
3
3
  import Icon from 'react-native-vector-icons/Feather';
4
4
  import OIcon from './OIcon';
5
5
  import OText from './OText';
@@ -158,6 +158,18 @@ const OModal = (props: Props): React.ReactElement => {
158
158
  fontWeight: '600',
159
159
  textAlign: 'center',
160
160
  },
161
+ btnBackArrow: {
162
+ borderWidth: 0,
163
+ width: 32,
164
+ height: 32,
165
+ tintColor: theme.colors.textGray,
166
+ backgroundColor: theme.colors.clear,
167
+ borderColor: theme.colors.clear,
168
+ shadowColor: theme.colors.clear,
169
+ paddingLeft: 0,
170
+ paddingRight: 0,
171
+ marginTop: 10
172
+ },
161
173
  });
162
174
 
163
175
  return (
@@ -205,14 +217,9 @@ const OModal = (props: Props): React.ReactElement => {
205
217
  {!customClose && (
206
218
  <View style={styles.titleSection}>
207
219
  <View style={styles.titleGroups}>
208
- <OIconButton
209
- icon={theme.images.general.arrow_left}
210
- iconStyle={{ width: 20, height: 20 }}
211
- borderColor={theme.colors.clear}
212
- style={styleCloseButton || styles.cancelBtn}
213
- onClick={onClose}
214
- />
215
-
220
+ <TouchableOpacity onPress={() => onClose()} style={styles.btnBackArrow}>
221
+ <OIcon src={theme.images.general.arrow_left} color={theme.colors.textGray} />
222
+ </TouchableOpacity>
216
223
  <OText
217
224
  size={16}
218
225
  style={styles.modalText}
@@ -25,18 +25,18 @@ export interface LoginParams {
25
25
  enableReCaptcha?: any;
26
26
 
27
27
  otpType?: string,
28
- setOtpType: (type : string) => void,
29
- generateOtpCode: (values ?: any) => void,
30
- useLoginOtpEmail?: boolean,
31
- useLoginOtpCellphone?: boolean,
32
- useLoginOtp?: boolean
28
+ setOtpType: (type: string) => void,
29
+ generateOtpCode: (values?: any) => void,
30
+ useLoginOtpEmail?: boolean,
31
+ useLoginOtpCellphone?: boolean,
32
+ useLoginOtp?: boolean
33
33
  }
34
34
  export interface otpParams {
35
- willVerifyOtpState: boolean,
36
- setWillVerifyOtpState: (val : boolean) => void,
37
- onSubmit: () => void,
38
- handleLoginOtp: (code : string) => void,
39
- setAlertState: any,
35
+ willVerifyOtpState: boolean,
36
+ setWillVerifyOtpState: (val: boolean) => void,
37
+ onSubmit: () => void,
38
+ handleLoginOtp: (code: string) => void,
39
+ setAlertState: any,
40
40
  formState?: any
41
41
  }
42
42
  export interface ProfileParams {
@@ -57,6 +57,7 @@ export interface ProfileParams {
57
57
  showField?: any;
58
58
  isRequiredField?: any;
59
59
  isAlsea?: boolean;
60
+ isHideDriverStatus?: boolean;
60
61
  }
61
62
 
62
63
  export interface AddressListParams {
@@ -365,6 +366,12 @@ export interface PreviousMessagesParams {
365
366
  loadMessages?: (id: any) => {};
366
367
  handleReorder?: (order: any) => {};
367
368
  onNavigationRedirect?: (route: string, params?: any) => {};
369
+ getOrders?: any;
370
+ loading?: boolean;
371
+ reload?: boolean;
372
+ tabs?: any;
373
+ loadMore: any
374
+ error?: boolean
368
375
  }
369
376
  export interface OrderDetailsParams {
370
377
  handleUpdateLocationDriver?: () => {};
@@ -612,3 +619,10 @@ export interface ReviewCustomerParams {
612
619
  export interface NoNetworkParams {
613
620
  image?: any;
614
621
  }
622
+
623
+ export interface OrderDetailsLogisticParams {
624
+ navigation: any,
625
+ handleClickLogisticOrder: any,
626
+ orderAssingId: number,
627
+ order: any
628
+ }
@@ -346,7 +346,7 @@ export const getOrderStatus = (s: string, t: any) => {
346
346
  return objectStatus && objectStatus;
347
347
  };
348
348
 
349
- export const transformDistance = (value : number, distanceUnit?: string) => {
349
+ export const transformDistance = (value: number, distanceUnit?: string) => {
350
350
  return distanceUnit === 'mi'
351
351
  ? (value / 1.609).toFixed(2)
352
352
  : distanceUnit === 'ft'
@@ -354,7 +354,7 @@ export const transformDistance = (value : number, distanceUnit?: string) => {
354
354
  : (value).toFixed(2)
355
355
  }
356
356
 
357
- export const formatSeconds = (seconds : number) => {
357
+ export const formatSeconds = (seconds: number) => {
358
358
  // Hours, minutes and seconds
359
359
  const hrs = Math.floor(seconds / 3600)
360
360
  const mins = Math.floor((seconds % 3600) / 60)
@@ -369,3 +369,30 @@ export const formatSeconds = (seconds : number) => {
369
369
  ret += '' + secs
370
370
  return ret
371
371
  }
372
+
373
+ export const calculateDistance = (
374
+ pointA: { lat: number; lng: number },
375
+ pointB: { latitude: number; longitude: number },
376
+ ) => {
377
+ const lat1 = pointA.lat;
378
+ const lon1 = pointA.lng;
379
+
380
+ const lat2 = pointB?.latitude;
381
+ const lon2 = pointB?.longitude;
382
+
383
+ const R = 6371e3;
384
+ const φ1 = lat1 * (Math.PI / 180);
385
+ const φ2 = lat2 * (Math.PI / 180);
386
+ const Δφ = (lat2 - lat1) * (Math.PI / 180);
387
+ const Δλ = (lon2 - lon1) * (Math.PI / 180);
388
+
389
+ const a =
390
+ Math.sin(Δφ / 2) * Math.sin(Δφ / 2) +
391
+ Math.cos(φ1) * Math.cos(φ2) * (Math.sin(Δλ / 2) * Math.sin(Δλ / 2));
392
+
393
+ const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
394
+
395
+ const distance = R * c;
396
+ const distanceInKm = distance / 1000;
397
+ return distanceInKm;
398
+ };
@@ -197,7 +197,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
197
197
  {isFarAway && (
198
198
  <FarAwayMessage style={styles.farAwayMsg}>
199
199
  <Ionicons name='md-warning-outline' style={styles.iconStyle} />
200
- <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'You are far from this address')}</OText>
200
+ <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'Your are far from this address')}</OText>
201
201
  </FarAwayMessage>
202
202
  )}
203
203
  {!auth && (
@@ -410,8 +410,7 @@ const LoginFormUI = (props: LoginParams) => {
410
410
  textInputProps={{
411
411
  returnKeyType: 'next',
412
412
  onSubmitEditing: () => inputRef?.current?.focus?.(),
413
- style: { borderWidth: 0, fontSize: 12 },
414
- maxLength: 10
413
+ style: { borderWidth: 0, fontSize: 12 }
415
414
  }}
416
415
  textWrapStyle={{ borderColor: theme.colors.clear, borderWidth: 0, height: 40, paddingStart: 0 }}
417
416
  />
@@ -155,7 +155,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
155
155
  {isFarAway && (
156
156
  <FarAwayMessage style={styles.farAwayMsg}>
157
157
  <Ionicons name='md-warning-outline' style={styles.iconStyle} />
158
- <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'You are far from this address')}</OText>
158
+ <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'Your are far from this address')}</OText>
159
159
  </FarAwayMessage>
160
160
  )}
161
161
  <View style={styles.wrapperOrderOptions}>
@@ -50,6 +50,12 @@ const CheckoutUI = (props: any) => {
50
50
  }
51
51
  }, [cart])
52
52
 
53
+ useEffect(() => {
54
+ if (!cartState.loading && cart && !cart?.valid && cart?.status === 2) {
55
+ navigation?.canGoBack() && navigation.goBack()
56
+ }
57
+ }, [cart])
58
+
53
59
  return (
54
60
  <>
55
61
  <PaymentOptions
@@ -1,5 +1,5 @@
1
1
  import React, { useState } from 'react';
2
- import { StyleSheet, View, RefreshControl, ScrollView, Pressable } from 'react-native';
2
+ import { StyleSheet, View, Pressable, TouchableOpacity } from 'react-native';
3
3
  import { useLanguage } from 'ordering-components/native';
4
4
  import { useTheme } from 'styled-components/native';
5
5
 
@@ -9,6 +9,7 @@ import OButton from '../../components/shared/OButton';
9
9
  import { LanguageSelector } from '../../components/LanguageSelector';
10
10
  import { LogoutPopup } from '../../components/LogoutPopup';
11
11
  import { PORTRAIT, LANDSCAPE, useDeviceOrientation } from "../../../../../src/hooks/DeviceOrientation";
12
+ import { OIcon } from '../../components/shared';
12
13
 
13
14
  const Intro = (props: any): React.ReactElement => {
14
15
  const { navigation } = props;
@@ -41,6 +42,19 @@ const Intro = (props: any): React.ReactElement => {
41
42
  // />
42
43
  // }
43
44
  // >
45
+ <>
46
+ <View style={{ position: 'absolute', top: 25, right: 20, zIndex: 1000 }}>
47
+ <TouchableOpacity
48
+ onPress={() => setShowLogoutPopup(true)}
49
+ >
50
+ <OIcon
51
+ src={theme.images.general.menulogout}
52
+ width={24}
53
+ height={24}
54
+ color={theme.colors.disabledContrast}
55
+ />
56
+ </TouchableOpacity>
57
+ </View>
44
58
  <Pressable onPress={goBusiness}>
45
59
  <View style={{ height: orientationState?.dimensions?.height }}>
46
60
  {orientationState.orientation === PORTRAIT ? (
@@ -134,6 +148,7 @@ const Intro = (props: any): React.ReactElement => {
134
148
  />
135
149
  </View>
136
150
  </Pressable>
151
+ </>
137
152
  // </ScrollView>
138
153
  );
139
154
  };
@@ -380,12 +380,14 @@ const LoginFormUI = (props: LoginParams) => {
380
380
  );
381
381
 
382
382
  const note = (
383
- <OText size={24} mBottom={18}>
384
- {t('IF_NOT_HAVE_ACCOUNT', 'If you don\'t have and account, please contact Ordering')}&nbsp;
385
- <OText size={24} mBottom={18} color={theme.colors.skyBlue}>
386
- {t('SUPPORT_DEPARTMENT', 'support department')}
383
+ useRootPoint && (
384
+ <OText size={24} mBottom={18}>
385
+ {t('IF_NOT_HAVE_ACCOUNT', 'If you don\'t have and account, please contact Ordering')}&nbsp;
386
+ <OText size={24} mBottom={18} color={theme.colors.skyBlue}>
387
+ {t('SUPPORT_DEPARTMENT', 'support department')}
388
+ </OText>
387
389
  </OText>
388
- </OText>
390
+ )
389
391
  )
390
392
 
391
393
  return (