ordering-ui-react-native 0.15.34 → 0.15.35-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 (180) hide show
  1. package/package.json +4 -2
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/BusinessController/index.tsx +8 -2
  4. package/src/components/BusinessTypeFilter/index.tsx +4 -1
  5. package/src/components/BusinessesListing/index.tsx +1 -1
  6. package/src/components/Checkout/index.tsx +23 -3
  7. package/src/components/DriverTips/index.tsx +11 -6
  8. package/src/components/LanguageSelector/index.tsx +7 -2
  9. package/src/components/LoginForm/index.tsx +3 -1
  10. package/src/components/OrderDetails/index.tsx +2 -2
  11. package/src/components/PaymentOptions/index.tsx +9 -16
  12. package/src/components/PaymentOptionsWebView/index.tsx +123 -124
  13. package/src/components/SignupForm/index.tsx +3 -1
  14. package/src/components/SingleProductCard/index.tsx +16 -4
  15. package/src/components/StripeElementsForm/index.tsx +27 -48
  16. package/src/components/UpsellingProducts/index.tsx +1 -1
  17. package/src/components/UserProfileForm/index.tsx +63 -6
  18. package/src/components/UserProfileForm/styles.tsx +8 -0
  19. package/src/components/VerifyPhone/styles.tsx +1 -2
  20. package/src/components/shared/OModal.tsx +1 -1
  21. package/src/config.json +0 -2
  22. package/src/hooks/useCountdownTimer.tsx +26 -0
  23. package/src/navigators/CheckoutNavigator.tsx +6 -0
  24. package/src/navigators/HomeNavigator.tsx +12 -0
  25. package/src/pages/BusinessProductsList.tsx +1 -0
  26. package/src/pages/BusinessesListing.tsx +1 -1
  27. package/src/pages/Checkout.tsx +1 -1
  28. package/src/pages/MultiCheckout.tsx +31 -0
  29. package/src/pages/MultiOrdersDetails.tsx +27 -0
  30. package/src/pages/Sessions.tsx +22 -0
  31. package/src/types/index.tsx +5 -11
  32. package/src/utils/index.tsx +68 -1
  33. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +103 -15
  34. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -0
  35. package/themes/business/src/components/Chat/index.tsx +38 -86
  36. package/themes/business/src/components/DriverMap/index.tsx +6 -5
  37. package/themes/business/src/components/Home/index.tsx +128 -55
  38. package/themes/business/src/components/Home/styles.tsx +8 -1
  39. package/themes/business/src/components/LoginForm/index.tsx +89 -2
  40. package/themes/business/src/components/LoginForm/styles.tsx +6 -0
  41. package/themes/business/src/components/LogoutButton/index.tsx +1 -1
  42. package/themes/business/src/components/NewOrderNotification/index.tsx +79 -105
  43. package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
  44. package/themes/business/src/components/OrderDetails/Delivery.tsx +32 -15
  45. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +157 -89
  46. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +6 -0
  47. package/themes/business/src/components/OrderDetails/styles.tsx +7 -0
  48. package/themes/business/src/components/OrdersListManager/index.tsx +52 -49
  49. package/themes/business/src/components/OrdersOption/index.tsx +57 -50
  50. package/themes/business/src/components/PreviousOrders/index.tsx +50 -14
  51. package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
  52. package/themes/business/src/components/shared/OModal.tsx +1 -1
  53. package/themes/business/src/types/index.tsx +5 -1
  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/Cart/index.tsx +99 -25
  58. package/themes/kiosk/src/components/Cart/styles.tsx +6 -0
  59. package/themes/kiosk/src/components/Checkout/index.tsx +34 -22
  60. package/themes/kiosk/src/components/CustomerName/index.tsx +0 -6
  61. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  62. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  63. package/themes/kiosk/src/components/OrderDetails/index.tsx +165 -65
  64. package/themes/kiosk/src/components/OrderDetails/styles.tsx +5 -0
  65. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +10 -12
  66. package/themes/kiosk/src/components/PaymentOptions/index.tsx +1 -1
  67. package/themes/kiosk/src/components/ProductForm/index.tsx +2 -2
  68. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  69. package/themes/kiosk/src/types/index.d.ts +2 -0
  70. package/themes/original/index.tsx +188 -1
  71. package/themes/original/src/components/ActiveOrders/index.tsx +15 -132
  72. package/themes/original/src/components/ActiveOrders/styles.tsx +0 -54
  73. package/themes/original/src/components/AddressForm/index.tsx +15 -10
  74. package/themes/original/src/components/AddressList/index.tsx +56 -18
  75. package/themes/original/src/components/AppleLogin/index.tsx +117 -78
  76. package/themes/original/src/components/BusinessBasicInformation/index.tsx +96 -45
  77. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +28 -1
  78. package/themes/original/src/components/BusinessController/index.tsx +56 -16
  79. package/themes/original/src/components/BusinessController/styles.tsx +27 -0
  80. package/themes/original/src/components/BusinessFeaturedController/index.tsx +20 -1
  81. package/themes/original/src/components/BusinessFeaturedController/styles.tsx +23 -0
  82. package/themes/original/src/components/BusinessItemAccordion/index.tsx +4 -3
  83. package/themes/original/src/components/BusinessItemAccordion/styles.tsx +3 -1
  84. package/themes/original/src/components/BusinessListingSearch/index.tsx +125 -7
  85. package/themes/original/src/components/BusinessListingSearch/styles.tsx +14 -1
  86. package/themes/original/src/components/BusinessMenuList/index.tsx +11 -4
  87. package/themes/original/src/components/BusinessPreorder/index.tsx +142 -122
  88. package/themes/original/src/components/BusinessProductsCategories/index.tsx +9 -7
  89. package/themes/original/src/components/BusinessProductsList/CategoryDescription/index.tsx +44 -0
  90. package/themes/original/src/components/BusinessProductsList/index.tsx +139 -36
  91. package/themes/original/src/components/BusinessProductsList/styles.tsx +29 -2
  92. package/themes/original/src/components/BusinessProductsListing/index.tsx +125 -21
  93. package/themes/original/src/components/BusinessProductsListing/styles.tsx +22 -0
  94. package/themes/original/src/components/BusinessReviews/index.tsx +4 -25
  95. package/themes/original/src/components/BusinessTypeFilter/index.tsx +1 -2
  96. package/themes/original/src/components/BusinessesListing/index.tsx +85 -45
  97. package/themes/original/src/components/Cart/index.tsx +60 -43
  98. package/themes/original/src/components/CartContent/index.tsx +2 -2
  99. package/themes/original/src/components/Checkout/index.tsx +59 -48
  100. package/themes/original/src/components/DriverTips/index.tsx +17 -12
  101. package/themes/original/src/components/Favorite/index.tsx +91 -0
  102. package/themes/original/src/components/Favorite/styles.tsx +22 -0
  103. package/themes/original/src/components/FavoriteList/index.tsx +287 -0
  104. package/themes/original/src/components/FavoriteList/styles.tsx +5 -0
  105. package/themes/original/src/components/ForgotPasswordForm/index.tsx +84 -4
  106. package/themes/original/src/components/GPSButton/index.tsx +15 -8
  107. package/themes/original/src/components/GoogleMap/index.tsx +1 -0
  108. package/themes/original/src/components/Help/index.tsx +21 -4
  109. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +18 -1
  110. package/themes/original/src/components/Home/index.tsx +1 -1
  111. package/themes/original/src/components/LastOrders/index.tsx +12 -1
  112. package/themes/original/src/components/LoginForm/Otp/index.tsx +90 -0
  113. package/themes/original/src/components/LoginForm/Otp/styles.tsx +7 -0
  114. package/themes/original/src/components/LoginForm/index.tsx +394 -155
  115. package/themes/original/src/components/LoginForm/styles.tsx +7 -4
  116. package/themes/original/src/components/LogoutButton/index.tsx +7 -1
  117. package/themes/original/src/components/MessageListing/index.tsx +10 -1
  118. package/themes/original/src/components/Messages/index.tsx +6 -1
  119. package/themes/original/src/components/Messages/styles.tsx +1 -3
  120. package/themes/original/src/components/MomentOption/index.tsx +10 -1
  121. package/themes/original/src/components/MomentOption/styles.tsx +1 -1
  122. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +243 -0
  123. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/styles.tsx +46 -0
  124. package/themes/original/src/components/MultiCheckout/index.tsx +298 -0
  125. package/themes/original/src/components/MultiCheckout/styles.tsx +59 -0
  126. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +372 -0
  127. package/themes/original/src/components/MultiOrdersDetails/index.tsx +258 -0
  128. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +50 -0
  129. package/themes/original/src/components/OrderDetails/index.tsx +56 -33
  130. package/themes/original/src/components/OrderDetails/styles.tsx +1 -2
  131. package/themes/original/src/components/OrderProgress/index.tsx +3 -3
  132. package/themes/original/src/components/OrderProgress/styles.tsx +1 -0
  133. package/themes/original/src/components/OrderSummary/index.tsx +3 -3
  134. package/themes/original/src/components/OrderTypeSelector/index.tsx +4 -2
  135. package/themes/original/src/components/OrdersOption/index.tsx +57 -56
  136. package/themes/original/src/components/OrdersOption/styles.tsx +0 -6
  137. package/themes/original/src/components/PaymentOptionCash/index.tsx +2 -2
  138. package/themes/original/src/components/PaymentOptionWallet/index.tsx +22 -24
  139. package/themes/original/src/components/PaymentOptionWallet/styles.tsx +1 -1
  140. package/themes/original/src/components/PaymentOptions/index.tsx +9 -21
  141. package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
  142. package/themes/original/src/components/PreviousOrders/index.tsx +18 -145
  143. package/themes/original/src/components/ProductForm/index.tsx +76 -61
  144. package/themes/original/src/components/ProductForm/styles.tsx +0 -1
  145. package/themes/original/src/components/ProductItemAccordion/index.tsx +2 -2
  146. package/themes/original/src/components/ProductOptionSubOption/index.tsx +18 -12
  147. package/themes/original/src/components/Promotions/index.tsx +250 -0
  148. package/themes/original/src/components/Promotions/styles.tsx +60 -0
  149. package/themes/original/src/components/SearchBar/index.tsx +4 -1
  150. package/themes/original/src/components/Sessions/index.tsx +160 -0
  151. package/themes/original/src/components/Sessions/styles.tsx +15 -0
  152. package/themes/original/src/components/SignupForm/index.tsx +9 -4
  153. package/themes/original/src/components/SingleOrderCard/index.tsx +282 -0
  154. package/themes/original/src/components/SingleOrderCard/styles.tsx +54 -0
  155. package/themes/original/src/components/SingleProductCard/index.tsx +82 -30
  156. package/themes/original/src/components/SingleProductCard/styles.tsx +28 -1
  157. package/themes/original/src/components/StripeElementsForm/index.tsx +10 -2
  158. package/themes/original/src/components/StripeElementsForm/naked.tsx +2 -2
  159. package/themes/original/src/components/TaxInformation/index.tsx +10 -4
  160. package/themes/original/src/components/UpsellingProducts/index.tsx +86 -74
  161. package/themes/original/src/components/UserDetails/index.tsx +5 -96
  162. package/themes/original/src/components/UserFormDetails/index.tsx +34 -24
  163. package/themes/original/src/components/UserProfile/index.tsx +62 -8
  164. package/themes/original/src/components/UserProfileForm/index.tsx +20 -18
  165. package/themes/original/src/components/UserVerification/index.tsx +178 -192
  166. package/themes/original/src/components/VerifyPhone/index.tsx +10 -7
  167. package/themes/original/src/components/VerifyPhone/styles.tsx +2 -1
  168. package/themes/original/src/components/Wallets/index.tsx +76 -9
  169. package/themes/original/src/components/Wallets/styles.tsx +21 -0
  170. package/themes/original/src/components/shared/HeaderTitle.tsx +21 -0
  171. package/themes/original/src/components/shared/OModal.tsx +4 -2
  172. package/themes/original/src/components/shared/index.tsx +2 -0
  173. package/themes/original/src/config/constants.tsx +6 -6
  174. package/themes/original/src/types/index.tsx +107 -9
  175. package/themes/original/src/utils/index.tsx +28 -2
  176. package/themes/single-business/src/components/AddressList/index.tsx +1 -1
  177. package/themes/single-business/src/components/OrderTypeSelector/index.tsx +6 -6
  178. package/themes/single-business/src/components/UserProfile/index.tsx +1 -1
  179. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
  180. package/src/components/StripeMethodForm/index.tsx +0 -174
