ordering-ui-react-native 0.21.0 → 0.21.1-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 (239) 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/PaymentOptionsWebView/index.tsx +1 -0
  6. package/src/components/StripeMethodForm/index.tsx +3 -3
  7. package/src/components/VerifyPhone/styles.tsx +1 -2
  8. package/src/components/shared/OToast.tsx +3 -2
  9. package/src/types/index.tsx +2 -1
  10. package/src/utils/index.tsx +2 -2
  11. package/themes/business/index.tsx +4 -0
  12. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +9 -2
  13. package/themes/business/src/components/BusinessController/index.tsx +19 -17
  14. package/themes/business/src/components/BusinessProductList/AccordionDropdown.tsx +63 -0
  15. package/themes/business/src/components/BusinessProductList/IterateCategories.tsx +108 -0
  16. package/themes/business/src/components/BusinessProductList/ProductList.tsx +196 -0
  17. package/themes/business/src/components/BusinessProductList/index.tsx +196 -0
  18. package/themes/business/src/components/BusinessProductList/styles.tsx +10 -0
  19. package/themes/business/src/components/Chat/index.tsx +41 -13
  20. package/themes/business/src/components/DriverMap/index.tsx +4 -2
  21. package/themes/business/src/components/DriverSchedule/index.tsx +5 -5
  22. package/themes/business/src/components/FloatingButton/index.tsx +34 -31
  23. package/themes/business/src/components/Home/index.tsx +5 -1
  24. package/themes/business/src/components/MapView/index.tsx +11 -7
  25. package/themes/business/src/components/MessagesOption/index.tsx +22 -94
  26. package/themes/business/src/components/NewOrderNotification/index.tsx +161 -106
  27. package/themes/business/src/components/OrderDetails/Delivery.tsx +21 -11
  28. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +88 -51
  29. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +36 -16
  30. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +6 -1
  31. package/themes/business/src/components/OrderSummary/index.tsx +42 -23
  32. package/themes/business/src/components/OrdersListManager/index.tsx +7 -2
  33. package/themes/business/src/components/OrdersListManager/utils.tsx +1 -1
  34. package/themes/business/src/components/OrdersOption/index.tsx +125 -48
  35. package/themes/business/src/components/PreviousMessages/FooterMessageComponent.tsx +103 -0
  36. package/themes/business/src/components/PreviousMessages/index.tsx +97 -55
  37. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +27 -35
  38. package/themes/business/src/components/PreviousOrders/OrderList.tsx +93 -0
  39. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +1 -1
  40. package/themes/business/src/components/PreviousOrders/index.tsx +192 -220
  41. package/themes/business/src/components/PreviousOrders/styles.tsx +10 -0
  42. package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
  43. package/themes/business/src/components/ReviewCustomer/index.tsx +2 -0
  44. package/themes/business/src/components/SearchBar/index.tsx +2 -1
  45. package/themes/business/src/components/Sessions/index.tsx +187 -0
  46. package/themes/business/src/components/Sessions/styles.tsx +20 -0
  47. package/themes/business/src/components/StoresList/index.tsx +5 -3
  48. package/themes/business/src/components/UserProfileForm/index.tsx +76 -41
  49. package/themes/business/src/components/WebsocketStatus/index.tsx +171 -0
  50. package/themes/business/src/components/WebsocketStatus/styles.tsx +28 -0
  51. package/themes/business/src/components/shared/OInput.tsx +2 -0
  52. package/themes/business/src/hooks/useLocation.tsx +5 -4
  53. package/themes/business/src/types/index.tsx +19 -0
  54. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  55. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  56. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  57. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  58. package/themes/kiosk/src/components/LoginForm/index.tsx +124 -96
  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/shared/OButton.tsx +5 -18
  63. package/themes/original/index.tsx +9 -4
  64. package/themes/original/src/components/AddressDetails/index.tsx +20 -10
  65. package/themes/original/src/components/AddressForm/index.tsx +2 -2
  66. package/themes/original/src/components/AddressForm/styles.tsx +1 -1
  67. package/themes/original/src/components/AddressList/index.tsx +4 -7
  68. package/themes/original/src/components/AddressList/styles.tsx +4 -4
  69. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  70. package/themes/original/src/components/BusinessBasicInformation/index.tsx +4 -4
  71. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -1
  72. package/themes/original/src/components/BusinessController/index.tsx +18 -10
  73. package/themes/original/src/components/BusinessController/styles.tsx +8 -7
  74. package/themes/original/src/components/BusinessInformation/index.tsx +35 -3
  75. package/themes/original/src/components/BusinessInformation/styles.tsx +2 -2
  76. package/themes/original/src/components/BusinessItemAccordion/index.tsx +11 -7
  77. package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +317 -0
  78. package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +96 -0
  79. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +1 -1
  80. package/themes/original/src/components/BusinessListingSearch/index.tsx +56 -361
  81. package/themes/original/src/components/BusinessListingSearch/styles.tsx +1 -1
  82. package/themes/original/src/components/BusinessPreorder/index.tsx +3 -4
  83. package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -1
  84. package/themes/original/src/components/BusinessProductsList/index.tsx +3 -3
  85. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  86. package/themes/original/src/components/BusinessProductsListing/index.tsx +46 -22
  87. package/themes/original/src/components/BusinessProductsListing/styles.tsx +3 -4
  88. package/themes/original/src/components/BusinessReviews/index.tsx +1 -1
  89. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  90. package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -5
  91. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +69 -0
  92. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +406 -0
  93. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListing.tsx +76 -0
  94. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +29 -402
  95. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
  96. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  97. package/themes/original/src/components/Cart/index.tsx +32 -9
  98. package/themes/original/src/components/CartContent/index.tsx +98 -59
  99. package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
  100. package/themes/original/src/components/Checkout/index.tsx +219 -66
  101. package/themes/original/src/components/Checkout/styles.tsx +17 -0
  102. package/themes/original/src/components/CitiesControl/styles.tsx +1 -1
  103. package/themes/original/src/components/DatePicker/index.tsx +17 -0
  104. package/themes/original/src/components/DatePicker/styles.tsx +20 -0
  105. package/themes/original/src/components/Favorite/index.tsx +4 -9
  106. package/themes/original/src/components/Favorite/styles.tsx +0 -2
  107. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  108. package/themes/original/src/components/GPSButton/index.tsx +1 -1
  109. package/themes/original/src/components/GiftCard/GiftCardOrdersList/index.tsx +64 -0
  110. package/themes/original/src/components/GiftCard/GiftCardOrdersList/styles.tsx +8 -0
  111. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
  112. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +36 -3
  113. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +1 -1
  114. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +67 -4
  115. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +1 -1
  116. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +2 -2
  117. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +1 -1
  118. package/themes/original/src/components/GiftCard/SingleGiftCard/index.tsx +101 -0
  119. package/themes/original/src/components/GiftCard/SingleGiftCard/styles.tsx +4 -0
  120. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +83 -0
  121. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/styles.tsx +9 -0
  122. package/themes/original/src/components/GoogleMap/index.tsx +50 -5
  123. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +2 -2
  124. package/themes/original/src/components/HighestRatedBusinesses/styles.tsx +1 -1
  125. package/themes/original/src/components/Home/index.tsx +1 -1
  126. package/themes/original/src/components/LastOrder/index.tsx +2 -1
  127. package/themes/original/src/components/LastOrders/index.tsx +2 -1
  128. package/themes/original/src/components/LoginForm/Otp/index.tsx +53 -47
  129. package/themes/original/src/components/LoginForm/index.tsx +6 -1
  130. package/themes/original/src/components/Messages/index.tsx +9 -4
  131. package/themes/original/src/components/Messages/styles.tsx +1 -1
  132. package/themes/original/src/components/MomentOption/index.tsx +4 -4
  133. package/themes/original/src/components/MomentSelector/index.tsx +1 -1
  134. package/themes/original/src/components/MultiCart/index.tsx +1 -1
  135. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +13 -4
  136. package/themes/original/src/components/MultiCheckout/index.tsx +251 -53
  137. package/themes/original/src/components/MultiCheckout/styles.tsx +17 -0
  138. package/themes/original/src/components/MultiOrdersDetails/index.tsx +20 -15
  139. package/themes/original/src/components/MyOrders/index.tsx +24 -29
  140. package/themes/original/src/components/NavBar/index.tsx +3 -1
  141. package/themes/original/src/components/NetworkError/index.tsx +2 -3
  142. package/themes/original/src/components/NetworkError/styles.tsx +2 -2
  143. package/themes/original/src/components/Notifications/index.tsx +4 -8
  144. package/themes/original/src/components/Notifications/styles.tsx +0 -1
  145. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +7 -3
  146. package/themes/original/src/components/OrderDetails/index.tsx +716 -667
  147. package/themes/original/src/components/OrderDetails/styles.tsx +24 -8
  148. package/themes/original/src/components/OrderProgress/index.tsx +28 -9
  149. package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
  150. package/themes/original/src/components/OrderSummary/index.tsx +5 -3
  151. package/themes/original/src/components/OrderTypeSelector/index.tsx +5 -6
  152. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +1 -1
  153. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +1 -1
  154. package/themes/original/src/components/OrdersOption/index.tsx +5 -3
  155. package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
  156. package/themes/original/src/components/PageBanner/index.tsx +3 -0
  157. package/themes/original/src/components/PaymentOptionCard/index.tsx +4 -2
  158. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +3 -0
  159. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  160. package/themes/original/src/components/PaymentOptions/index.tsx +81 -33
  161. package/themes/original/src/components/PhoneInputNumber/index.tsx +15 -1
  162. package/themes/original/src/components/ProductForm/ActionButton.tsx +120 -0
  163. package/themes/original/src/components/ProductForm/ExtraOptions.tsx +56 -0
  164. package/themes/original/src/components/ProductForm/index.tsx +79 -167
  165. package/themes/original/src/components/ProductForm/styles.tsx +1 -1
  166. package/themes/original/src/components/ProductItemAccordion/index.tsx +12 -8
  167. package/themes/original/src/components/ProductOptionSubOption/index.tsx +120 -79
  168. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +10 -9
  169. package/themes/original/src/components/ProfessionalProfile/styles.tsx +3 -3
  170. package/themes/original/src/components/Promotions/index.tsx +4 -4
  171. package/themes/original/src/components/Promotions/styles.tsx +0 -2
  172. package/themes/original/src/components/ReviewDriver/styles.tsx +1 -1
  173. package/themes/original/src/components/ReviewOrder/styles.tsx +1 -1
  174. package/themes/original/src/components/ReviewProducts/styles.tsx +1 -1
  175. package/themes/original/src/components/ServiceForm/index.tsx +2 -2
  176. package/themes/original/src/components/ServiceForm/styles.tsx +4 -4
  177. package/themes/original/src/components/SingleOrderCard/index.tsx +5 -4
  178. package/themes/original/src/components/SingleProductCard/index.tsx +2 -2
  179. package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
  180. package/themes/original/src/components/StripeCardsList/index.tsx +23 -8
  181. package/themes/original/src/components/StripeElementsForm/index.tsx +9 -4
  182. package/themes/original/src/components/StripeElementsForm/naked.tsx +12 -1
  183. package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +170 -0
  184. package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +86 -0
  185. package/themes/original/src/components/UpsellingProducts/index.tsx +15 -199
  186. package/themes/original/src/components/UpsellingProducts/styles.tsx +19 -0
  187. package/themes/original/src/components/UserFormDetails/index.tsx +53 -7
  188. package/themes/original/src/components/UserProfile/index.tsx +3 -2
  189. package/themes/original/src/components/UserProfileForm/index.tsx +30 -36
  190. package/themes/original/src/components/UserVerification/index.tsx +55 -50
  191. package/themes/original/src/components/WalletTransactions/styles.tsx +1 -0
  192. package/themes/original/src/components/Wallets/index.tsx +8 -9
  193. package/themes/original/src/components/Wallets/styles.tsx +1 -1
  194. package/themes/original/src/components/WebsocketStatus/index.tsx +172 -0
  195. package/themes/original/src/components/WebsocketStatus/styles.tsx +28 -0
  196. package/themes/original/src/components/shared/HeaderTitle.tsx +1 -1
  197. package/themes/original/src/components/shared/OButton.tsx +5 -5
  198. package/themes/original/src/components/shared/OInput.tsx +1 -4
  199. package/themes/original/src/components/shared/OModal.tsx +12 -14
  200. package/themes/original/src/layouts/Container.tsx +5 -3
  201. package/themes/original/src/types/index.tsx +10 -2
  202. package/themes/original/src/utils/index.tsx +124 -0
  203. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
  204. package/src/navigators/BottomNavigator.tsx +0 -117
  205. package/src/navigators/CheckoutNavigator.tsx +0 -66
  206. package/src/navigators/HomeNavigator.tsx +0 -202
  207. package/src/navigators/NavigationRef.tsx +0 -7
  208. package/src/navigators/RootNavigator.tsx +0 -269
  209. package/src/pages/Account.tsx +0 -34
  210. package/src/pages/AddressForm.tsx +0 -62
  211. package/src/pages/AddressList.tsx +0 -24
  212. package/src/pages/BusinessProductsList.tsx +0 -81
  213. package/src/pages/BusinessesListing.tsx +0 -43
  214. package/src/pages/CartList.tsx +0 -49
  215. package/src/pages/Checkout.tsx +0 -101
  216. package/src/pages/ForgotPassword.tsx +0 -24
  217. package/src/pages/Help.tsx +0 -23
  218. package/src/pages/HelpAccountAndPayment.tsx +0 -23
  219. package/src/pages/HelpGuide.tsx +0 -23
  220. package/src/pages/HelpOrder.tsx +0 -23
  221. package/src/pages/Home.tsx +0 -36
  222. package/src/pages/IntroductoryTutorial.tsx +0 -170
  223. package/src/pages/Login.tsx +0 -47
  224. package/src/pages/MomentOption.tsx +0 -30
  225. package/src/pages/MultiCheckout.tsx +0 -31
  226. package/src/pages/MultiOrdersDetails.tsx +0 -27
  227. package/src/pages/MyOrders.tsx +0 -40
  228. package/src/pages/NetworkError.tsx +0 -24
  229. package/src/pages/NotFound.tsx +0 -22
  230. package/src/pages/OrderDetails.tsx +0 -25
  231. package/src/pages/ProductDetails.tsx +0 -55
  232. package/src/pages/Profile.tsx +0 -36
  233. package/src/pages/ReviewDriver.tsx +0 -30
  234. package/src/pages/ReviewOrder.tsx +0 -32
  235. package/src/pages/ReviewProducts.tsx +0 -30
  236. package/src/pages/Sessions.tsx +0 -22
  237. package/src/pages/Signup.tsx +0 -53
  238. package/src/pages/SpinnerLoader.tsx +0 -10
  239. package/src/pages/Splash.tsx +0 -21
