ordering-ui-react-native 0.18.55 → 0.18.56-crash-driver-1

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 (266) hide show
  1. package/package.json +6 -4
  2. package/src/components/BusinessInformation/index.tsx +10 -9
  3. package/src/components/PaymentOptionsWebView/index.tsx +30 -8
  4. package/src/components/PhoneInputNumber/index.tsx +6 -2
  5. package/src/components/StripeMethodForm/index.tsx +60 -55
  6. package/src/components/shared/OToast.tsx +3 -2
  7. package/src/types/index.tsx +3 -1
  8. package/src/utils/index.tsx +2 -2
  9. package/themes/business/index.tsx +6 -0
  10. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +15 -8
  11. package/themes/business/src/components/BusinessController/index.tsx +19 -17
  12. package/themes/business/src/components/BusinessProductList/AccordionDropdown.tsx +63 -0
  13. package/themes/business/src/components/BusinessProductList/IterateCategories.tsx +108 -0
  14. package/themes/business/src/components/BusinessProductList/ProductList.tsx +196 -0
  15. package/themes/business/src/components/BusinessProductList/index.tsx +196 -0
  16. package/themes/business/src/components/BusinessProductList/styles.tsx +10 -0
  17. package/themes/business/src/components/Chat/index.tsx +48 -19
  18. package/themes/business/src/components/DriverMap/index.tsx +36 -23
  19. package/themes/business/src/components/DriverSchedule/index.tsx +45 -8
  20. package/themes/business/src/components/FloatingButton/index.tsx +34 -31
  21. package/themes/business/src/components/GoogleMap/index.tsx +15 -8
  22. package/themes/business/src/components/Home/index.tsx +5 -1
  23. package/themes/business/src/components/LanguageSelector/index.tsx +1 -2
  24. package/themes/business/src/components/LanguageSelector/lang_country.json +515 -70
  25. package/themes/business/src/components/LoginForm/index.tsx +2 -2
  26. package/themes/business/src/components/LogoutButton/index.tsx +1 -1
  27. package/themes/business/src/components/MapView/index.tsx +28 -17
  28. package/themes/business/src/components/MessagesOption/index.tsx +22 -94
  29. package/themes/business/src/components/NewOrderNotification/index.tsx +162 -106
  30. package/themes/business/src/components/NotFoundSource/index.tsx +2 -2
  31. package/themes/business/src/components/OrderDetails/Business.tsx +53 -3
  32. package/themes/business/src/components/OrderDetails/Delivery.tsx +209 -13
  33. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +107 -75
  34. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +79 -41
  35. package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +220 -0
  36. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +7 -2
  37. package/themes/business/src/components/OrderMessage/index.tsx +1 -1
  38. package/themes/business/src/components/OrderSummary/index.tsx +245 -82
  39. package/themes/business/src/components/OrdersListManager/index.tsx +7 -2
  40. package/themes/business/src/components/OrdersListManager/utils.tsx +1 -1
  41. package/themes/business/src/components/OrdersOption/index.tsx +125 -48
  42. package/themes/business/src/components/PhoneInputNumber/index.tsx +8 -5
  43. package/themes/business/src/components/PreviousMessages/FooterMessageComponent.tsx +103 -0
  44. package/themes/business/src/components/PreviousMessages/index.tsx +97 -55
  45. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +43 -41
  46. package/themes/business/src/components/PreviousOrders/OrderList.tsx +93 -0
  47. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +1 -1
  48. package/themes/business/src/components/PreviousOrders/index.tsx +195 -221
  49. package/themes/business/src/components/PreviousOrders/styles.tsx +10 -0
  50. package/themes/business/src/components/PrinterEdition/index.tsx +363 -0
  51. package/themes/business/src/components/PrinterEdition/styles.tsx +61 -0
  52. package/themes/business/src/components/PrinterSettings/index.tsx +267 -0
  53. package/themes/business/src/components/PrinterSettings/styles.tsx +30 -0
  54. package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
  55. package/themes/business/src/components/ReviewCustomer/index.tsx +1 -1
  56. package/themes/business/src/components/SearchBar/index.tsx +2 -1
  57. package/themes/business/src/components/Sessions/index.tsx +187 -0
  58. package/themes/business/src/components/Sessions/styles.tsx +20 -0
  59. package/themes/business/src/components/StoresList/index.tsx +4 -3
  60. package/themes/business/src/components/UserFormDetails/index.tsx +111 -107
  61. package/themes/business/src/components/UserProfileForm/index.tsx +103 -53
  62. package/themes/business/src/components/WebsocketStatus/index.tsx +171 -0
  63. package/themes/business/src/components/WebsocketStatus/styles.tsx +28 -0
  64. package/themes/business/src/components/shared/OInput.tsx +2 -0
  65. package/themes/business/src/hooks/useLocation.tsx +5 -4
  66. package/themes/business/src/types/index.tsx +21 -1
  67. package/themes/business/src/utils/index.tsx +5 -0
  68. package/themes/kiosk/src/components/Checkout/index.tsx +5 -3
  69. package/themes/kiosk/src/components/CustomerName/index.tsx +1 -1
  70. package/themes/kiosk/src/components/Intro/index.tsx +16 -1
  71. package/themes/kiosk/src/components/LoginForm/index.tsx +131 -101
  72. package/themes/kiosk/src/components/PaymentOptions/index.tsx +57 -121
  73. package/themes/original/index.tsx +11 -3
  74. package/themes/original/src/components/AddressDetails/index.tsx +20 -10
  75. package/themes/original/src/components/AddressForm/index.tsx +41 -20
  76. package/themes/original/src/components/AddressForm/styles.tsx +1 -1
  77. package/themes/original/src/components/AddressList/index.tsx +22 -11
  78. package/themes/original/src/components/AddressList/styles.tsx +4 -4
  79. package/themes/original/src/components/AnalyticsSegment/index.tsx +10 -7
  80. package/themes/original/src/components/AppleLogin/styles.tsx +3 -1
  81. package/themes/original/src/components/BusinessBasicInformation/index.tsx +8 -11
  82. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -1
  83. package/themes/original/src/components/BusinessController/index.tsx +40 -43
  84. package/themes/original/src/components/BusinessController/styles.tsx +12 -12
  85. package/themes/original/src/components/BusinessInformation/index.tsx +45 -17
  86. package/themes/original/src/components/BusinessInformation/styles.tsx +2 -2
  87. package/themes/original/src/components/BusinessItemAccordion/index.tsx +11 -7
  88. package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +317 -0
  89. package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +96 -0
  90. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +1 -1
  91. package/themes/original/src/components/BusinessListingSearch/index.tsx +57 -361
  92. package/themes/original/src/components/BusinessListingSearch/styles.tsx +1 -1
  93. package/themes/original/src/components/BusinessPreorder/index.tsx +9 -7
  94. package/themes/original/src/components/BusinessProductsCategories/index.tsx +2 -3
  95. package/themes/original/src/components/BusinessProductsList/index.tsx +5 -4
  96. package/themes/original/src/components/BusinessProductsListing/index.tsx +67 -28
  97. package/themes/original/src/components/BusinessProductsListing/styles.tsx +3 -4
  98. package/themes/original/src/components/BusinessReviews/index.tsx +1 -1
  99. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  100. package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -5
  101. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +69 -0
  102. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +406 -0
  103. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListing.tsx +76 -0
  104. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +30 -404
  105. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +2 -2
  106. package/themes/original/src/components/Cart/index.tsx +51 -40
  107. package/themes/original/src/components/CartContent/index.tsx +98 -54
  108. package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
  109. package/themes/original/src/components/Checkout/index.tsx +308 -75
  110. package/themes/original/src/components/Checkout/styles.tsx +17 -0
  111. package/themes/original/src/components/CitiesControl/styles.tsx +1 -1
  112. package/themes/original/src/components/DatePicker/index.tsx +33 -0
  113. package/themes/original/src/components/DatePicker/styles.tsx +20 -0
  114. package/themes/original/src/components/DriverTips/index.tsx +6 -3
  115. package/themes/original/src/components/FacebookLogin/styles.tsx +3 -1
  116. package/themes/original/src/components/Favorite/index.tsx +8 -4
  117. package/themes/original/src/components/Favorite/styles.tsx +0 -2
  118. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  119. package/themes/original/src/components/ForgotPasswordForm/index.tsx +5 -0
  120. package/themes/original/src/components/GPSButton/index.tsx +7 -5
  121. package/themes/original/src/components/GiftCard/GiftCardOrdersList/index.tsx +64 -0
  122. package/themes/original/src/components/GiftCard/GiftCardOrdersList/styles.tsx +8 -0
  123. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
  124. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +36 -3
  125. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +1 -1
  126. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +84 -8
  127. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +1 -1
  128. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +2 -2
  129. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +1 -1
  130. package/themes/original/src/components/GiftCard/SingleGiftCard/index.tsx +101 -0
  131. package/themes/original/src/components/GiftCard/SingleGiftCard/styles.tsx +4 -0
  132. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +83 -0
  133. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/styles.tsx +9 -0
  134. package/themes/original/src/components/GoogleLogin/styles.tsx +1 -1
  135. package/themes/original/src/components/GoogleMap/index.tsx +52 -5
  136. package/themes/original/src/components/Help/index.tsx +7 -0
  137. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +5 -0
  138. package/themes/original/src/components/HelpGuide/index.tsx +5 -0
  139. package/themes/original/src/components/HelpOrder/index.tsx +5 -0
  140. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +1 -1
  141. package/themes/original/src/components/HighestRatedBusinesses/styles.tsx +1 -1
  142. package/themes/original/src/components/Home/index.tsx +3 -2
  143. package/themes/original/src/components/LastOrder/index.tsx +2 -1
  144. package/themes/original/src/components/LastOrders/index.tsx +2 -1
  145. package/themes/original/src/components/LoginForm/Otp/index.tsx +79 -25
  146. package/themes/original/src/components/LoginForm/index.tsx +38 -14
  147. package/themes/original/src/components/MessageListing/index.tsx +6 -0
  148. package/themes/original/src/components/Messages/index.tsx +9 -3
  149. package/themes/original/src/components/Messages/styles.tsx +1 -1
  150. package/themes/original/src/components/MomentOption/index.tsx +20 -5
  151. package/themes/original/src/components/MomentSelector/index.tsx +1 -1
  152. package/themes/original/src/components/MultiCart/index.tsx +1 -1
  153. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +48 -15
  154. package/themes/original/src/components/MultiCheckout/index.tsx +295 -56
  155. package/themes/original/src/components/MultiCheckout/styles.tsx +20 -1
  156. package/themes/original/src/components/MultiOrdersDetails/index.tsx +21 -16
  157. package/themes/original/src/components/MyOrders/index.tsx +37 -39
  158. package/themes/original/src/components/NavBar/index.tsx +15 -14
  159. package/themes/original/src/components/NetworkError/index.tsx +2 -3
  160. package/themes/original/src/components/NetworkError/styles.tsx +2 -2
  161. package/themes/original/src/components/Notifications/index.tsx +9 -8
  162. package/themes/original/src/components/Notifications/styles.tsx +0 -1
  163. package/themes/original/src/components/OrderDetails/OrderEta.tsx +21 -6
  164. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +14 -5
  165. package/themes/original/src/components/OrderDetails/index.tsx +718 -667
  166. package/themes/original/src/components/OrderDetails/styles.tsx +24 -7
  167. package/themes/original/src/components/OrderProgress/index.tsx +50 -14
  168. package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
  169. package/themes/original/src/components/OrderSummary/index.tsx +26 -34
  170. package/themes/original/src/components/OrderTypeSelector/index.tsx +5 -0
  171. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +1 -1
  172. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +1 -1
  173. package/themes/original/src/components/OrdersOption/index.tsx +14 -6
  174. package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
  175. package/themes/original/src/components/PageBanner/index.tsx +3 -0
  176. package/themes/original/src/components/PaymentOptionCard/index.tsx +182 -0
  177. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +3 -0
  178. package/themes/original/src/components/PaymentOptions/index.tsx +118 -37
  179. package/themes/original/src/components/PhoneInputNumber/index.tsx +15 -1
  180. package/themes/original/src/components/PreviousOrders/index.tsx +2 -0
  181. package/themes/original/src/components/ProductForm/ActionButton.tsx +122 -0
  182. package/themes/original/src/components/ProductForm/ExtraOptions.tsx +56 -0
  183. package/themes/original/src/components/ProductForm/index.tsx +193 -267
  184. package/themes/original/src/components/ProductForm/styles.tsx +1 -1
  185. package/themes/original/src/components/ProductItemAccordion/index.tsx +55 -42
  186. package/themes/original/src/components/ProductItemAccordion/styles.tsx +3 -4
  187. package/themes/original/src/components/ProductOptionSubOption/index.tsx +120 -79
  188. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +10 -9
  189. package/themes/original/src/components/ProfessionalProfile/styles.tsx +3 -3
  190. package/themes/original/src/components/Promotions/index.tsx +13 -11
  191. package/themes/original/src/components/Promotions/styles.tsx +0 -2
  192. package/themes/original/src/components/ReviewDriver/index.tsx +5 -0
  193. package/themes/original/src/components/ReviewDriver/styles.tsx +1 -1
  194. package/themes/original/src/components/ReviewOrder/index.tsx +5 -0
  195. package/themes/original/src/components/ReviewOrder/styles.tsx +1 -1
  196. package/themes/original/src/components/ReviewProducts/index.tsx +5 -0
  197. package/themes/original/src/components/ReviewProducts/styles.tsx +1 -1
  198. package/themes/original/src/components/ScheduleAccordion/index.tsx +3 -3
  199. package/themes/original/src/components/ServiceForm/index.tsx +2 -2
  200. package/themes/original/src/components/ServiceForm/styles.tsx +4 -4
  201. package/themes/original/src/components/Sessions/index.tsx +5 -0
  202. package/themes/original/src/components/SignupForm/index.tsx +76 -60
  203. package/themes/original/src/components/SingleOrderCard/index.tsx +6 -5
  204. package/themes/original/src/components/SingleProductCard/index.tsx +5 -4
  205. package/themes/original/src/components/SingleProductCard/styles.tsx +0 -5
  206. package/themes/original/src/components/StripeCardsList/index.tsx +26 -8
  207. package/themes/original/src/components/StripeElementsForm/index.tsx +80 -62
  208. package/themes/original/src/components/StripeElementsForm/naked.tsx +59 -1
  209. package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +170 -0
  210. package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +91 -0
  211. package/themes/original/src/components/UpsellingProducts/index.tsx +15 -199
  212. package/themes/original/src/components/UpsellingProducts/styles.tsx +19 -0
  213. package/themes/original/src/components/UserFormDetails/index.tsx +128 -79
  214. package/themes/original/src/components/UserFormDetails/styles.tsx +8 -1
  215. package/themes/original/src/components/UserProfile/index.tsx +5 -4
  216. package/themes/original/src/components/UserProfileForm/index.tsx +35 -36
  217. package/themes/original/src/components/UserVerification/index.tsx +55 -50
  218. package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
  219. package/themes/original/src/components/WalletTransactions/styles.tsx +1 -0
  220. package/themes/original/src/components/Wallets/index.tsx +35 -49
  221. package/themes/original/src/components/Wallets/styles.tsx +3 -4
  222. package/themes/original/src/components/WebsocketStatus/index.tsx +172 -0
  223. package/themes/original/src/components/WebsocketStatus/styles.tsx +28 -0
  224. package/themes/original/src/components/shared/HeaderTitle.tsx +1 -1
  225. package/themes/original/src/components/shared/OButton.tsx +5 -5
  226. package/themes/original/src/components/shared/OInput.tsx +7 -4
  227. package/themes/original/src/components/shared/OModal.tsx +12 -14
  228. package/themes/original/src/layouts/Container.tsx +5 -3
  229. package/themes/original/src/types/index.tsx +13 -2
  230. package/themes/original/src/utils/index.tsx +124 -22
  231. package/src/navigators/BottomNavigator.tsx +0 -117
  232. package/src/navigators/CheckoutNavigator.tsx +0 -66
  233. package/src/navigators/HomeNavigator.tsx +0 -202
  234. package/src/navigators/NavigationRef.tsx +0 -7
  235. package/src/navigators/RootNavigator.tsx +0 -269
  236. package/src/pages/Account.tsx +0 -34
  237. package/src/pages/AddressForm.tsx +0 -62
  238. package/src/pages/AddressList.tsx +0 -24
  239. package/src/pages/BusinessProductsList.tsx +0 -81
  240. package/src/pages/BusinessesListing.tsx +0 -43
  241. package/src/pages/CartList.tsx +0 -49
  242. package/src/pages/Checkout.tsx +0 -101
  243. package/src/pages/ForgotPassword.tsx +0 -24
  244. package/src/pages/Help.tsx +0 -23
  245. package/src/pages/HelpAccountAndPayment.tsx +0 -23
  246. package/src/pages/HelpGuide.tsx +0 -23
  247. package/src/pages/HelpOrder.tsx +0 -23
  248. package/src/pages/Home.tsx +0 -36
  249. package/src/pages/IntroductoryTutorial.tsx +0 -170
  250. package/src/pages/Login.tsx +0 -47
  251. package/src/pages/MomentOption.tsx +0 -30
  252. package/src/pages/MultiCheckout.tsx +0 -31
  253. package/src/pages/MultiOrdersDetails.tsx +0 -27
  254. package/src/pages/MyOrders.tsx +0 -40
  255. package/src/pages/NetworkError.tsx +0 -24
  256. package/src/pages/NotFound.tsx +0 -22
  257. package/src/pages/OrderDetails.tsx +0 -25
  258. package/src/pages/ProductDetails.tsx +0 -55
  259. package/src/pages/Profile.tsx +0 -36
  260. package/src/pages/ReviewDriver.tsx +0 -30
  261. package/src/pages/ReviewOrder.tsx +0 -32
  262. package/src/pages/ReviewProducts.tsx +0 -30
  263. package/src/pages/Sessions.tsx +0 -22
  264. package/src/pages/Signup.tsx +0 -53
  265. package/src/pages/SpinnerLoader.tsx +0 -10
  266. package/src/pages/Splash.tsx +0 -21
