ordering-ui-react-native 0.19.7-testing → 0.19.9-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 (220) hide show
  1. package/package.json +6 -5
  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/VerifyPhone/styles.tsx +1 -2
  6. package/src/components/shared/OToast.tsx +3 -2
  7. package/src/utils/index.tsx +2 -2
  8. package/themes/business/index.tsx +2 -0
  9. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +9 -2
  10. package/themes/business/src/components/BusinessController/index.tsx +19 -17
  11. package/themes/business/src/components/BusinessProductList/AccordionDropdown.tsx +63 -0
  12. package/themes/business/src/components/BusinessProductList/IterateCategories.tsx +108 -0
  13. package/themes/business/src/components/BusinessProductList/ProductList.tsx +196 -0
  14. package/themes/business/src/components/BusinessProductList/index.tsx +196 -0
  15. package/themes/business/src/components/BusinessProductList/styles.tsx +10 -0
  16. package/themes/business/src/components/Chat/index.tsx +41 -13
  17. package/themes/business/src/components/DriverMap/index.tsx +4 -2
  18. package/themes/business/src/components/DriverSchedule/index.tsx +5 -5
  19. package/themes/business/src/components/FloatingButton/index.tsx +34 -31
  20. package/themes/business/src/components/MapView/index.tsx +11 -7
  21. package/themes/business/src/components/MessagesOption/index.tsx +22 -94
  22. package/themes/business/src/components/NewOrderNotification/index.tsx +138 -106
  23. package/themes/business/src/components/OrderDetails/Delivery.tsx +19 -10
  24. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +88 -51
  25. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +26 -6
  26. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +6 -1
  27. package/themes/business/src/components/OrderSummary/index.tsx +27 -13
  28. package/themes/business/src/components/OrdersListManager/index.tsx +7 -2
  29. package/themes/business/src/components/OrdersListManager/utils.tsx +1 -1
  30. package/themes/business/src/components/OrdersOption/index.tsx +83 -37
  31. package/themes/business/src/components/PreviousMessages/FooterMessageComponent.tsx +103 -0
  32. package/themes/business/src/components/PreviousMessages/index.tsx +97 -55
  33. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +24 -31
  34. package/themes/business/src/components/PreviousOrders/OrderList.tsx +93 -0
  35. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +1 -1
  36. package/themes/business/src/components/PreviousOrders/index.tsx +192 -220
  37. package/themes/business/src/components/PreviousOrders/styles.tsx +10 -0
  38. package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
  39. package/themes/business/src/components/ReviewCustomer/index.tsx +2 -0
  40. package/themes/business/src/components/SearchBar/index.tsx +2 -1
  41. package/themes/business/src/components/StoresList/index.tsx +5 -3
  42. package/themes/business/src/components/UserProfileForm/index.tsx +49 -28
  43. package/themes/business/src/components/WebsocketStatus/index.tsx +171 -0
  44. package/themes/business/src/components/WebsocketStatus/styles.tsx +28 -0
  45. package/themes/business/src/types/index.tsx +10 -0
  46. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  47. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  48. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  49. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  50. package/themes/kiosk/src/components/LoginForm/index.tsx +124 -96
  51. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  52. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  53. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  54. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  55. package/themes/original/index.tsx +7 -3
  56. package/themes/original/src/components/AddressForm/index.tsx +2 -2
  57. package/themes/original/src/components/AddressForm/styles.tsx +1 -1
  58. package/themes/original/src/components/AddressList/index.tsx +4 -7
  59. package/themes/original/src/components/AddressList/styles.tsx +4 -4
  60. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  61. package/themes/original/src/components/BusinessBasicInformation/index.tsx +3 -3
  62. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -1
  63. package/themes/original/src/components/BusinessController/index.tsx +9 -6
  64. package/themes/original/src/components/BusinessController/styles.tsx +8 -7
  65. package/themes/original/src/components/BusinessInformation/index.tsx +35 -3
  66. package/themes/original/src/components/BusinessInformation/styles.tsx +2 -2
  67. package/themes/original/src/components/BusinessItemAccordion/index.tsx +11 -7
  68. package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +317 -0
  69. package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +96 -0
  70. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +1 -1
  71. package/themes/original/src/components/BusinessListingSearch/index.tsx +56 -361
  72. package/themes/original/src/components/BusinessListingSearch/styles.tsx +1 -1
  73. package/themes/original/src/components/BusinessPreorder/index.tsx +3 -4
  74. package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -1
  75. package/themes/original/src/components/BusinessProductsList/index.tsx +2 -2
  76. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  77. package/themes/original/src/components/BusinessProductsListing/index.tsx +43 -19
  78. package/themes/original/src/components/BusinessProductsListing/styles.tsx +3 -4
  79. package/themes/original/src/components/BusinessReviews/index.tsx +1 -1
  80. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  81. package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -5
  82. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +69 -0
  83. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +406 -0
  84. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListing.tsx +76 -0
  85. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +29 -402
  86. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
  87. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  88. package/themes/original/src/components/Cart/index.tsx +27 -8
  89. package/themes/original/src/components/CartContent/index.tsx +61 -39
  90. package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
  91. package/themes/original/src/components/Checkout/index.tsx +199 -55
  92. package/themes/original/src/components/Checkout/styles.tsx +17 -0
  93. package/themes/original/src/components/CitiesControl/styles.tsx +1 -1
  94. package/themes/original/src/components/DatePicker/index.tsx +17 -0
  95. package/themes/original/src/components/DatePicker/styles.tsx +20 -0
  96. package/themes/original/src/components/Favorite/index.tsx +4 -9
  97. package/themes/original/src/components/Favorite/styles.tsx +0 -2
  98. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  99. package/themes/original/src/components/GPSButton/index.tsx +1 -1
  100. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
  101. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +36 -3
  102. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +1 -1
  103. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +67 -4
  104. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +1 -1
  105. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +2 -2
  106. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +1 -1
  107. package/themes/original/src/components/GoogleMap/index.tsx +50 -5
  108. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +2 -2
  109. package/themes/original/src/components/HighestRatedBusinesses/styles.tsx +1 -1
  110. package/themes/original/src/components/Home/index.tsx +1 -1
  111. package/themes/original/src/components/LastOrder/index.tsx +2 -1
  112. package/themes/original/src/components/LastOrders/index.tsx +2 -1
  113. package/themes/original/src/components/LoginForm/Otp/index.tsx +53 -47
  114. package/themes/original/src/components/LoginForm/index.tsx +6 -1
  115. package/themes/original/src/components/Messages/index.tsx +9 -4
  116. package/themes/original/src/components/Messages/styles.tsx +1 -1
  117. package/themes/original/src/components/MomentOption/index.tsx +4 -4
  118. package/themes/original/src/components/MomentSelector/index.tsx +1 -1
  119. package/themes/original/src/components/MultiCart/index.tsx +1 -1
  120. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +13 -4
  121. package/themes/original/src/components/MultiCheckout/index.tsx +226 -52
  122. package/themes/original/src/components/MultiCheckout/styles.tsx +17 -0
  123. package/themes/original/src/components/MultiOrdersDetails/index.tsx +19 -14
  124. package/themes/original/src/components/MyOrders/index.tsx +5 -5
  125. package/themes/original/src/components/NavBar/index.tsx +3 -1
  126. package/themes/original/src/components/NetworkError/index.tsx +2 -3
  127. package/themes/original/src/components/NetworkError/styles.tsx +2 -2
  128. package/themes/original/src/components/Notifications/index.tsx +4 -8
  129. package/themes/original/src/components/Notifications/styles.tsx +0 -1
  130. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +7 -3
  131. package/themes/original/src/components/OrderDetails/index.tsx +716 -667
  132. package/themes/original/src/components/OrderDetails/styles.tsx +24 -8
  133. package/themes/original/src/components/OrderProgress/index.tsx +7 -7
  134. package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
  135. package/themes/original/src/components/OrderSummary/index.tsx +5 -3
  136. package/themes/original/src/components/OrderTypeSelector/index.tsx +5 -6
  137. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +1 -1
  138. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +1 -1
  139. package/themes/original/src/components/OrdersOption/index.tsx +4 -3
  140. package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
  141. package/themes/original/src/components/PageBanner/index.tsx +3 -0
  142. package/themes/original/src/components/PaymentOptionCard/index.tsx +4 -2
  143. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +3 -0
  144. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  145. package/themes/original/src/components/PaymentOptions/index.tsx +75 -33
  146. package/themes/original/src/components/PhoneInputNumber/index.tsx +15 -1
  147. package/themes/original/src/components/ProductForm/ActionButton.tsx +120 -0
  148. package/themes/original/src/components/ProductForm/ExtraOptions.tsx +56 -0
  149. package/themes/original/src/components/ProductForm/index.tsx +81 -167
  150. package/themes/original/src/components/ProductForm/styles.tsx +1 -1
  151. package/themes/original/src/components/ProductItemAccordion/index.tsx +5 -0
  152. package/themes/original/src/components/ProductOptionSubOption/index.tsx +120 -79
  153. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +10 -9
  154. package/themes/original/src/components/ProfessionalProfile/styles.tsx +3 -3
  155. package/themes/original/src/components/Promotions/index.tsx +4 -4
  156. package/themes/original/src/components/Promotions/styles.tsx +0 -2
  157. package/themes/original/src/components/ReviewDriver/styles.tsx +1 -1
  158. package/themes/original/src/components/ReviewOrder/styles.tsx +1 -1
  159. package/themes/original/src/components/ReviewProducts/styles.tsx +1 -1
  160. package/themes/original/src/components/ServiceForm/index.tsx +2 -2
  161. package/themes/original/src/components/ServiceForm/styles.tsx +4 -4
  162. package/themes/original/src/components/SingleOrderCard/index.tsx +4 -3
  163. package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
  164. package/themes/original/src/components/StripeCardsList/index.tsx +23 -8
  165. package/themes/original/src/components/StripeElementsForm/index.tsx +5 -3
  166. package/themes/original/src/components/StripeElementsForm/naked.tsx +12 -1
  167. package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +170 -0
  168. package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +86 -0
  169. package/themes/original/src/components/UpsellingProducts/index.tsx +15 -199
  170. package/themes/original/src/components/UpsellingProducts/styles.tsx +19 -0
  171. package/themes/original/src/components/UserFormDetails/index.tsx +53 -7
  172. package/themes/original/src/components/UserProfile/index.tsx +1 -1
  173. package/themes/original/src/components/UserProfileForm/index.tsx +30 -36
  174. package/themes/original/src/components/UserVerification/index.tsx +55 -50
  175. package/themes/original/src/components/WalletTransactions/styles.tsx +1 -0
  176. package/themes/original/src/components/Wallets/index.tsx +8 -9
  177. package/themes/original/src/components/Wallets/styles.tsx +1 -1
  178. package/themes/original/src/components/shared/HeaderTitle.tsx +1 -1
  179. package/themes/original/src/components/shared/OInput.tsx +1 -4
  180. package/themes/original/src/components/shared/OModal.tsx +12 -14
  181. package/themes/original/src/layouts/Container.tsx +5 -3
  182. package/themes/original/src/types/index.tsx +10 -2
  183. package/themes/original/src/utils/index.tsx +124 -0
  184. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
  185. package/src/navigators/BottomNavigator.tsx +0 -117
  186. package/src/navigators/CheckoutNavigator.tsx +0 -66
  187. package/src/navigators/HomeNavigator.tsx +0 -202
  188. package/src/navigators/NavigationRef.tsx +0 -7
  189. package/src/navigators/RootNavigator.tsx +0 -269
  190. package/src/pages/Account.tsx +0 -34
  191. package/src/pages/AddressForm.tsx +0 -62
  192. package/src/pages/AddressList.tsx +0 -24
  193. package/src/pages/BusinessProductsList.tsx +0 -81
  194. package/src/pages/BusinessesListing.tsx +0 -43
  195. package/src/pages/CartList.tsx +0 -49
  196. package/src/pages/Checkout.tsx +0 -101
  197. package/src/pages/ForgotPassword.tsx +0 -24
  198. package/src/pages/Help.tsx +0 -23
  199. package/src/pages/HelpAccountAndPayment.tsx +0 -23
  200. package/src/pages/HelpGuide.tsx +0 -23
  201. package/src/pages/HelpOrder.tsx +0 -23
  202. package/src/pages/Home.tsx +0 -36
  203. package/src/pages/IntroductoryTutorial.tsx +0 -170
  204. package/src/pages/Login.tsx +0 -47
  205. package/src/pages/MomentOption.tsx +0 -30
  206. package/src/pages/MultiCheckout.tsx +0 -31
  207. package/src/pages/MultiOrdersDetails.tsx +0 -27
  208. package/src/pages/MyOrders.tsx +0 -40
  209. package/src/pages/NetworkError.tsx +0 -24
  210. package/src/pages/NotFound.tsx +0 -22
  211. package/src/pages/OrderDetails.tsx +0 -25
  212. package/src/pages/ProductDetails.tsx +0 -55
  213. package/src/pages/Profile.tsx +0 -36
  214. package/src/pages/ReviewDriver.tsx +0 -30
  215. package/src/pages/ReviewOrder.tsx +0 -32
  216. package/src/pages/ReviewProducts.tsx +0 -30
  217. package/src/pages/Sessions.tsx +0 -22
  218. package/src/pages/Signup.tsx +0 -53
  219. package/src/pages/SpinnerLoader.tsx +0 -10
  220. 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`
@@ -72,7 +72,7 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
72
72
 
73
73
  const getProductPrice = (product: any) => {
74
74
  let subOptionPrice = 0;
75
- if (product?.options?.length > 0 && product?.options?.suboptions?.length > 0) {
75
+ if (product?.options?.length > 0 && product?.options[0]?.suboptions?.length > 0) {
76
76
  for (const option of product?.options) {
77
77
  for (const suboption of option?.suboptions) {
78
78
  subOptionPrice += suboption.quantity * suboption.price;
@@ -118,7 +118,7 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
118
118
 
119
119
  const onTextLayout = useCallback((e: any) => {
120
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
121
- },[]);
121
+ }, []);
122
122
 
123
123
  return (
124
124
  <AccordionSection>
@@ -1,3 +1,5 @@
1
+
2
+
1
3
  import React, { useState, useEffect, useRef } from 'react'
2
4
  import {
3
5
  useLanguage,
@@ -16,6 +16,7 @@ export const SearchBar = (props: any) => {
16
16
  isCancelXButtonShow,
17
17
  noBorderShow,
18
18
  borderStyle,
19
+ containerStyle
19
20
  } = props;
20
21
 
21
22
  const [, t] = useLanguage();
@@ -67,7 +68,7 @@ export const SearchBar = (props: any) => {
67
68
  });
68
69
 
69
70
  return (
70
- <View style={[styles.container]}>
71
+ <View style={{ ...styles.container, ...containerStyle}}>
71
72
  <OInput
72
73
  forwardRef={inputRef}
73
74
  value={searchValue}
@@ -133,7 +133,8 @@ const StoresListUI = (props: BusinessesListingParams) => {
133
133
  lazyLoad
134
134
  isCancelXButtonShow={!!searchValue}
135
135
  onCancel={() => handleChangeSearch('')}
136
- placeholder={t('FIND_BUSINESS', 'Find a business')}
136
+ placeholder={t('SEARCH', 'Search')}
137
+ containerStyle={{ width: 210 }}
137
138
  />
138
139
  </View>
139
140
  )}
@@ -148,10 +149,10 @@ const StoresListUI = (props: BusinessesListingParams) => {
148
149
  width={12}
149
150
  height={12}
150
151
  color={theme.colors.skyBlue}
151
- style={{ marginRight: 5, marginTop: 3 }}
152
+ style={{ marginRight: 5 }}
152
153
  />
153
154
  <OText size={12}>
154
- {t('MORE_SETTINGS_GO_TO', 'For more settings go to')}{' '}
155
+ {t('MORE_SETTINGS_GO_TO', 'For more settings go to ')}
155
156
  </OText>
156
157
  <TouchableOpacity onPress={() => { Linking.openURL(t('LINK_MORE_SETTINGS_GO_TO', 'https://app.ordering.co')) }}>
157
158
  <OText size={12} color={theme.colors.skyBlue}>
@@ -180,6 +181,7 @@ const StoresListUI = (props: BusinessesListingParams) => {
180
181
  isBusinessOpen={business?.open}
181
182
  setIsUpdateStore={setIsUpdateStore}
182
183
  isUpdateStore={isUpdateStore}
184
+ navigation={navigation}
183
185
  />
184
186
  ))}
185
187
 
@@ -39,7 +39,6 @@ import { NotFoundSource } from '../NotFoundSource';
39
39
  import AntDesignIcon from 'react-native-vector-icons/AntDesign'
40
40
  const ProfileUI = (props: ProfileParams) => {
41
41
  const {
42
- navigation,
43
42
  formState,
44
43
  isEdit,
45
44
  validationFields,
@@ -47,13 +46,13 @@ const ProfileUI = (props: ProfileParams) => {
47
46
  toggleIsEdit,
48
47
  cleanFormState,
49
48
  handleToggleAvalaibleStatusDriver,
50
- userState,
51
- isAvailableLoading,
52
- isAlsea
49
+ isAlsea,
50
+ isShowDriverStatus,
51
+ navigation
53
52
  } = props;
54
53
 
55
- const [{ user }] = useSession();
56
- const [state, t] = useLanguage();
54
+ const [{ user, sessionLoading }] = useSession();
55
+ const [, t] = useLanguage();
57
56
  const [, { showToast }] = useToast();
58
57
  const [{ optimizeImage }] = useUtils();
59
58
  const { errors } = useForm();
@@ -67,6 +66,7 @@ const ProfileUI = (props: ProfileParams) => {
67
66
  },
68
67
  });
69
68
  const [phoneUpdate, setPhoneUpdate] = useState(false);
69
+ const [userState, setUserState] = useState(props.userState)
70
70
  const [userPhoneNumber, setUserPhoneNumber] = useState<any>(null);
71
71
  const [phoneToShow, setPhoneToShow] = useState('');
72
72
  const [openModal, setOpenModal] = useState(false)
@@ -115,7 +115,8 @@ const ProfileUI = (props: ProfileParams) => {
115
115
  maxWidth: 200,
116
116
  includeBase64: true,
117
117
  },
118
- (response: any) => {
118
+ (image: any) => {
119
+ const response = image?.assets[0];
119
120
  if (response.didCancel) {
120
121
  console.log('User cancelled image picker');
121
122
  } else if (response.errorMessage) {
@@ -206,6 +207,22 @@ const ProfileUI = (props: ProfileParams) => {
206
207
  }
207
208
  }, [user?.country_phone_code]);
208
209
 
210
+ useEffect(() => {
211
+ setUserState({ ...userState, ...props.userState })
212
+ }, [props.userState])
213
+
214
+ useEffect(() => {
215
+ if (!user?.id) return
216
+
217
+ setUserState({
218
+ ...userState,
219
+ result: {
220
+ error: true,
221
+ result: user
222
+ }
223
+ })
224
+ }, [user, props.isFocused])
225
+
209
226
  const styles = StyleSheet.create({
210
227
  label: {
211
228
  color: theme.colors.textGray,
@@ -254,7 +271,7 @@ const ProfileUI = (props: ProfileParams) => {
254
271
  />
255
272
  )}
256
273
 
257
- {(formState?.loading || state?.loading) && !validationFields.error && (
274
+ {(formState?.loading || sessionLoading) && !validationFields.error && (
258
275
  <View
259
276
  style={{
260
277
  backgroundColor: theme.colors.backgroundLight,
@@ -325,7 +342,7 @@ const ProfileUI = (props: ProfileParams) => {
325
342
  </View>
326
343
  )}
327
344
 
328
- {!formState?.loading && !state?.loading && !validationFields.error && (
345
+ {!(formState?.loading || sessionLoading) && !validationFields.error && (
329
346
  <ScrollView showsVerticalScrollIndicator={false} style={{ flex: 1 }}>
330
347
  <CenterView>
331
348
  <OIcon
@@ -353,29 +370,33 @@ const ProfileUI = (props: ProfileParams) => {
353
370
  adjustsFontSizeToFit
354
371
  style={{ ...styles.label, paddingHorizontal: 0 }}>
355
372
  {t(
356
- 'AVAILABLE_TO_RECEIVE_ORDERS',
357
- 'Available to receive orders',
373
+ `${!isShowDriverStatus ? 'NOT_' : ''}AVAILABLE_TO_RECEIVE_ORDERS`,
374
+ `${!isShowDriverStatus ? 'You are not ' : ''}Available to receive orders`
358
375
  )}
359
376
  </OText>
360
377
  </View>
361
378
 
362
- {userState.loadingDriver ? (
363
- <ActivityIndicator size="small" color={theme.colors.primary} />
364
- ) : (
365
- <ToggleSwitch
366
- isOn={userState?.result?.result?.available}
367
- onColor={theme.colors.primary}
368
- offColor={theme.colors.offColor}
369
- size="small"
370
- onToggle={() =>
371
- handleToggleAvalaibleStatusDriver &&
372
- handleToggleAvalaibleStatusDriver(
373
- !userState?.result?.result?.available,
374
- )
375
- }
376
- disabled={userState?.loading}
377
- animationSpeed={200}
378
- />
379
+ {isShowDriverStatus && (
380
+ <>
381
+ {userState.loadingDriver ? (
382
+ <ActivityIndicator size="small" color={theme.colors.primary} />
383
+ ) : (
384
+ <ToggleSwitch
385
+ isOn={userState?.result?.result?.available}
386
+ onColor={theme.colors.primary}
387
+ offColor={theme.colors.offColor}
388
+ size="small"
389
+ onToggle={() =>
390
+ handleToggleAvalaibleStatusDriver &&
391
+ handleToggleAvalaibleStatusDriver(
392
+ !userState?.result?.result?.available,
393
+ )
394
+ }
395
+ disabled={userState?.loading}
396
+ animationSpeed={200}
397
+ />
398
+ )}
399
+ </>
379
400
  )}
380
401
  </EnabledStatusDriver>
381
402
  )}
@@ -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_SHORT', '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
+ `
@@ -57,6 +57,8 @@ export interface ProfileParams {
57
57
  showField?: any;
58
58
  isRequiredField?: any;
59
59
  isAlsea?: boolean;
60
+ isShowDriverStatus?: boolean;
61
+ isFocused?: boolean;
60
62
  }