@@ -288,43 +288,37 @@ const ProfileUI = (props: ProfileParams) => {
288
288
  showCall={false}
289
289
  btnStyle={{ paddingLeft: 0 }}
290
290
  />
291
- <KeyboardAvoidingView
292
- behavior={Platform.OS == 'ios' ? 'padding' : 'height'}
293
- enabled={Platform.OS === 'ios' ? true : false}
294
- style={{ flex: 1, flexDirection: 'column', justifyContent: 'center' }}
295
- >
296
- <CenterView>
297
- <View style={styles.photo}>
298
- {user?.photo ? (
299
- <FastImage
300
- style={{ height: 80, width: 80, borderRadius: 8 }}
301
- source={{
302
- uri: user?.photo,
303
- priority: FastImage.priority.normal,
304
- }}
305
- resizeMode={FastImage.resizeMode.cover}
306
- />
307
- ) : (
308
- <Ionicons name='person-outline' size={50} />
309
- )}
310
- </View>
311
- <OIconButton
312
- icon={theme.images.general.camera}
313
- borderColor={theme.colors.clear}
314
- iconStyle={{ width: 20, height: 20 }}
315
- style={{ maxWidth: 40, position: 'absolute', alignSelf: 'center', backgroundColor: '#000', opacity: 0.5 }}
316
- onClick={() => handleImagePicker()}
317
- />
318
- </CenterView>
319
- <View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginVertical: 32, zIndex: 10 }} />
320
- <Spinner visible={formState?.loading || verifyPhoneState?.loading} />
321
- <UserFormDetailsUI
322
- {...props}
323
- isProfile
324
- isEdit
325
- setWillVerifyOtpState={setWillVerifyOtpState}
291
+ <CenterView>
292
+ <View style={styles.photo}>
293
+ {user?.photo ? (
294
+ <FastImage
295
+ style={{ height: 80, width: 80, borderRadius: 8 }}
296
+ source={{
297
+ uri: user?.photo,
298
+ priority: FastImage.priority.normal,
299
+ }}
300
+ resizeMode={FastImage.resizeMode.cover}
301
+ />
302
+ ) : (
303
+ <Ionicons name='person-outline' size={50} />
304
+ )}
305
+ </View>
306
+ <OIconButton
307
+ icon={theme.images.general.camera}
308
+ borderColor={theme.colors.clear}
309
+ iconStyle={{ width: 20, height: 20 }}
310
+ style={{ maxWidth: 40, position: 'absolute', alignSelf: 'center', backgroundColor: '#000', opacity: 0.5 }}
311
+ onClick={() => handleImagePicker()}
326
312
  />