@@ -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
  };
@@ -44,15 +44,15 @@ const LoginFormUI = (props: LoginParams) => {
44
44
  useLoginByCellphone,
45
45
  useLoginByEmail,
46
46
  loginTab,
47
- otpType,
48
- setOtpType,
49
- generateOtpCode,
50
- useLoginOtpEmail,
51
- useLoginOtpCellphone,
47
+ otpType,
48
+ setOtpType,
49
+ generateOtpCode,
50
+ useLoginOtpEmail,
51
+ useLoginOtpCellphone,
52
52
  } = props;
53
53
 
54
54
  const theme = useTheme()
55
- const [{ configs }] = useConfig()
55
+ const [{ configs }, { refreshConfigs }] = useConfig()
56
56
  const [ordering, { setOrdering }] = useApi();
57
57
  const [, { showToast }] = useToast();
58
58
  const [, t] = useLanguage();
@@ -82,31 +82,32 @@ const LoginFormUI = (props: LoginParams) => {
82
82
  });
83
83
 
84
84
  const isOtpEmail = loginTab === 'otp' && otpType === 'email'
85
- const isOtpCellphone = loginTab === 'otp' && otpType === 'cellphone'
85
+ const isOtpCellphone = loginTab === 'otp' && otpType === 'cellphone'
86
+ const isDeviceLoginEnabled = configs?.device_code_login_enabled?.value === '1'
86
87
 
