ordering-ui-react-native 0.14.85 → 0.14.87-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 (142) hide show
  1. package/package.json +6 -3
  2. package/src/DeliveryApp.tsx +34 -2
  3. package/src/assets/images/no-network.png +0 -0
  4. package/src/components/BusinessTypeFilter/index.tsx +9 -2
  5. package/src/components/BusinessTypeFilter/styles.tsx +1 -1
  6. package/src/components/BusinessesListing/index.tsx +1 -1
  7. package/src/components/Cart/index.tsx +1 -1
  8. package/src/components/Checkout/index.tsx +0 -1
  9. package/src/components/Home/index.tsx +3 -5
  10. package/src/components/LanguageSelector/index.tsx +65 -97
  11. package/src/components/LanguageSelector/styles.tsx +4 -17
  12. package/src/components/Messages/index.tsx +38 -30
  13. package/src/components/MomentOption/index.tsx +3 -1
  14. package/src/components/OrderDetails/index.tsx +26 -5
  15. package/src/components/PaymentOptions/index.tsx +7 -16
  16. package/src/components/PaymentOptionsWebView/index.tsx +123 -124
  17. package/src/components/ProductForm/index.tsx +1 -1
  18. package/src/components/ProductForm/styles.tsx +1 -0
  19. package/src/components/StripeElementsForm/index.tsx +27 -48
  20. package/src/components/UserProfileForm/index.tsx +35 -1
  21. package/src/components/VerifyPhone/styles.tsx +1 -2
  22. package/src/config.json +0 -2
  23. package/src/pages/Checkout.tsx +1 -1
  24. package/src/providers/AlertProvider.tsx +4 -1
  25. package/src/theme.json +2 -1
  26. package/src/types/index.tsx +2 -9
  27. package/src/utils/index.tsx +196 -1
  28. package/themes/business/index.tsx +4 -0
  29. package/themes/business/src/components/Chat/index.tsx +32 -31
  30. package/themes/business/src/components/NetworkError/index.tsx +61 -0
  31. package/themes/business/src/components/NetworkError/styles.tsx +11 -0
  32. package/themes/business/src/components/OrderDetails/Business.tsx +1 -0
  33. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +85 -17
  34. package/themes/business/src/components/OrdersListManager/index.tsx +871 -0
  35. package/themes/business/src/components/OrdersListManager/styles.tsx +123 -0
  36. package/themes/business/src/components/OrdersListManager/utils.tsx +216 -0
  37. package/themes/business/src/components/OrdersOption/index.tsx +351 -59
  38. package/themes/business/src/components/OrdersOption/styles.tsx +95 -7
  39. package/themes/business/src/components/PreviousOrders/index.tsx +65 -46
  40. package/themes/business/src/components/PreviousOrders/styles.tsx +5 -10
  41. package/themes/business/src/components/ReviewCustomer/index.tsx +11 -8
  42. package/themes/business/src/types/index.tsx +4 -0
  43. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  44. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  45. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  46. package/themes/kiosk/index.tsx +2 -0
  47. package/themes/kiosk/src/components/BusinessController/index.tsx +27 -6
  48. package/themes/kiosk/src/components/BusinessController/styles.tsx +1 -1
  49. package/themes/kiosk/src/components/BusinessProductsListing/index.tsx +51 -24
  50. package/themes/kiosk/src/components/Cart/index.tsx +1 -1
  51. package/themes/kiosk/src/components/CartBottomSheet/index.tsx +1 -1
  52. package/themes/kiosk/src/components/CartBottomSheet/styles.tsx +1 -1
  53. package/themes/kiosk/src/components/CartContent/index.tsx +13 -3
  54. package/themes/kiosk/src/components/CartItem/index.tsx +20 -8
  55. package/themes/kiosk/src/components/CategoriesMenu/index.tsx +7 -5
  56. package/themes/kiosk/src/components/CustomerName/index.tsx +89 -88
  57. package/themes/kiosk/src/components/Intro/index.tsx +13 -13
  58. package/themes/kiosk/src/components/LanguageSelector/index.tsx +12 -8
  59. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  60. package/themes/kiosk/src/components/NetworkError/index.tsx +60 -0
  61. package/themes/kiosk/src/components/NetworkError/styles.tsx +11 -0
  62. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  63. package/themes/kiosk/src/components/OrderDetails/index.tsx +2 -2
  64. package/themes/kiosk/src/components/OrderSummary/index.tsx +1 -1
  65. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +10 -12
  66. package/themes/kiosk/src/components/ProductForm/index.tsx +172 -124
  67. package/themes/kiosk/src/components/ProductForm/styles.tsx +1 -1
  68. package/themes/kiosk/src/components/ProductOption/index.tsx +1 -0
  69. package/themes/kiosk/src/components/ProductOption/styles.tsx +1 -0
  70. package/themes/kiosk/src/components/UpsellingProducts/index.tsx +48 -34
  71. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  72. package/themes/kiosk/src/components/shared/OCard.tsx +112 -78
  73. package/themes/kiosk/src/types/index.d.ts +4 -0
  74. package/themes/original/index.tsx +28 -6
  75. package/themes/original/src/components/AddressForm/index.tsx +15 -10
  76. package/themes/original/src/components/AddressList/index.tsx +27 -1
  77. package/themes/original/src/components/AnalyticsSegment/index.tsx +127 -0
  78. package/themes/original/src/components/BusinessBasicInformation/index.tsx +11 -7
  79. package/themes/original/src/components/BusinessController/index.tsx +3 -3
  80. package/themes/original/src/components/BusinessMenuList/index.tsx +4 -2
  81. package/themes/original/src/components/BusinessPreorder/index.tsx +142 -121
  82. package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -1
  83. package/themes/original/src/components/BusinessProductsList/index.tsx +50 -6
  84. package/themes/original/src/components/BusinessProductsListing/index.tsx +13 -10
  85. package/themes/original/src/components/BusinessReviews/index.tsx +4 -3
  86. package/themes/original/src/components/BusinessesListing/index.tsx +23 -22
  87. package/themes/original/src/components/Cart/index.tsx +43 -10
  88. package/themes/original/src/components/CartContent/index.tsx +2 -2
  89. package/themes/original/src/components/Checkout/index.tsx +54 -17
  90. package/themes/original/src/components/Checkout/styles.tsx +7 -0
  91. package/themes/original/src/components/CouponControl/index.tsx +1 -0
  92. package/themes/original/src/components/DriverTips/index.tsx +1 -1
  93. package/themes/original/src/components/ForgotPasswordForm/index.tsx +8 -12
  94. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +9 -2
  95. package/themes/original/src/components/LoginForm/index.tsx +83 -68
  96. package/themes/original/src/components/Messages/index.tsx +24 -21
  97. package/themes/original/src/components/Messages/styles.tsx +1 -3
  98. package/themes/original/src/components/MomentOption/index.tsx +127 -152
  99. package/themes/original/src/components/MomentOption/styles.tsx +42 -18
  100. package/themes/original/src/components/NetworkError/index.tsx +61 -0
  101. package/themes/original/src/components/NetworkError/styles.tsx +11 -0
  102. package/themes/original/src/components/OrderDetails/index.tsx +103 -124
  103. package/themes/original/src/components/OrderDetails/styles.tsx +3 -1
  104. package/themes/original/src/components/OrderProgress/index.tsx +2 -3
  105. package/themes/original/src/components/OrderSummary/index.tsx +34 -1
  106. package/themes/original/src/components/OrdersOption/index.tsx +16 -40
  107. package/themes/original/src/components/OrdersOption/styles.tsx +0 -5
  108. package/themes/original/src/components/PaymentOptionWallet/index.tsx +1 -1
  109. package/themes/original/src/components/PaymentOptions/index.tsx +20 -23
  110. package/themes/original/src/components/PhoneInputNumber/index.tsx +15 -8
  111. package/themes/original/src/components/PlaceSpot/index.tsx +114 -0
  112. package/themes/original/src/components/PlaceSpot/styles.tsx +11 -0
  113. package/themes/original/src/components/PreviousOrders/index.tsx +4 -0
  114. package/themes/original/src/components/ProductForm/index.tsx +164 -114
  115. package/themes/original/src/components/ProductForm/styles.tsx +5 -3
  116. package/themes/original/src/components/ProductOptionSubOption/index.tsx +81 -74
  117. package/themes/original/src/components/ReviewDriver/index.tsx +315 -0
  118. package/themes/original/src/components/ReviewDriver/styles.tsx +38 -0
  119. package/themes/original/src/components/ReviewOrder/index.tsx +307 -186
  120. package/themes/original/src/components/ReviewOrder/styles.tsx +24 -13
  121. package/themes/original/src/components/ReviewProducts/index.tsx +116 -0
  122. package/themes/original/src/components/ReviewProducts/styles.tsx +16 -0
  123. package/themes/original/src/components/SignupForm/index.tsx +173 -154
  124. package/themes/original/src/components/SingleProductCard/index.tsx +6 -13
  125. package/themes/original/src/components/SingleProductCard/styles.tsx +1 -1
  126. package/themes/original/src/components/SingleProductReview/index.tsx +166 -0
  127. package/themes/original/src/components/SingleProductReview/styles.tsx +27 -0
  128. package/themes/original/src/components/StripeElementsForm/index.tsx +55 -72
  129. package/themes/original/src/components/UpsellingProducts/index.tsx +6 -6
  130. package/themes/original/src/components/UserDetails/index.tsx +4 -95
  131. package/themes/original/src/components/UserFormDetails/index.tsx +2 -14
  132. package/themes/original/src/components/UserProfile/index.tsx +16 -9
  133. package/themes/original/src/components/UserProfileForm/index.tsx +16 -8
  134. package/themes/original/src/components/VerifyPhone/index.tsx +10 -7
  135. package/themes/original/src/components/VerifyPhone/styles.tsx +2 -1
  136. package/themes/original/src/components/shared/HeaderTitle.tsx +20 -0
  137. package/themes/original/src/components/shared/index.tsx +2 -0
  138. package/themes/original/src/layouts/FloatingBottomContainer.tsx +26 -0
  139. package/themes/original/src/types/index.tsx +47 -10
  140. package/themes/single-business/src/components/OrderTypeSelector/index.tsx +5 -5
  141. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
  142. package/src/components/StripeMethodForm/index.tsx +0 -163