327
- </KeyboardAvoidingView>
313
+ </CenterView>
314
+ <View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginVertical: 32, zIndex: 10 }} />
315
+ <Spinner visible={formState?.loading || verifyPhoneState?.loading} />
316
+ <UserFormDetailsUI
317
+ {...props}
318
+ isProfile
319
+ isEdit
320
+ setWillVerifyOtpState={setWillVerifyOtpState}
321
+ />
328
322
  </Container>
329
323
  <OModal
330
324
  open={isModalVisible}
@@ -195,38 +195,39 @@ const UserVerificationUI = (props: any) => {
195
195
  }
196
196
 
197
197
  useEffect(() => {
198
- let _timer = TIME_COUNTDOWN - 1;
199
- let minutes = 0;
200
- let seconds = 0;
201
- const interval = setInterval(() => {
202
- minutes = _timer / 60;
203
- seconds = _timer % 60;
204
-
205
- minutes = minutes < 10 ? 0 + minutes : minutes;
206
- seconds = seconds < 10 ? 0 + seconds : seconds;
207
-
208
- const formatMinutes = parseInt(minutes.toString()) < 10
209
- ? `0${parseInt(minutes.toString())}`
210
- : parseInt(minutes.toString());
211
-
212
- const formatseconds = parseInt(seconds.toString()) < 10
213
- ? `0${parseInt(seconds.toString())}`
214
- : parseInt(seconds.toString());
215
-
216
- setTimer(`${formatMinutes}:${formatseconds}`);
217
-
218
- if (--_timer < 0) {
219
- clearInterval(interval);
220
- }
221
-
222
- if (timer === `${TIME_COUNTDOWN / 60}:00` && isSendCodeAgain) {
223
- setIsSendCodeAgain(false)
224
- clearInterval(interval);
225
- }
226
- }, 1000);
227
-
228
- return () => clearInterval(interval)
229
- }, [isSendCodeAgain])
198
+ if (verificationState.phone) {
199
+ let _timer = TIME_COUNTDOWN - 1;
200
+ let minutes = 0;
201
+ let seconds = 0;
202
+ const interval = setInterval(() => {
203
+ minutes = _timer / 60;
204
+ seconds = _timer % 60;
205
+
206
+ minutes = minutes < 10 ? 0 + minutes : minutes;
207
+ seconds = seconds < 10 ? 0 + seconds : seconds;
208
+
209
+ const formatMinutes = parseInt(minutes.toString()) < 10
210
+ ? `0${parseInt(minutes.toString())}`
211
+ : parseInt(minutes.toString());
212
+
213
+ const formatseconds = parseInt(seconds.toString()) < 10
214
+ ? `0${parseInt(seconds.toString())}`
215
+ : parseInt(seconds.toString());
216
+
217
+ setTimer(`${formatMinutes}:${formatseconds}`);
218
+
219
+ if (--_timer < 0) {
220
+ clearInterval(interval);
221
+ }
222
+
223
+ if (timer === `${TIME_COUNTDOWN / 60}:00` && isSendCodeAgain) {
224
+ setIsSendCodeAgain(false)
225
+ clearInterval(interval);
226
+ }
227
+ }, 1000);
228
+ return () => clearInterval(interval)
229
+ }
230
+ }, [isSendCodeAgain, verificationState.phone])
230
231
 