87
88
  const mainLogin = (values) => {
88
89
  if (loginTab === 'otp') {
89
- if (phoneInputData.error && (loginTab !== 'otp' || (otpType === 'cellphone' && loginTab === 'otp'))) {
90
- showToast(ToastType.Error, t('INVALID_PHONE_NUMBER', 'Invalid phone number'));
91
- return
92
- }
93
- if (loginTab === 'otp') {
94
- generateOtpCode({
95
- ...values,
96
- ...phoneInputData.phone
97
- })
98
- }
99
- setWillVerifyOtpState(true)
100
- } else {
101
- if (phoneInputData.error) {
102
- showToast(ToastType.Error, phoneInputData.error);
103
- return;
104
- }
105
- handleButtonLoginClick({
106
- ...values,
107
- ...phoneInputData.phone,
108
- });
109
- }
90
+ if (phoneInputData.error && (loginTab !== 'otp' || (otpType === 'cellphone' && loginTab === 'otp'))) {
91
+ showToast(ToastType.Error, t('INVALID_PHONE_NUMBER', 'Invalid phone number'));
92
+ return
93
+ }
94
+ if (loginTab === 'otp') {
95
+ generateOtpCode({
96
+ ...values,
97
+ ...phoneInputData.phone
98
+ })
99
+ }
100
+ setWillVerifyOtpState(true)
101
+ } else {
102
+ if (phoneInputData.error) {
103
+ showToast(ToastType.Error, phoneInputData.error);
104
+ return;
105
+ }
106
+ handleButtonLoginClick({
107
+ ...values,
108
+ ...phoneInputData.phone,
109
+ });
110
+ }
110
111
  }