@@ -1,174 +0,0 @@
1
- import React, { useState, useEffect } from 'react'
2
- import { useLanguage, useConfig } from 'ordering-components/native'
3
- import { useGooglePay, ApplePayButton, useApplePay } from '@stripe/stripe-react-native'
4
- import { OButton, OText } from '../shared';
5
- import { Platform, View } from 'react-native';
6
- import { StripeMethodFormParams } from '../../types';
7
- import Spinner from 'react-native-loading-spinner-overlay';
8
- import { android_app_id } from '../../config.json'
9
- export const StripeMethodForm = (props: StripeMethodFormParams) => {
10
- const {
11
- cart,
12
- handleSource,
13
- onCancel,
14
- setErrors,
15
- paymethod,
16
- devMode
17
- } = props
18
- const { initGooglePay, createGooglePayPaymentMethod, loading } = useGooglePay();
19
- const { presentApplePay, isApplePaySupported } = useApplePay();
20
- const [initialized, setInitialized] = useState(false);
21
- const [loadingGooglePayment, setLoadingGooglePayment] = useState(false)
22
- const [, t] = useLanguage()
23
- const [configs] = useConfig()
24
-
25
- useEffect(() => {
26
- if (paymethod !== 'google_pay' || !initGooglePay) return
27
- if (Platform.OS === 'ios') {
28
- setErrors(t('GOOGLE_PAY_NOT_SUPPORTED', 'Google pay not supported'))
29
- return
30
- }
31
- const initialize = async () => {
32
- try {
33
- const { error } = await initGooglePay({
34
- testEnv: devMode,
35
- merchantName: android_app_id,
36
- countryCode: 'US',
37
- billingAddressConfig: {
38
- format: 'FULL',
39
- isPhoneNumberRequired: true,
40
- isRequired: false,
41
- },
42
- existingPaymentMethodRequired: false,
43
- isEmailRequired: true,
44
- });
45
-
46
- if (error) {
47
- setErrors(error.code + ' - ' + error.message);
48
- return;
49
- }
50
- setInitialized(true);
51
- } catch (err: any) {
52
- setErrors('Catch ' + err?.message)
53
- }
54
- }
55
- initialize();
56
- }, [initGooglePay]);
57
-
58
- useEffect(() => {
59
- if (paymethod !== 'apple_pay') return
60
- if (Platform.OS === 'android') {
61
- setErrors(t('APPLE_PAY_NOT_SUPPORTED', 'Apple pay not supported'))
62
- return
63
- }
64
- }, [])
65
-
66
- const createPaymentMethod = async () => {
67
- setLoadingGooglePayment(true)
68
- const { error, paymentMethod } = await createGooglePayPaymentMethod({
69
- amount: cart?.balance ?? cart?.total,
70
- currencyCode: configs?.stripe_currency?.value ?? 'USD',
71
- });
72
- if (error) {
73
- setErrors(error.code + ' - ' + error.message);
74
- setLoadingGooglePayment(false)
75
- return;
76
- } else if (paymentMethod) {
77
- handleSource({
78
- ...paymentMethod?.Card,
79
- id: paymentMethod.id,
80
- type: paymentMethod.type,
81
- source_id: paymentMethod?.id,
82
- card: {
83
- brand: paymentMethod.Card.brand,
84
- last4: paymentMethod.Card.last4
85
- }
86
- })
87
- onCancel()
88
- setLoadingGooglePayment(false)
89
- }
90
- };
91
-
92
- const pay = async () => {
93
- if (!isApplePaySupported) {
94
- setErrors(t('APPLE_PAY_NOT_SUPPORTED', 'Apple pay not supported'))
95
- return
96
- }
97
-
98
- const { error, paymentMethod } = await presentApplePay({
99
- cartItems: cart?.products?.map((product: any) => ({ label: product?.name, amount: product?.price?.toString?.() })),
100
- country: 'US',
101
- currency: configs?.stripe_currency?.value ?? 'USD',
102
- shippingMethods: [
103
- {
104
- amount: cart?.balance?.toString() ?? cart?.total?.toString?.(),
105
- identifier: 'DPS',
106
- label: 'Courier',
107
- detail: 'Delivery',
108
- type: 'final',
109
- },
110
- ],
111
-
112
- requiredShippingAddressFields: ['emailAddress', 'phoneNumber'],
113
- requiredBillingContactFields: ['phoneNumber', 'name'],
114
- });
115
- if (error) {
116
- setErrors(error.code + ' - ' + error.message);
117
- } else if (paymentMethod) {
118
- handleSource({
119
- ...paymentMethod?.Card,
120
- id: paymentMethod.id,
121
- type: paymentMethod.type,
122
- source_id: paymentMethod?.id,
123
- card: {
124
- brand: paymentMethod.Card.brand,
125
- last4: paymentMethod.Card.last4
126
- }
127
- })
128
- onCancel()
129
- }
130
- }
131
-
132
- return (
133
- <>
134
- {paymethod === 'google_pay' ? (
135
- <View>
136
- <OButton
137
- textStyle={{
138
- color: '#fff'
139
- }}
140
- imgRightSrc={null}
141
- onClick={createPaymentMethod}
142
- isDisabled={loading || !initialized}
143
- text={t('PAY_WITH_GOOGLE_PAY', 'Pay with Google Pay')}
144
- isLoading={loading || !initialized}
145
- style={{ marginTop: 20 }}
146
- />
147
- </View>
148
- ) : (
149
- <View>
150
- {isApplePaySupported ? (
151
- <>
152
- <OText>{t('APPLE_PAY_PAYMENT', 'Apple pay payment')}</OText>
153
- <ApplePayButton
154
- onPress={pay}
155
- type="plain"
156
- buttonStyle="black"
157
- borderRadius={4}
158
- style={{
159
- width: '100%',
160
- height: 50,
161
- }}
162
- />
163
- </>
164
- ) : (
165
- <OText>{t('APPLE_PAY_NOT_SUPPORTED', 'Apple pay not supported')}</OText>
166
- )}
167
- </View>
168
- )}
169
- <Spinner
170
- visible={loadingGooglePayment}
171
- />
172
- </>
173
- )
174
- }