231
232
  useEffect(() => {
232
233
  if (otpState?.length === CODE_LENGTH) {
@@ -292,7 +293,7 @@ const UserVerificationUI = (props: any) => {
292
293
 
293
294
  useEffect(() => {
294
295
  setupUserPhoneNumber()
295
- }, [user])
296
+ }, [user?.cellphone, user?.country_phone_code])
296
297
 
297
298
  return (
298
299
  <SafeAreaView style={{ flex: 1 }}>
@@ -401,6 +402,7 @@ const UserVerificationUI = (props: any) => {
401
402
  textStyle={{ color: theme.colors.textNormal, fontSize: 12, padding: 0 }}
402
403
  noDropIcon
403
404
  isDisabled
405
+ updateStateWithSubmit
404
406
  />
405
407
  </InputWrapper>
406
408
  </>
@@ -460,28 +462,31 @@ const UserVerificationUI = (props: any) => {
460
462
  )}
461
463
 
462
464
  </Container>
463
- <ButtonsActions>
464
- <View style={{ width: '100%' }}>
465
- <OButton
466
- onClick={(verificationState.email || verificationState.phone)
467
- ? () => setVerificationState({ email: false, phone: false })
468
- : () => handleSendOtp(isPhoneVerifyRequired && !isEmailVerifyRequired ? 'phone' : '')
469
- }
470
- text={(verificationState.email || verificationState.phone) ? t('CANCEL', 'Cancel') : t('SEND_CODE', 'Send code')}
471
- bgColor={(verificationState.email || verificationState.phone) ? theme.colors.secundary : theme.colors.primary}
472
- borderColor={(verificationState.email || verificationState.phone) ? theme.colors.secundary : theme.colors.primary}
473
- textStyle={{ color: (verificationState.email || verificationState.phone) ? 'black' : 'white' }}
474
- imgRightSrc={null}
475
- isLoading={verifyEmailState?.loadingSendCode || verifyEmailState?.loadingCheckCode || verifyPhoneState?.loadingSendCode || verifyPhoneState?.loadingCheckCode}
476
- style={(verificationState.email || verificationState.phone) ? style.btnStyle : { borderRadius: 7.6 }}
477
- />
478
- </View>
479
- </ButtonsActions>
465
+ {!!phoneState?.cellphone && (
466
+ <ButtonsActions>
467
+ <View style={{ width: '100%' }}>
468
+ <OButton
469
+ onClick={(verificationState.email || verificationState.phone)
470
+ ? () => setVerificationState({ email: false, phone: false })
471
+ : () => handleSendOtp(isPhoneVerifyRequired && !isEmailVerifyRequired ? 'phone' : '')
472
+ }
473
+ text={(verificationState.email || verificationState.phone) ? t('CANCEL', 'Cancel') : t('SEND_CODE', 'Send code')}
474
+ bgColor={(verificationState.email || verificationState.phone) ? theme.colors.secundary : theme.colors.primary}
475
+ borderColor={(verificationState.email || verificationState.phone) ? theme.colors.secundary : theme.colors.primary}
476
+ textStyle={{ color: (verificationState.email || verificationState.phone) ? 'black' : 'white' }}
477
+ imgRightSrc={null}
478
+ isLoading={verifyEmailState?.loadingSendCode || verifyEmailState?.loadingCheckCode || verifyPhoneState?.loadingSendCode || verifyPhoneState?.loadingCheckCode}
479
+ style={(verificationState.email || verificationState.phone) ? style.btnStyle : { borderRadius: 7.6 }}
480
+ />
481
+ </View>
482
+ </ButtonsActions>
483
+ )}
480
484
  <View style={{ paddingHorizontal: 20, paddingBottom: 80 }}>
481
485
  <UserDetails
482
486
  user={user}
483
487
  isEdit
484
488
  isVerifiedPhone
489
+ dontToggleEditMode
485
490
  />
486
491
  </View>
487
492
  </ScrollView>
@@ -3,6 +3,7 @@ import styled from 'styled-components/native'
3
3
  export const Container = styled.View`
4
4
  display: flex;
5
5
  flex-direction: column;
6
+ width: 100%;
6
7
  `
7
8
 
8
9
  export const TransactionsWrapper = styled.View`
@@ -73,7 +73,7 @@ const WalletsUI = (props: any) => {
73
73
  const [tabSelected, setTabSelected] = useState(isWalletCashEnabled ? 'cash' : 'credit_point')
74
74
  const [openHistory, setOpenHistory] = useState(false)
75
75
  const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
76
- const hideWalletsTheme = theme?.bar_menu?.components?.wallets?.hidden
76
+ const hideWalletsTheme = theme?.bar_menu?.components?.wallet?.hidden === true
77
77
 
78
78
  const isWalletEnabled = configs?.cash_wallet?.value && configs?.wallet_enabled?.value === '1' && (isWalletCashEnabled || isWalletPointsEnabled)
79
79
 
@@ -120,18 +120,16 @@ const WalletsUI = (props: any) => {
120
120
 
121
121
  return (
122
122
  <>
123
- <Container
124
- pdng={Platform.OS === 'ios' ? '10px' : '0'}
125
- >
123
+ <Container>
126
124
  <Header>
127
125
  <View style={{
128
126
  ...{
129
127
  width: '100%',
130
128
  display: 'flex',
131
- flexDirection: hideWalletsTheme ? 'column' : 'row',
132
- justifyContent: hideWalletsTheme ? 'flex-start' : 'space-between',
133
- alignItems: hideWalletsTheme ? 'flex-start' : 'center',
134
- marginTop: hideWalletsTheme ? 0 : 10,
129
+ flexDirection: !hideWalletsTheme ? 'column' : 'row',
130
+ justifyContent: !hideWalletsTheme ? 'flex-start' : 'space-between',
131
+ alignItems: !hideWalletsTheme ? 'flex-start' : 'center',
132
+ marginTop: !hideWalletsTheme ? Platform.OS === 'ios' ? 20 : 30 : 10,
135
133
  },
136
134
  }}>
137
135
  <NavBar
@@ -141,6 +139,7 @@ const WalletsUI = (props: any) => {
141
139
  showCall={false}
142
140
  paddingTop={10}
143
141
  btnStyle={{ paddingLeft: 0 }}
142
+ isVertical={!hideWalletsTheme}
144
143
  hideArrowLeft={!hideWalletsTheme}
145
144
  />
146
145
  {isChewLayout && !openHistory && (
@@ -151,7 +150,7 @@ const WalletsUI = (props: any) => {
151
150
  imgRightSrc={null}
152
151
  textStyle={{ fontSize: 12, color: theme.colors.disabled }}
153
152
  onClick={() => setOpenHistory(true)}
154
- style={{ borderRadius: 8, height: 40, width: hideWalletsTheme ? '100%' : 150, marginTop: hideWalletsTheme ? 10 : 0 }}
153
+ style={{ borderRadius: 8, height: 40, width: !hideWalletsTheme ? '100%' : 150, marginTop: !hideWalletsTheme ? 10 : 0 }}
155
154
  />
156
155
  )}
157
156
  </View>
@@ -3,7 +3,7 @@ import styled from 'styled-components/native'
3
3
  export const Container = styled.View`
4
4
  padding-horizontal: 20px;
5
5
  padding-bottom: 20px;
6
- padding-top: ${(props: any) => props.pdng};
6
+ padding-top: ${(props: any) => props.pdng || 0};
7
7
  `
8
8
  export const Header = styled.View`
9
9
  flex-direction: row;
@@ -0,0 +1,172 @@
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
+ marginHorizontal: 15
70
+ }}
71
+ activeOpacity={0.6}
72
+ onPress={() => setOpenModal(true)}
73
+ >
74
+ <OText
75
+ style={{ color: theme.colors.backArrow, fontSize: 16, marginBottom: 0, lineHeight: 16 }}
76
+ >
77
+ {t('CONNECTION_STATUS', 'Status')}
78
+ </OText>
79
+ <MaterialIcon
80
+ name='circle'
81
+ size={12}
82
+ color={getStatusColor(socketStatus)}
83
+ style={{ marginLeft: 8 }}
84
+ />
85
+ </TouchableOpacity>
86
+
87
+ <OModal
88
+ open={openModal}
89
+ onClose={() => setOpenModal(false)}
90
+ entireModal
91
+ customClose
92
+ >
93
+ <ModalContainer nestedScrollEnabled={true}>
94
+ <TouchableOpacity
95
+ onPress={() => setOpenModal(false)}
96
+ style={styles.btnBackArrow}
97
+ >
98
+ <OIcon src={theme.images.general.arrow_left} color={theme.colors.textGray} />
99
+ </TouchableOpacity>
100
+ <View>
101
+ <ModalTitle>{t('CONNECTION_STATUS', 'Connection status')}</ModalTitle>
102
+ <OText style={{ marginBottom: 20 }}>
103
+ {t('LAST_UPDATE', 'Last update')}: {parseDate(connectedDate)}
104
+ </OText>
105
+ <StatusItemWrapper>
106
+ <MaterialIcon
107
+ name='circle'
108
+ size={12}
109
+ color={getStatusColor(1)}
110
+ style={{ marginTop: 10, marginHorizontal: 8 }}
111
+ />
112
+ <View style={{ marginLeft: 16 }}>
113
+ <StatusText>{t('OK', 'Ok')}</StatusText>
114
+ <OText style={{ color: theme.colors.backArrow, fontSize: 14 }}>{t('WEBSOCKET_OK', 'The websocket works normally.')}</OText>
115
+ </View>
116
+ </StatusItemWrapper>
117
+ <StatusItemWrapper>
118
+ <MaterialIcon
119
+ name='circle'
120
+ size={12}
121
+ color={getStatusColor(0)}
122
+ style={{ marginTop: 10, marginHorizontal: 8 }}
123
+ />
124
+ <View style={{ marginLeft: 16 }}>
125
+ <StatusText>{t('CONNECTING', 'Connecting')}</StatusText>
126
+ <OText style={{ color: theme.colors.backArrow, fontSize: 14 }}>{t('WEBSOCKET_CONNECTING', 'The websocket is connecting.')}</OText>
127
+ </View>
128
+ </StatusItemWrapper>
129
+ <StatusItemWrapper>
130
+ <MaterialIcon
131
+ name='circle'
132
+ size={12}
133
+ color={getStatusColor(2)}
134
+ style={{ marginTop: 10, marginHorizontal: 8 }}
135
+ />
136
+ <View style={{ marginLeft: 16 }}>
137
+ <StatusText>{t('DISCONNECTED', 'Disconnected')}</StatusText>
138
+ <OText style={{ color: theme.colors.backArrow, fontSize: 14 }}>{t('WEBSOCKET_DISCONNECTED', 'The server is slow, please reload.')}</OText>
139
+ </View>
140
+ </StatusItemWrapper>
141
+
142
+ <View style={{ flexDirection: 'row', marginTop: 50 }}>
143
+ <OButton
144
+ onClick={() => setOpenModal(false)}
145
+ bgColor={theme.colors.white}
146
+ borderColor={theme.colors.primary}
147
+ textStyle={{ color: theme.colors.primary }}
148
+ style={{ borderRadius: 8, height: 48 }}
149
+ text={t('CLOSE', 'Close')}
150
+ />
151
+ <OButton
152
+ onClick={() => RNRestart.Restart()}
153
+ borderColor={theme.colors.primary}
154
+ textStyle={{ color: theme.colors.white }}
155
+ style={{ borderRadius: 8, marginLeft: 16, height: 48 }}
156
+ text={t('UPDATE', 'Update')}
157
+ />
158
+ </View>
159
+ </View>
160
+ </ModalContainer>
161
+ </OModal>
162
+ </Container>
163
+ )
164
+ }
165
+
166
+ export const WebsocketStatus = (props: any) => {
167
+ const socketProps = {
168
+ ...props,
169
+ UIComponent: SocketStatusUI
170
+ }
171
+ return <WebsocketStatusController {...socketProps} />
172
+ }
@@ -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
+ `
@@ -13,7 +13,7 @@ const HeaderTitle = (props: any) => {
13
13
  weight={Platform.OS === 'ios' ? '600' : 'bold'}
14
14
  style={style ?? {
15
15
  marginTop: Platform.OS === 'android' ? 50 : 30,
16
- paddingHorizontal: props.ph ?? 40,
16
+ paddingHorizontal: props.ph ?? 20,
17
17
  textTransform: 'capitalize',
18
18
  color: props.titleColor || theme.colors.textNormal,
19
19
  }}
@@ -27,9 +27,9 @@ const StyledButton = styled.View<Props>`
27
27
  padding-left: 20px;