111
112
 
112
113
  const onSubmit = (values: any) => {
@@ -199,23 +200,23 @@ const LoginFormUI = (props: LoginParams) => {
199
200
  borderColor: theme.colors.inputSignup,
200
201
  },
201
202
  borderStyleBase: {
202
- width: 30,
203
- height: 45
204
- },
205
- borderStyleHighLighted: {
206
- borderColor: "#03DAC6",
207
- },
208
- underlineStyleBase: {
209
- width: 45,
210
- height: 60,
211
- borderWidth: 1,
212
- fontSize: 16
213
- },
214
- underlineStyleHighLighted: {
215
- borderColor: theme.colors.primary,
216
- color: theme.colors.primary,
217
- fontSize: 16
218
- },
203
+ width: 30,
204
+ height: 45
205
+ },
206
+ borderStyleHighLighted: {
207
+ borderColor: "#03DAC6",
208
+ },
209
+ underlineStyleBase: {
210
+ width: 45,
211
+ height: 60,
212
+ borderWidth: 1,
213
+ fontSize: 16
214
+ },
215
+ underlineStyleHighLighted: {
216
+ borderColor: theme.colors.primary,
217
+ color: theme.colors.primary,
218
+ fontSize: 16
219
+ },
219
220
  });
220
221
 