@@ -31,12 +31,6 @@ export interface ProfileParams {
31
31
  validationFields?: any;
32
32
  showField?: any;
33
33
  isRequiredField?: any;
34
- handleSendVerifyCode?: any;
35
- handleCheckPhoneCode?: any;
36
- checkPhoneCodeState?: any;
37
- verifyPhoneState?: any;
38
- setCheckPhoneCodeState?: any;
39
- isVerifiedPhone?: any;
40
34
  }
41
35
 
42
36
  export interface AddressListParams {
@@ -115,6 +109,7 @@ export interface PhoneInputParams {
115
109
  noDropIcon?: boolean;
116
110
  flagStyle?: any;
117
111
  isDisabled?: any;
112
+ isStartValidation?: any;
118
113
  }
119
114
 
120
115
  export interface LanguageSelectorParams {
@@ -143,6 +138,8 @@ export interface HighestRatedBusinessesParams {
143
138
  businessesList: { businesses: Array<any>, loading: boolean, error: null | string };
144
139
  onBusinessClick?: void;
145
140
  navigation? :any;
141
+ isLoading?: boolean;
142
+ getBusinesses: (newFetch : boolean) => void
146
143
  }
147
144
  export interface BusinessTypeFilterParams {
148
145
  businessTypes?: Array<any>;
@@ -189,6 +186,7 @@ export interface BusinessBasicInformationParams {
189
186
  isBusinessInfoShow?: boolean;
190
187
  header?: any;
191
188
  logo?: any;
189
+ isPreOrder?: boolean;
192
190
  }
193
191
  export interface BusinessProductsCategoriesParams {
194
192
  categories: Array<any>;
@@ -210,7 +208,7 @@ export interface BusinessProductsListParams {
210
208
  errors?: any;
211
209
  businessId?: number;
212
210
  category?: any;
213
- categories: Array<any>;
211
+ categories?: Array<any>;
214
212
  categoryState?: any;
215
213
  onProductClick?: any;
216
214
  handleSearchRedirect?: () => {};
@@ -329,13 +327,40 @@ export interface ProductItemAccordionParams {
329
327
  isFromCheckout?: any
330
328
  }
331
329
  export interface ReviewOrderParams {
332
- order?: { orderId: number, businessId: number, logo: string },
330
+ order?: { id: number, businessId: number, logo: string, driver: any, products: Array<any>, review: any, user_review: any },
333
331
  stars?: any,
334
332
  handleChangeInput?: any,
335
333
  handleChangeRating?: any,
336
334
  handleSendReview?: any,
337
335
  formState?: any,
338
- navigation?: any
336
+ navigation?: any,
337
+ setIsReviewed?: (isReviewed: boolean) => {},
338
+ handleReviewState?: any,
339
+ setStars?: any,
340
+ onNavigationRedirect?: any
341
+ }
342
+ export interface ReviewProductParams {
343
+ navigation?: any,
344
+ onNavigationRedirect?: any,
345
+ order?: { orderId: number, businessId: number, logo: string, driver: any, products: Array<any>, review: any, user_review: any },
346
+ formState?: any,
347
+ handleChangeFormState?: any,
348
+ handleSendProductReview?: any
349
+ }
350
+ export interface SingleProductReviewParams {
351
+ product: any,
352
+ formState?: any,
353
+ handleChangeFormState?: any,
354
+ }
355
+ export interface ReviewDriverParams {
356
+ navigation?: any,
357
+ onNavigationRedirect?: any,
358
+ order?: { orderId: number, businessId: number, logo: string, driver: any, products: Array<any>, review: any, user_review: any },
359
+ formState?: any,
360
+ setIsDriverReviewed?: (isReviewed: boolean) => {},
361
+ dirverReviews?: any,
362
+ setDriverReviews?: any,
363
+ handleSendDriverReview?: any
339
364
  }
340
365
  export interface MessagesParams {
341
366
  type?: string,
@@ -349,7 +374,7 @@ export interface MessagesParams {
349
374
  handleSend?: () => {},
350
375
  setImage?: (image: string | null) => {},
351
376
  setMessage?: (comment: string) => {},
352
- setMessages?: () => {},
377
+ setMessages?: (image: any | null) => {},
353
378
  readMessages?: () => {},
354
379
  onClose?: () => void,
355
380
  isMeesageListing?: boolean,
@@ -493,3 +518,15 @@ export interface MessageListingParams {
493
518
  navigation: any;
494
519
  franchiseId?: any;
495
520
  }
521
+ export interface NoNetworkParams {
522
+ image?: any,
523
+ }
524
+
525
+ export interface PlaceSpotParams {
526
+ isOpenPlaceSpot?: boolean,
527
+ cart?: any ,
528
+ placesState?: any,
529
+ handleChangePlace?: any,
530
+ getPlacesList?: any,
531
+ setOpenPlaceModal?: any
532
+ }
@@ -97,27 +97,27 @@ export const OrderTypeSelector = (props: any) => {
97
97
  {
98
98
  value: 1,
99
99
  content: t('DELIVERY', 'Delivery'),
100
- description: t('ORDERTYPE_DESCRIPTION_DELIVERY', 'Lorem ipsum dolor sit amet, consectetur.')
100
+ description: t('ORDERTYPE_DESCRIPTION_DELIVERY', 'Delivery description')
101
101
  },
102
102
  {
103
103
  value: 2,
104
104
  content: t('PICKUP', 'Pickup'),
105
- description: t('ORDERTYPE_DESCRIPTION_PICKUP', 'Lorem ipsum dolor sit amet, consectetur.')
105
+ description: t('ORDERTYPE_DESCRIPTION_PICKUP', 'Pickup description')
106
106
  },
107
107
  {
108
108
  value: 3,
109
109
  content: t('EAT_IN', 'Eat in'),
110
- description: t('ORDERTYPE_DESCRIPTION_EATIN', 'Lorem ipsum dolor sit amet, consectetur.')
110
+ description: t('ORDERTYPE_DESCRIPTION_EATIN', 'Eat in description')
111
111
  },
112
112
  {
113
113
  value: 4,
114
114
  content: t('CURBSIDE', 'Curbside'),
115
- description: t('ORDERTYPE_DESCRIPTION_CURBSIDE', 'Lorem ipsum dolor sit amet, consectetur.')
115
+ description: t('ORDERTYPE_DESCRIPTION_CURBSIDE', 'Curbside description')
116
116
  },
117
117
  {
118
118
  value: 5,
119
119
  content: t('DRIVE_THRU', 'Drive thru'),
120
- description: t('ORDERTYPE_DESCRIPTION_DRIVETHRU', 'Lorem ipsum dolor sit amet, consectetur.')
120
+ description: t('ORDERTYPE_DESCRIPTION_DRIVETHRU', 'Drive Thru description')
121
121
  }
122
122
  ]
123
123
  }
@@ -144,7 +144,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
144
144
  {isFarAway && (
145
145
  <FarAwayMessage style={styles.farAwayMsg}>
146
146
  <Ionicons name='md-warning-outline' style={styles.iconStyle} />
147
- <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'You are far from this address')}</OText>
147
+ <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'Your are far from this address')}</OText>
148
148
  </FarAwayMessage>
149
149
  )}
150
150
  <View style={styles.wrapperOrderOptions}>
@@ -1,163 +0,0 @@
1
- import React, { useState, useEffect } from 'react'
2
- import { useLanguage } from 'ordering-components/native'
3
- import { GooglePayButton, useGooglePay, ApplePayButton, useApplePay } from '@stripe/stripe-react-native'
4
- import { OButton } from '../shared';
5
- import { Platform, View } from 'react-native';
6
- import { StripeMethodFormParams } from '../../types';
7
-
8
- export const StripeMethodForm = (props: StripeMethodFormParams) => {
9
- const {
10
- cart,
11
- handleSource,
12
- onCancel,
13
- setErrors,
14
- paymethod,
15
- devMode
16
- } = props
17
- const { initGooglePay, createGooglePayPaymentMethod, loading } = useGooglePay();
18
- const { presentApplePay, isApplePaySupported } = useApplePay();
19
- const [initialized, setInitialized] = useState(false);
20
- const [, t] = useLanguage()
21
-
22
- useEffect(() => {
23
- if (paymethod !== 'google_pay') return
24
- if (Platform.OS === 'ios') {
25
- setErrors(t('GOOGLE_PAY_NOT_SUPPORTED', 'Google pay not supported'))
26
- return
27
- }
28
- const initialize = async () => {
29
- try {
30
- const { error } = await initGooglePay({
31
- testEnv: devMode,
32
- merchantName: 'Widget Store',
33
- countryCode: 'US',
34
- billingAddressConfig: {
35
- format: 'FULL',
36
- isPhoneNumberRequired: true,
37
- isRequired: false,
38
- },
39
- existingPaymentMethodRequired: false,
40
- isEmailRequired: true,
41
- });
42
-
43
- if (error) {
44
- setErrors(error.code + ' - ' + error.message);
45
- return;
46
- }
47
- setInitialized(true);
48
- } catch (err: any) {
49
- setErrors('Catch ' + err?.message)
50
- }
51
- }
52
- initialize();
53
- }, [initGooglePay]);
54
-
55
- useEffect(() => {
56
- if (paymethod !== 'apple_pay') return
57
- if (Platform.OS === 'android') {
58
- setErrors(t('APPLE_PAY_NOT_SUPPORTED', 'Apple pay not supported'))
59
- return
60
- }
61
- }, [])
62
-
63
- const createPaymentMethod = async () => {
64
-
65
- const { error, paymentMethod } = await createGooglePayPaymentMethod({
66
- amount: cart?.balance ?? cart?.total,
67
- currencyCode: 'USD',
68
- });
69
-
70
- if (error) {
71
- setErrors(error.code + ' - ' + error.message);
72
- return;
73
- } else if (paymentMethod) {
74
- handleSource({
75
- ...paymentMethod?.Card,
76
- id: paymentMethod.id,
77
- type: paymentMethod.type,
78
- source_id: paymentMethod?.id,
79
- card: {
80
- brand: paymentMethod.Card.brand,
81
- last4: paymentMethod.Card.last4
82
- }
83
- })
84
- onCancel()
85
- }
86
- setInitialized(false);
87
- };
88
-
89
- const pay = async () => {
90
- if (!isApplePaySupported) {
91
- setErrors(t('APPLE_PAY_NOT_SUPPORTED', 'Apple pay not supported'))
92
- return
93
- }
94
-
95
- const { error, paymentMethod } = await presentApplePay({
96
- cartItems: cart?.products?.map((product: any) => ({ label: product?.name, amount: product?.price?.toString?.() })),
97
- country: 'US',
98
- currency: 'USD',
99
- shippingMethods: [
100
- {
101
- amount: cart?.balance?.toString() ?? cart?.total?.toString?.(),
102
- identifier: 'DPS',
103
- label: 'Courier',
104
- detail: 'Delivery',
105
- type: 'final',
106
- },
107
- ],
108
-
109
- requiredShippingAddressFields: ['emailAddress', 'phoneNumber'],
110
- requiredBillingContactFields: ['phoneNumber', 'name'],
111
- });
112
- if (error) {
113
- setErrors(error.code + ' - ' + error.message);
114
- } else if (paymentMethod) {
115
- handleSource({
116
- ...paymentMethod?.Card,
117
- id: paymentMethod.id,
118
- type: paymentMethod.type,
119
- source_id: paymentMethod?.id,
120
- card: {
121
- brand: paymentMethod.Card.brand,
122
- last4: paymentMethod.Card.last4
123
- }
124
- })
125
- onCancel()
126
- }
127
- }
128
-
129
- return (
130
- <>
131
- {paymethod === 'google_pay' ? (
132
- <View>
133
- {!loading && initialized && (
134
- <OButton
135
- textStyle={{
136
- color: '#fff'
137
- }}
138
- imgRightSrc={null}
139
- onClick={createPaymentMethod}
140
- isDisabled={!initialized}
141
- text={t('PAY_WITH_GOOGLE_PAY', 'Pay with Google Pay')}
142
- />
143
- )}
144
- </View>
145
- ) : (
146
- <View>
147
- {isApplePaySupported && (
148
- <ApplePayButton
149
- onPress={pay}
150
- type="plain"
151
- buttonStyle="black"
152
- borderRadius={4}
153
- style={{
154
- width: '100%',
155
- height: 50,
156
- }}
157
- />
158
- )}
159
- </View>
160
- )}
161
- </>
162
- )
163
- }