28
28
  padding-right: 20px;
29
29
  position: relative;
30
- ${(props: any) => props?.theme?.general?.components?.buttons?.borderRadius && css`
31
- border-radius: ${props?.theme?.general?.components?.buttons?.borderRadius}px;
32
- `}
30
+ ${(props: any) => props?.borderRadius && css`
31
+ border-radius: ${typeof props?.borderRadius === 'string' ? props?.borderRadius : `${props?.borderRadius}px`};
32
+ `}
33
33
  `
34
34
  const StyledButtonDisabled = styled(StyledButton)`
35
35
  background-color: ${(props: any) => props.theme.colors.disabled};
@@ -119,7 +119,7 @@ const OButton = (props: Props): React.ReactElement => {
119
119
  style={{ width: props.isCircle ? 52 : props.style?.width, ...props.parentStyle }}
120
120
  disabled={props.isDisabledWithSameStyles}
121
121
  >
122
- <StyledButton style={props.bgColor ? { ...props.style, backgroundColor: props.bgColor, borderColor: props.borderColor, borderRadius: parseInt(theme?.general?.components?.buttons?.borderRadius) || props.style?.borderRadius } : { ...props.style, borderRadius: parseInt(theme?.general?.components?.buttons?.borderRadius) || props.style?.borderRadius }}>
122
+ <StyledButton style={{ ...props.style, backgroundColor: theme?.general?.components?.buttons?.color ?? props.bgColor, borderColor: theme?.general?.components?.buttons?.color ?? props.borderColor, borderRadius: parseInt(theme?.general?.components?.buttons?.borderRadius) || props.style?.borderRadius }}>
123
123
  {props.icon ? (
124
124
  <props.icon {...props.iconProps} />
125
125
  ) : null}
@@ -127,7 +127,7 @@ const OButton = (props: Props): React.ReactElement => {
127
127
  <OIcon style={props.imgLeftStyle} src={props.imgLeftSrc} color={theme.colors.textNormal} />
128
128
  ) : null}