221
222
  useEffect(() => {
@@ -311,32 +312,32 @@ const LoginFormUI = (props: LoginParams) => {
311
312
  };
312
313
 
313
314
  const handleChangeOtpType = (type: string) => {
314
- handleChangeTab('otp', type)
315
- setOtpType(type)
316
- }
317
-
318
- const handleLoginOtp = (code: string) => {
319
- handleButtonLoginClick({ code })
320
- setWillVerifyOtpState(false)
321
- }
322
-
323
- const closeAlert = () => {
324
- setAlertState({
325
- open: false,
326
- title: '',
327
- content: []
328
- })
329
- }
315
+ handleChangeTab('otp', type)
316
+ setOtpType(type)
317
+ }
318
+
319
+ const handleLoginOtp = (code: string) => {
320
+ handleButtonLoginClick({ code })
321
+ setWillVerifyOtpState(false)
322
+ }
323
+
324
+ const closeAlert = () => {
325
+ setAlertState({
326
+ open: false,
327
+ title: '',
328
+ content: []
329
+ })
330
+ }
330
331
 
331
332
  useEffect(() => {
332
- if (checkPhoneCodeState?.result?.error) {
333
- setAlertState({
334
- open: true,
335
- content: t(checkPhoneCodeState?.result?.error, checkPhoneCodeState?.result?.error),
336
- title: ''
337
- })
338
- }
339
- }, [checkPhoneCodeState])
333
+ if (checkPhoneCodeState?.result?.error) {
334
+ setAlertState({
335
+ open: true,
336
+ content: t(checkPhoneCodeState?.result?.error, checkPhoneCodeState?.result?.error),
337
+ title: ''
338
+ })
339
+ }
340
+ }, [checkPhoneCodeState])
340
341
 
341
342
  useEffect(() => {
342
343
  const projectInputTimeout = setTimeout(() => {
@@ -348,7 +349,13 @@ const LoginFormUI = (props: LoginParams) => {
348
349
  }
349
350
  }, 1500)
350
351
  return () => clearTimeout(projectInputTimeout);
351
- }, [projectName])
352
+ }, [projectName, isDeviceLoginEnabled])
353
+
354
+ useEffect(() => {
355
+ if (ordering?.project) {
356
+ refreshConfigs()
357
+ }
358
+ }, [ordering?.project])
352
359
 
353
360
  const logo = (
354
361
  <LogoWrapper>
@@ -380,12 +387,14 @@ const LoginFormUI = (props: LoginParams) => {
380
387
  );
381
388
 
382
389
  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')}
390
+ useRootPoint && (
391
+ <OText size={24} mBottom={18}>
392
+ {t('IF_NOT_HAVE_ACCOUNT', 'If you don\'t have and account, please contact Ordering')}&nbsp;
393
+ <OText size={24} mBottom={18} color={theme.colors.skyBlue}>
394
+ {t('SUPPORT_DEPARTMENT', 'support department')}
395
+ </OText>
387
396
  </OText>
388
- </OText>
397
+ )
389
398
  )
390
399
 
391
400
  return (
@@ -440,7 +449,7 @@ const LoginFormUI = (props: LoginParams) => {
440
449
  </View>
441
450
  )}
442
451
 