61
63
 
62
64
  export interface AddressListParams {
@@ -172,6 +174,7 @@ export interface BusinessControllerParams {
172
174
  isBusinessOpen?: boolean;
173
175
  businessWillCloseSoonMinutes?: number;
174
176
  updateBusiness?: (id: any, value: any) => {};
177
+ navigation?: any;
175
178
  }
176
179
  export interface BusinessProductsListingParams {
177
180
  navigation?: any;
@@ -365,6 +368,12 @@ export interface PreviousMessagesParams {
365
368
  loadMessages?: (id: any) => {};
366
369
  handleReorder?: (order: any) => {};
367
370
  onNavigationRedirect?: (route: string, params?: any) => {};
371
+ getOrders?: any;
372
+ loading?: boolean;
373
+ reload?: boolean;
374
+ tabs?: any;
375
+ loadMore: any
376
+ error?: boolean
368
377
  }
369
378
  export interface OrderDetailsParams {
370
379
  handleUpdateLocationDriver?: () => {};
@@ -485,6 +494,7 @@ export interface FloatingButtonParams {
485
494
  firstColorCustom?: string;
486
495
  secondColorCustom?: string;
487
496
  paddingBottomIos?: any;
497
+ isHideRejectButtons?: boolean
488
498
  }
489
499
  export interface MomentOptionParams {
490
500
  navigation: any;
@@ -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