ordering-ui-react-native 0.17.54 → 0.17.55-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 (221) hide show
  1. package/package.json +8 -7
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/BusinessesListing/index.tsx +1 -1
  4. package/src/components/OrderCreating/index.tsx +1 -21
  5. package/src/components/PaymentOptionsWebView/index.tsx +29 -8
  6. package/src/components/PhoneInputNumber/index.tsx +6 -2
  7. package/src/components/StripeMethodForm/index.tsx +136 -102
  8. package/src/components/VerifyPhone/styles.tsx +1 -2
  9. package/src/components/shared/OToast.tsx +4 -4
  10. package/src/types/index.tsx +5 -0
  11. package/src/utils/index.tsx +5 -0
  12. package/themes/business/index.tsx +2 -0
  13. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +265 -240
  14. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
  15. package/themes/business/src/components/BusinessController/index.tsx +0 -1
  16. package/themes/business/src/components/Chat/index.tsx +125 -113
  17. package/themes/business/src/components/DriverMap/index.tsx +17 -6
  18. package/themes/business/src/components/DriverSchedule/index.tsx +29 -2
  19. package/themes/business/src/components/GoogleMap/index.tsx +58 -57
  20. package/themes/business/src/components/LoginForm/Otp/index.tsx +120 -0
  21. package/themes/business/src/components/LoginForm/Otp/styles.tsx +7 -0
  22. package/themes/business/src/components/LoginForm/index.tsx +240 -82
  23. package/themes/business/src/components/LoginForm/styles.tsx +10 -0
  24. package/themes/business/src/components/MapView/index.tsx +10 -10
  25. package/themes/business/src/components/NewOrderNotification/index.tsx +35 -21
  26. package/themes/business/src/components/NotFoundSource/index.tsx +2 -2
  27. package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
  28. package/themes/business/src/components/OrderDetails/Delivery.tsx +191 -6
  29. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +93 -50
  30. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +64 -63
  31. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +195 -0
  32. package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
  33. package/themes/business/src/components/OrderMessage/index.tsx +19 -18
  34. package/themes/business/src/components/OrderSummary/index.tsx +113 -121
  35. package/themes/business/src/components/OrdersOption/index.tsx +32 -75
  36. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +249 -0
  37. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
  38. package/themes/business/src/components/PreviousOrders/index.tsx +445 -243
  39. package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
  40. package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
  41. package/themes/business/src/components/ReviewCustomer/index.tsx +30 -15
  42. package/themes/business/src/components/StoresList/index.tsx +3 -4
  43. package/themes/business/src/components/UserProfileForm/index.tsx +11 -13
  44. package/themes/business/src/components/shared/OLink.tsx +33 -13
  45. package/themes/business/src/components/shared/OModal.tsx +16 -9
  46. package/themes/business/src/components/shared/OText.tsx +8 -2
  47. package/themes/business/src/types/index.tsx +32 -2
  48. package/themes/business/src/utils/index.tsx +44 -1
  49. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  50. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  51. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  52. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  53. package/themes/kiosk/src/components/Intro/index.tsx +16 -1
  54. package/themes/kiosk/src/components/LoginForm/Otp/index.tsx +92 -0
  55. package/themes/kiosk/src/components/LoginForm/Otp/styles.tsx +7 -0
  56. package/themes/kiosk/src/components/LoginForm/index.tsx +480 -156
  57. package/themes/kiosk/src/components/LoginForm/styles.tsx +14 -1
  58. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  59. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  60. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  61. package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +3 -2
  62. package/themes/kiosk/src/components/PhoneInputNumber/styles.tsx +1 -3
  63. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  64. package/themes/kiosk/src/components/shared/OModal.tsx +14 -11
  65. package/themes/kiosk/src/layouts/Container.tsx +7 -1
  66. package/themes/kiosk/src/types/index.d.ts +13 -0
  67. package/themes/kiosk/src/utils/index.tsx +15 -0
  68. package/themes/original/index.tsx +4 -0
  69. package/themes/original/src/components/AddressDetails/index.tsx +28 -10
  70. package/themes/original/src/components/AddressForm/index.tsx +68 -40
  71. package/themes/original/src/components/AddressList/index.tsx +27 -22
  72. package/themes/original/src/components/AddressList/styles.tsx +4 -2
  73. package/themes/original/src/components/AnalyticsSegment/index.tsx +193 -10
  74. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  75. package/themes/original/src/components/AppleLogin/styles.tsx +3 -1
  76. package/themes/original/src/components/BusinessBasicInformation/index.tsx +153 -96
  77. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +10 -12
  78. package/themes/original/src/components/BusinessController/index.tsx +122 -68
  79. package/themes/original/src/components/BusinessController/styles.tsx +23 -4
  80. package/themes/original/src/components/BusinessFeaturedController/index.tsx +21 -54
  81. package/themes/original/src/components/BusinessFeaturedController/styles.tsx +8 -0
  82. package/themes/original/src/components/BusinessInformation/index.tsx +110 -108
  83. package/themes/original/src/components/BusinessItemAccordion/index.tsx +15 -20
  84. package/themes/original/src/components/BusinessListingSearch/index.tsx +352 -326
  85. package/themes/original/src/components/BusinessListingSearch/styles.tsx +0 -18
  86. package/themes/original/src/components/BusinessPreorder/index.tsx +103 -19
  87. package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -2
  88. package/themes/original/src/components/BusinessProductsList/index.tsx +25 -15
  89. package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
  90. package/themes/original/src/components/BusinessProductsListing/UpsellingRedirect.tsx +1 -1
  91. package/themes/original/src/components/BusinessProductsListing/index.tsx +683 -535
  92. package/themes/original/src/components/BusinessProductsListing/styles.tsx +2 -2
  93. package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
  94. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  95. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +96 -91
  96. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -4
  97. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  98. package/themes/original/src/components/Cart/index.tsx +77 -50
  99. package/themes/original/src/components/CartContent/index.tsx +115 -19
  100. package/themes/original/src/components/CartContent/styles.tsx +17 -7
  101. package/themes/original/src/components/Checkout/index.tsx +359 -171
  102. package/themes/original/src/components/Checkout/styles.tsx +4 -2
  103. package/themes/original/src/components/CitiesControl/index.tsx +89 -0
  104. package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
  105. package/themes/original/src/components/CouponControl/index.tsx +10 -3
  106. package/themes/original/src/components/DriverTips/index.tsx +52 -34
  107. package/themes/original/src/components/FacebookLogin/styles.tsx +3 -1
  108. package/themes/original/src/components/Favorite/index.tsx +8 -9
  109. package/themes/original/src/components/Favorite/styles.tsx +1 -1
  110. package/themes/original/src/components/FavoriteList/index.tsx +51 -80
  111. package/themes/original/src/components/FloatingButton/index.tsx +1 -2
  112. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  113. package/themes/original/src/components/GPSButton/index.tsx +6 -4
  114. package/themes/original/src/components/GPSButton/styles.ts +3 -3
  115. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +96 -0
  116. package/themes/original/src/components/GiftCard/GiftCardUI/styles.tsx +5 -0
  117. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +100 -0
  118. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +8 -0
  119. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +191 -0
  120. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +8 -0
  121. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +165 -0
  122. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +9 -0
  123. package/themes/original/src/components/GoogleLogin/styles.tsx +1 -1
  124. package/themes/original/src/components/GoogleMap/index.tsx +15 -4
  125. package/themes/original/src/components/Help/index.tsx +8 -8
  126. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +10 -31
  127. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +5 -3
  128. package/themes/original/src/components/HelpGuide/index.tsx +6 -6
  129. package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
  130. package/themes/original/src/components/HelpOrder/index.tsx +6 -15
  131. package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
  132. package/themes/original/src/components/Home/index.tsx +13 -4
  133. package/themes/original/src/components/LastOrder/index.tsx +1 -34
  134. package/themes/original/src/components/LoginForm/Otp/index.tsx +55 -13
  135. package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
  136. package/themes/original/src/components/LoginForm/index.tsx +64 -26
  137. package/themes/original/src/components/LottieAnimation/index.tsx +89 -55
  138. package/themes/original/src/components/MessageListing/index.tsx +16 -42
  139. package/themes/original/src/components/Messages/index.tsx +32 -10
  140. package/themes/original/src/components/MomentOption/index.tsx +194 -89
  141. package/themes/original/src/components/MultiCart/index.tsx +50 -0
  142. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +151 -49
  143. package/themes/original/src/components/MultiCheckout/index.tsx +308 -88
  144. package/themes/original/src/components/MultiCheckout/styles.tsx +3 -1
  145. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
  146. package/themes/original/src/components/MultiOrdersDetails/index.tsx +68 -21
  147. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
  148. package/themes/original/src/components/MyOrders/index.tsx +77 -52
  149. package/themes/original/src/components/NavBar/index.tsx +18 -18
  150. package/themes/original/src/components/NotFoundSource/index.tsx +14 -10
  151. package/themes/original/src/components/Notifications/index.tsx +46 -50
  152. package/themes/original/src/components/Notifications/styles.tsx +6 -3
  153. package/themes/original/src/components/OrderDetails/OrderEta.tsx +76 -0
  154. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +15 -3
  155. package/themes/original/src/components/OrderDetails/index.tsx +190 -358
  156. package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
  157. package/themes/original/src/components/OrderItAgain/index.tsx +3 -1
  158. package/themes/original/src/components/OrderProgress/index.tsx +33 -59
  159. package/themes/original/src/components/OrderSummary/index.tsx +85 -57
  160. package/themes/original/src/components/OrderTypeSelector/index.tsx +1 -1
  161. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +24 -19
  162. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +14 -14
  163. package/themes/original/src/components/OrdersOption/index.tsx +76 -66
  164. package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
  165. package/themes/original/src/components/PageBanner/index.tsx +106 -31
  166. package/themes/original/src/components/PageBanner/styles.tsx +4 -4
  167. package/themes/original/src/components/PaymentOptionCard/index.tsx +180 -0
  168. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
  169. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  170. package/themes/original/src/components/PaymentOptions/index.tsx +64 -7
  171. package/themes/original/src/components/PhoneInputNumber/index.tsx +3 -3
  172. package/themes/original/src/components/PlaceSpot/index.tsx +12 -6
  173. package/themes/original/src/components/ProductForm/index.tsx +109 -33
  174. package/themes/original/src/components/ProductForm/styles.tsx +5 -7
  175. package/themes/original/src/components/ProductItemAccordion/index.tsx +22 -19
  176. package/themes/original/src/components/ProductOptionSubOption/index.tsx +24 -14
  177. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +3 -4
  178. package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
  179. package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -50
  180. package/themes/original/src/components/ProfessionalProfile/index.tsx +36 -7
  181. package/themes/original/src/components/Promotions/index.tsx +234 -220
  182. package/themes/original/src/components/Promotions/styles.tsx +10 -3
  183. package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
  184. package/themes/original/src/components/ReviewOrder/index.tsx +26 -9
  185. package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
  186. package/themes/original/src/components/ReviewProducts/index.tsx +23 -11
  187. package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
  188. package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
  189. package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
  190. package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
  191. package/themes/original/src/components/ServiceForm/index.tsx +66 -17
  192. package/themes/original/src/components/Sessions/index.tsx +11 -8
  193. package/themes/original/src/components/Sessions/styles.tsx +5 -0
  194. package/themes/original/src/components/SignupForm/index.tsx +43 -20
  195. package/themes/original/src/components/SingleOrderCard/index.tsx +130 -52
  196. package/themes/original/src/components/SingleOrderCard/styles.tsx +11 -2
  197. package/themes/original/src/components/SingleProductCard/index.tsx +71 -34
  198. package/themes/original/src/components/SingleProductCard/styles.tsx +21 -4
  199. package/themes/original/src/components/SingleProductReview/styles.tsx +1 -1
  200. package/themes/original/src/components/StripeCardsList/index.tsx +13 -3
  201. package/themes/original/src/components/StripeElementsForm/index.tsx +48 -34
  202. package/themes/original/src/components/UpsellingProducts/index.tsx +238 -224
  203. package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
  204. package/themes/original/src/components/UserDetails/index.tsx +8 -4
  205. package/themes/original/src/components/UserFormDetails/index.tsx +76 -7
  206. package/themes/original/src/components/UserFormDetails/styles.tsx +1 -1
  207. package/themes/original/src/components/UserProfile/index.tsx +88 -79
  208. package/themes/original/src/components/UserProfileForm/index.tsx +27 -29
  209. package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
  210. package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
  211. package/themes/original/src/components/WalletTransactions/index.tsx +3 -3
  212. package/themes/original/src/components/Wallets/index.tsx +67 -24
  213. package/themes/original/src/components/Wallets/styles.tsx +3 -4
  214. package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
  215. package/themes/original/src/components/shared/OButton.tsx +6 -2
  216. package/themes/original/src/components/shared/OInput.tsx +6 -1
  217. package/themes/original/src/components/shared/OModal.tsx +3 -3
  218. package/themes/original/src/layouts/Container.tsx +1 -1
  219. package/themes/original/src/types/index.tsx +40 -11
  220. package/themes/original/src/utils/index.tsx +273 -1
  221. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -0,0 +1,92 @@