443
- {(Number(useLoginByEmail) + Number(useLoginOtpEmail) + Number(useLoginOtpCellphone) > 1) && (
452
+ {!isDeviceLoginEnabled && (Number(useLoginByEmail) + Number(useLoginOtpEmail) + Number(useLoginOtpCellphone) > 1) && (
444
453
  <LoginWith>
445
454
  <ScrollView
446
455
  ref={scrollRefTab}
@@ -551,7 +560,7 @@ const LoginFormUI = (props: LoginParams) => {
551
560
  style={{
552
561
  width: '100%',
553
562
  borderBottomColor:
554
- isOtpCellphone
563
+ isOtpCellphone
555
564
  ? theme.colors.black
556
565
  : theme.colors.border,
557
566
  borderBottomWidth: 2,
@@ -590,8 +599,29 @@ const LoginFormUI = (props: LoginParams) => {
590
599
  )}
591
600
  />
592
601
  )}
593
-
594
- {((useLoginByEmail && loginTab === 'email') || (loginTab === 'otp' && otpType === 'email')) && (
602
+ {isDeviceLoginEnabled && (
603
+ <Controller
604
+ control={control}
605
+ render={({ onChange, value }: any) => (
606
+ <OInput
607
+ placeholder={t('DEVICE_CODE', 'Device Code')}
608
+ style={styles.inputStyle}
609
+ value={value}
610
+ inputStyle={{ textAlign: 'center' }}
611
+ onChange={(val: any) => onChange(val)}
612
+ />
613
+ )}
614
+ name="device_code"
615
+ rules={{
616
+ required: t(
617
+ 'VALIDATION_ERROR_DEVICE_CODE_REQUIRED',
618
+ 'The field DEVICE_CODE is required',
619
+ ).replace('_attribute_', t('DEVICE_CODE', 'Device Code')),
620
+ }}
621
+ defaultValue=""
622
+ />
623
+ )}
624
+ {!isDeviceLoginEnabled && ((useLoginByEmail && loginTab === 'email') || (loginTab === 'otp' && otpType === 'email')) && (
595
625
  <Controller
596
626
  control={control}
597
627
  render={({ onChange, value }: any) => (
@@ -626,7 +656,7 @@ const LoginFormUI = (props: LoginParams) => {
626
656
  />
627
657
  )}
628
658
 
629
- {((useLoginByCellphone && loginTab === 'cellphone') || (loginTab === 'otp' && otpType === 'cellphone')) && (
659
+ {!isDeviceLoginEnabled && ((useLoginByCellphone && loginTab === 'cellphone') || (loginTab === 'otp' && otpType === 'cellphone')) && (
630
660
  <View style={{ marginBottom: 20 }}>
631
661
  <PhoneInputNumber
632
662
  data={phoneInputData}
@@ -640,7 +670,7 @@ const LoginFormUI = (props: LoginParams) => {
640
670
  </View>
641
671
  )}
642
672
 
643
- {loginTab !== 'otp' && (
673
+ {!isDeviceLoginEnabled && loginTab !== 'otp' && (
644
674
  <Controller
645
675
  control={control}
646
676
  render={({ onChange, value }: any) => (
@@ -730,26 +760,26 @@ const LoginFormUI = (props: LoginParams) => {
730
760
  )}
731
761
  </View>
732
762
  <OModal
733
- open={willVerifyOtpState}
734
- onClose={() => setWillVerifyOtpState(false)}
735
- entireModal
736
- title={t('ENTER_VERIFICATION_CODE', 'Enter verification code')}
737
- >
738
- <Otp
739
- willVerifyOtpState={willVerifyOtpState}
740
- setWillVerifyOtpState={setWillVerifyOtpState}
741
- handleLoginOtp={handleLoginOtp}
742
- onSubmit={onSubmit}
743
- setAlertState={setAlertState}
744
- />
745
- </OModal>
746
- <Alert
747
- open={alertState.open}
748
- content={alertState.content}
749
- title={alertState.title || ''}
750
- onAccept={closeAlert}
751
- onClose={closeAlert}
752
- />
763
+ open={willVerifyOtpState}
764
+ onClose={() => setWillVerifyOtpState(false)}
765
+ entireModal
766
+ title={t('ENTER_VERIFICATION_CODE', 'Enter verification code')}
767
+ >
768
+ <Otp
769
+ willVerifyOtpState={willVerifyOtpState}
770
+ setWillVerifyOtpState={setWillVerifyOtpState}
771
+ handleLoginOtp={handleLoginOtp}
772
+ onSubmit={onSubmit}
773
+ setAlertState={setAlertState}
774
+ />
775
+ </OModal>
776
+ <Alert
777
+ open={alertState.open}
778
+ content={alertState.content}
779
+ title={alertState.title || ''}
780
+ onAccept={closeAlert}
781
+ onClose={closeAlert}
782
+ />
753
783
  </View>
754
784
  );
755
785
  };
@@ -24,11 +24,6 @@ import MaterialIcon from 'react-native-vector-icons/MaterialCommunityIcons'
24
24
 
25
25
  const PaymentOptionsUI = (props: any) => {
26
26
  const {
27
- cart,
28
- onNavigationRedirect,
29
- isDisabled,
30
- paymethodData,
31
- handlePaymethodDataChange,
32
27
  errorCash,
33
28
  isLoading,
34
29
  paymethodsList,
@@ -48,11 +43,11 @@ const PaymentOptionsUI = (props: any) => {
48
43
  const [orientationState] = useDeviceOrientation();
49
44
  const [userErrors, setUserErrors] = useState<any>([]);
50
45
  const [isOpenModal, setIsOpenModal] = useState(false)
51
- const paymethodSelected =
52
- paySelected || props.paymethodSelected || isOpenMethod.paymethod;
46
+ const paymethodSelected = paySelected || props.paymethodSelected || isOpenMethod.paymethod;
47
+ const includePaymethods = ['cash', 'card_delivery'];
53
48
 
54
49
  useEffect(() => {
55
- if (paymethodsList.paymethods.length === 1) {
50
+ if (paymethodsList?.paymethods?.length === 1) {
56
51
  handlePaymethodClick &&
57
52
  handlePaymethodClick(paymethodsList.paymethods[0]);
58
53
  }
@@ -85,23 +80,11 @@ const PaymentOptionsUI = (props: any) => {
85
80
  }
86
81
  }, [isOpenMethod.paymethod, placing, isLoading, paySelected]);
87
82
 
88
- // const includePaymethods = ['cash', 'card_delivery', 'stripe'];
89
- const includePaymethods = ['cash', 'card_delivery'];
90
-
91
- const supportedMethods = paymethodsList.paymethods.filter((p: any) =>
83
+ const supportedMethods = paymethodsList?.paymethods?.filter((p: any) =>
92
84
  includePaymethods.includes(p.gateway),
93
85
  );
94
86
 
95
- const cashIndex: number = supportedMethods?.findIndex(
96
- (item: any) => item?.gateway === 'cash',
97
- );
98
- const cardOnDeliveryIndex = supportedMethods?.findIndex(
99
- (item: any) => item?.gateway === 'card_delivery',
100
- );
101
- const stripeIndex = supportedMethods?.findIndex(
102
- (item: any) => item?.gateway === 'stripe',
103
- );
104
- const onSelectPaymethod = (paymethod: any, isPopupMethod: boolean) => {
87
+ const onSelectPaymethod = (paymethod: any) => {
105
88
  handlePaymethodClick(paymethod);
106
89
  };
107
90
 
@@ -132,57 +115,15 @@ const PaymentOptionsUI = (props: any) => {
132
115
  : orientationState?.dimensions?.height * 0.55,
133
116
  };
134
117
 
135
- const propsOfItems = {
136
- CASH_ID:
137
- cashIndex !== -1
138
- ? {
139
- style: cardStyle,
140
- title: t('CASH', 'Cash'),
141
- description: t(
142
- 'GO_FOR_YOR_RECEIPT_AND_GO_TO_THE_FRONT_COUNTER',
143
- 'Pay with cash in the front counter',
144
- ),
145
- bgImage: theme.images.general.cash,
146
- callToActionText: t('LETS_GO', 'LETS_GO'),
147
- VectorIcon: () => <AntIconDesign name='shoppingcart' size={28} color='white' style={{ marginBottom: 10 }} />,
148
- onClick: () =>
149
- onSelectPaymethod(supportedMethods[cashIndex], false),
150
- ...supportedMethods[cashIndex],
151
- }
152
- : null,
153
-
154
- CARD_ON_DELIVERY_ID:
155
- cardOnDeliveryIndex !== -1
156
- ? {
157
- style: cardStyle,
158
- title: t('CARD', supportedMethods[cardOnDeliveryIndex]?.name),
159
- description: t(
160
- 'WE_ACCEPT_EVERY_DEBIT_OR_CREDIT_CARD',
161
- 'We accept every debit or credit card',
162
- ),
163
- bgImage: theme.images.general.carddelivery,
164
- callToActionText: t("LETS_GO", "Let's go"),
165
- VectorIcon: () => <MaterialIcon name='pin-outline' size={28} color='white' style={{ marginBottom: 10 }} />,
166
- onClick: () => onSelectPaymethod(supportedMethods[cardOnDeliveryIndex], false),
167
- ...supportedMethods[cardOnDeliveryIndex],
168
- }
169
- : null,
170
- STRIPE:
171
- stripeIndex !== -1
172
- ? {
173
- style: cardStyle,
174
- title: t('STRIPE', supportedMethods[stripeIndex]?.name),
175
- description: t('STRIPE', 'Stripe'),
176
- bgImage: theme.images.general.carddelivery,
177
- callToActionText: t('INSERT_INFO', 'Test info'),
178
- VectorIcon: () => <MaterialIcon name='pin-outline' size={28} color='white' style={{ marginBottom: 10 }} />,
179
- onClick: () => {
180
- onSelectPaymethod(supportedMethods[stripeIndex], false);
181
- setIsOpenModal(true)
182
- },
183
- ...supportedMethods[stripeIndex],
184
- }
185
- : null,
118
+ const description = {
119
+ cash: t(
120
+ 'GO_FOR_YOR_RECEIPT_AND_GO_TO_THE_FRONT_COUNTER',
121
+ 'Pay with cash in the front counter',
122
+ ),
123
+ card_delivery: t(
124
+ 'WE_ACCEPT_EVERY_DEBIT_OR_CREDIT_CARD',
125
+ 'We accept every debit or credit card',
126
+ ),
186
127
  };
187
128
 
188
129
  const goToBack = () => navigation?.goBack();
@@ -192,47 +133,40 @@ const PaymentOptionsUI = (props: any) => {
192
133
  <Spinner visible={isLoading || placing || paymethodsList?.loading} />
193
134
 
194
135
  <Container nestedScrollEnabled>
195
- {supportedMethods?.length > 0 && (
196
- <>
197
- <NavBar
198
- title={t('PAYMENT_METHODS', 'Payment methods')}
199
- onActionLeft={goToBack}
200
- btnStyle={{ paddingLeft: 0 }}
201
- />
202
-
203
- <View
204
- style={{ marginVertical: orientationState?.dimensions?.height * 0.03 }}>
205
- <OText size={orientationState?.dimensions?.width * 0.048}>
206
- {t('HOW_WOULD_YOU', 'How would you')} {'\n'}
207
- <OText
208
- size={orientationState?.dimensions?.width * 0.048}
209
- weight={'700'}>
210
- {`${t('LIKE_TO_PAY', 'like to pay')}?`}
211
- </OText>
212
- </OText>
213
- </View>
214
-
215
- <GridContainer style={{ justifyContent: 'space-between' }}>
216
- {propsOfItems.CARD_ON_DELIVERY_ID && (
217
- <View style={{ marginBottom: orientationState?.orientation === LANDSCAPE ? 20 : 0 }}>
218
- <OptionCard {...propsOfItems?.CARD_ON_DELIVERY_ID} styke />
219
- </View>
220
- )}
221
-
222
- <View
223
- style={{
224
- width:
225
- orientationState?.orientation === LANDSCAPE
226
- ? orientationState?.dimensions?.width * 0.0016
227
- : 1,
228
- height:
229
- orientationState?.orientation === PORTRAIT
230
- ? orientationState?.dimensions?.height * 0.018
231
- : 1,
232
- }}
233
- />
234
-
235
- {propsOfItems?.CASH_ID && <OptionCard {...propsOfItems?.CASH_ID} />}
136
+ <NavBar
137
+ title={t('PAYMENT_METHODS', 'Payment methods')}
138
+ onActionLeft={goToBack}
139
+ btnStyle={{ paddingLeft: 0 }}
140
+ />
141
+
142
+ <View
143
+ style={{ marginVertical: orientationState?.dimensions?.height * 0.03 }}>
144
+ <OText size={orientationState?.dimensions?.width * 0.048}>
145
+ {t('HOW_WOULD_YOU', 'How would you')} {'\n'}
146
+ <OText
147
+ size={orientationState?.dimensions?.width * 0.048}
148
+ weight={'700'}>
149
+ {`${t('LIKE_TO_PAY', 'like to pay')}?`}
150
+ </OText>
151
+ </OText>
152
+ </View>
153
+
154
+ <GridContainer style={{ justifyContent: 'space-between' }}>
155
+ {supportedMethods?.length > 0 ? (supportedMethods?.map((paymethod: any, i: number) => (
156
+ <>
157
+ <View style={{ marginBottom: orientationState?.orientation === LANDSCAPE ? 20 : 0 }}>
158
+ <OptionCard
159
+ {...{
160
+ style: cardStyle,
161
+ title: t(`${paymethod.gateway.toUpperCase().replace(/\s/g, '_')}`, paymethod.name),
162
+ description: description[paymethod.gateway] ?? t(`${paymethod.gateway.toUpperCase().replace(/\s/g, '_')}`, paymethod.name),
163
+ bgImage: paymethod.name === 'Cash' ? theme.images.general.cash : theme.images.general.carddelivery,
164
+ callToActionText: paymethod.name === 'Cash' ? t('LETS_GO', 'LETS_GO') : t('INSERT_INFO', 'Test info'),
165
+ VectorIcon: () => paymethod.name === 'Cash' ? <AntIconDesign name='shoppingcart' size={28} color='white' style={{ marginBottom: 10 }} /> : <MaterialIcon name='pin-outline' size={28} color='white' style={{ marginBottom: 10 }} />,
166
+ onClick: () => onSelectPaymethod(paymethod, false),
167
+ }}
168
+ />
169
+ </View>
236
170
 
237
171
  <View
238
172
  style={{
@@ -246,13 +180,15 @@ const PaymentOptionsUI = (props: any) => {
246
180
  : 1,
247
181
  }}
248
182
  />
249
-
250
- {propsOfItems.STRIPE && (
251
- <OptionCard {...propsOfItems?.STRIPE} />
252
- )}
253
- </GridContainer>
254
- </>
255
- )}
183
+ </>
184
+ ))) : (
185
+ <OText
186
+ size={orientationState?.dimensions?.width * 0.048}
187
+ weight={'700'}>
188
+ {`${t('NO_PAYMETHODS_AVAILABLES', 'No paymethods availables')}`}
189
+ </OText>
190
+ )}
191
+ </GridContainer>
256
192
  <View style={{ height: orientationState?.dimensions?.height * 0.05 }} />
257
193
  <OModal
258
194
  open={isOpenModal}
@@ -99,12 +99,15 @@ import { Promotions } from './src/components/Promotions'
99
99
  import { PageBanner } from './src/components/PageBanner'
100
100
  import { MultiCart } from './src/components/MultiCart'
101
101
  import { USER_TYPE, ORDER_TYPES } from './src/config/constants'
102
-
102
+ import { DatePickerUI } from './src/components/DatePicker'
103
+ import { WebsocketStatus } from './src/components/WebsocketStatus';
103
104
  import { OSBill, OSTable, OSCoupon, OSTotal, OSRow } from './src/components/OrderSummary/styles';
104
105
 
105
106
  import { FormInput, FormSide, ButtonsWrapper, LoginWith, OTab, OTabs } from './src/components/LoginForm/styles';
106
107
  import { OSItem, OSItemContent, OSItemActions } from './src/components/PaymentOptionStripe/styles';
107
108
 
109
+ import { orderTypeList } from './src/utils'
110
+
108
111
  import Alert from './src/providers/AlertProvider'
109
112
 
110
113
  import {
@@ -263,7 +266,8 @@ export {
263
266
  Promotions,
264
267
  PageBanner,
265
268
  MyOrders,
266
- MultiCart,
269
+ MultiCart,
270
+ WebsocketStatus,
267
271
  ORDER_TYPES,
268
272
  USER_TYPE,
269
273
 
@@ -340,5 +344,9 @@ export {
340
344
  _retrieveStoreData,
341
345
  _setStoreData,
342
346
  _removeStoreData,
343
- _clearStoreData
347
+ _clearStoreData,
348
+ orderTypeList,
349
+
350
+ // Date Picker
351
+ DatePickerUI
344
352
  }