129
129
  {props.text ? (
130
- <StyledText style={props.textStyle}>{props.text}</StyledText>
130
+ <StyledText style={{ ...props.textStyle, color: theme?.general?.components?.buttons?.buttonTextColor ?? props?.textStyle?.color }}>{props.text}</StyledText>
131
131
  ) : null}
132
132
  {props.imgRightSrc ? (
133
133
  <EndImage style={props.imgRightStyle} source={props.imgRightSrc} />
@@ -3,7 +3,7 @@ import { ImageSourcePropType, ImageStyle, ViewStyle, TextInputProps, TextStyle }
3
3
  import styled from 'styled-components/native';
4
4
  import OIcon from './OIcon';
5
5
  import MaterialIcon from 'react-native-vector-icons/MaterialIcons'
6
- import { useTheme, css } from 'styled-components/native';
6
+ import { useTheme } from 'styled-components/native';
7
7
 
8
8
  const Input = styled.TextInput`
9
9
  flex-grow: 1;
@@ -53,9 +53,6 @@ const Wrapper = styled.Pressable`
53
53
  align-items: center;
54
54
  justify-content: center;
55
55
  width: 100%;
56
- ${(props: any) => props.theme?.general?.components?.inputs?.borderRadius && css`
57
- border-radius: ${props?.theme?.general?.components?.inputs?.borderRadius};
58
- `}
59
56
  `;
60
57
 
61
58
  const OInput = (props: Props): React.ReactElement => {
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { Modal, StyleSheet, Text, SafeAreaView, View, TouchableOpacity, Platform } from "react-native";
3
- import { OIcon } from '.';
4
- import styled, { useTheme } from 'styled-components/native';
3
+ import styled from 'styled-components/native';
4
+ import AntDesignIcon from 'react-native-vector-icons/AntDesign'
5
5
 
6
6
  interface Props {
7
7
  open?: boolean;
@@ -50,17 +50,15 @@ const OModal = (props: Props): React.ReactElement => {
50
50
  isAvoidKeyBoardView
51
51
  } = props
52
52
 
53
- const theme = useTheme();
54
-
55
53
  const renderSafeAreaView = () => (
56
54
  <SafeAreaView style={styles.container}>
57
55
  {!entireModal ? (
58
56
  <View style={styles.centeredView}>
59
57
  <View style={titleSectionStyle ? titleSectionStyle : styles.titleSection}>
60
- <TouchableOpacity style={{...styles.wrapperIcon, ...styleContainerCloseButton}} onPress={onClose}>
61
- <OIcon
62
- src={theme.images.general.close}
63
- width={16}
58
+ <TouchableOpacity style={{ ...styles.wrapperIcon, ...styleContainerCloseButton }} onPress={onClose}>
59
+ <AntDesignIcon
60
+ name='close'
61
+ size={26}
64
62
  style={isNotDecoration && (styleCloseButton || styles.cancelBtn)}
65
63
  />
66
64
  </TouchableOpacity>
@@ -73,9 +71,9 @@ const OModal = (props: Props): React.ReactElement => {
73
71
  {!customClose && (
74
72
  <View style={titleSectionStyle ? titleSectionStyle : styles.titleSection}>
75
73
  <TouchableOpacity style={styles.wrapperIcon} onPress={onClose}>
76
- <OIcon
77
- src={theme.images.general.close}
78
- width={16}
74
+ <AntDesignIcon
75
+ name='close'
76
+ size={26}
79
77
  style={styleCloseButton || styles.cancelBtn}
80
78
  />
81
79
  </TouchableOpacity>
@@ -93,7 +91,7 @@ const OModal = (props: Props): React.ReactElement => {
93
91
  animationType="slide"
94
92
  transparent={isTransparent}
95
93
  visible={open}
96
- onRequestClose={() => onClose && onClose()}
94
+ onRequestClose={() => onClose && onClose()}
97
95
  style={{ height: '100%', flex: 1, position: 'absolute', ...style, zIndex: 9999 }}
98
96
  >
99
97
  {isAvoidKeyBoardView ? (
@@ -125,8 +123,8 @@ const styles = StyleSheet.create({
125
123
  flex: 1,
126
124
  justifyContent: 'space-between',
127
125
  alignItems: 'flex-start',
128
- paddingLeft: 40,
129
- paddingRight: 40,
126
+ paddingLeft: 20,
127
+ paddingRight: 20,
130
128
  marginBottom: 40
131
129
  },
132
130
  cancelBtn: {
@@ -4,9 +4,11 @@ import styled, { css, useTheme } from 'styled-components/native';
4
4
  import { Platform, View } from 'react-native';
5
5
 
6
6
  const ContainerStyled = styled.ScrollView`
7
- flex: 1;
7
+ ${(props: any) => !props.disableFlex && css`
8
+ flex: 1
9
+ `}
8
10
  ${(props: any) => !props.noPadding && css`
9
- padding: ${Platform.OS === 'ios' ? '0px 40px' : '20px 40px'};
11
+ padding: ${Platform.OS === 'ios' ? '0px 20px' : '20px 20px'};
10
12
  `}
11
13
  background-color: ${(props: any) => props.theme.colors.backgroundPage};
12
14
  `;
@@ -17,7 +19,7 @@ export const Container = (props: any) => {
17
19
  return (
18
20
  <View
19
21
  style={{
20
- flex: 1,
22
+ flex: props.disableFlex ? undefined : 1,
21
23
  paddingTop: props.pt ?? insets.top,
22
24
  backgroundColor: theme.colors.backgroundPage
23
25
  }}