1
+ import React, { useEffect } from 'react'
2
+ import { formatSeconds } from '../../../utils'
3
+ import { StyleSheet, TouchableOpacity } from 'react-native';
4
+ import { useCountdownTimer } from '../../../../../../src/hooks/useCountdownTimer';
5
+ import { useLanguage } from 'ordering-components/native';
6
+ import { OTPContainer } from './styles';
7
+ import { OText, OButton } from '../../shared';
8
+ import OTPInputView from '@twotalltotems/react-native-otp-input'
9
+ import { useTheme } from 'styled-components/native';
10
+ import { otpParams } from '../../../types'
11
+
12
+ export const Otp = (props: otpParams) => {
13
+ const {
14
+ willVerifyOtpState,
15
+ setWillVerifyOtpState,
16
+ onSubmit,
17
+ handleLoginOtp,
18
+ setAlertState,
19
+ pinCount
20
+ } = props
21
+
22
+ const theme = useTheme();
23
+ const [, t] = useLanguage();
24
+ const [otpLeftTime, _, resetOtpLeftTime]: any = useCountdownTimer(
25
+ 600, willVerifyOtpState)
26
+
27
+
28
+ const handleOnSubmit = () => {
29
+ setAlertState({
30
+ open: true,
31
+ title: t('CODE_SENT', 'The code has been sent'),
32
+ })
33
+ resetOtpLeftTime()
34
+ onSubmit()
35
+ }
36
+
37
+ useEffect(() => {
38
+ if (otpLeftTime === 0) {
39
+ setAlertState({
40
+ open: true,
41
+ title: t('TIME_IS_UP', 'Time is up'),
42
+ content: t('PLEASE_RESEND_CODE', 'Please resend code again')
43
+ })
44
+ }
45
+ }, [otpLeftTime])
46
+
47
+ const loginStyle = StyleSheet.create({
48
+ underlineStyleBase: {
49
+ width: 45,
50
+ height: 60,
51
+ borderWidth: 1,
52
+ fontSize: 16
53
+ },
54
+ underlineStyleHighLighted: {
55
+ borderColor: theme.colors.primary,
56
+ color: theme.colors.primary,
57
+ fontSize: 16
58
+ },
59
+ });
60
+
61
+ return (
62
+ <>
63
+ <OTPContainer>
64
+ <OText size={24}>
65
+ {formatSeconds(otpLeftTime)}
66
+ </OText>
67
+ <OTPInputView
68
+ style={{ width: '100%', height: 150 }}
69
+ pinCount={pinCount || 6}
70
+ codeInputFieldStyle={loginStyle.underlineStyleBase}
71
+ codeInputHighlightStyle={loginStyle.underlineStyleHighLighted}
72
+ onCodeFilled={(code: string) => handleLoginOtp(code)}
73
+ selectionColor={theme.colors.primary}
74
+ editable
75
+ />
76
+ <TouchableOpacity onPress={() => handleOnSubmit()} disabled={otpLeftTime > 520}>
77
+ <OText size={16} mBottom={30} color={otpLeftTime > 520 ? theme.colors.disabled : theme.colors.primary}>
78
+ {t('RESEND_CODE', 'Resend code')}
79
+ </OText>
80
+ </TouchableOpacity>
81
+ <OButton
82
+ onClick={() => setWillVerifyOtpState(false)}
83
+ bgColor={theme.colors.white}
84
+ borderColor={theme.colors.primary}
85
+ textStyle={{ color: theme.colors.primary }}
86
+ style={{ borderRadius: 8, width: '100%' }}
87
+ text={t('CANCEL', 'Cancel')}
88
+ />
89
+ </OTPContainer>
90
+ </>
91
+ )
92
+ }
@@ -0,0 +1,7 @@
1
+ import styled from 'styled-components/native';
2
+
3
+ export const OTPContainer = styled.View`
4
+ padding: 20px;
5
+ align-items: center;
6
+ flex: 1
7
+ `