ordering-ui-react-native 0.12.55 → 0.12.59

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 (202) hide show
  1. package/package.json +1 -1
  2. package/src/components/Cart/index.tsx +50 -16
  3. package/src/components/OrderDetails/index.tsx +8 -0
  4. package/src/components/OrderSummary/index.tsx +38 -3
  5. package/src/layouts/Container.tsx +1 -1
  6. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +8 -0
  7. package/themes/business/src/components/OrderDetails/styles.tsx +1 -0
  8. package/themes/business/src/layouts/Container.tsx +3 -1
  9. package/themes/doordash/src/components/Cart/index.tsx +37 -2
  10. package/themes/doordash/src/components/OrderDetails/index.tsx +8 -0
  11. package/themes/doordash/src/components/OrderSummary/index.tsx +37 -3
  12. package/themes/doordash/src/layouts/Container.tsx +1 -1
  13. package/themes/instacart/src/components/Cart/index.tsx +37 -3
  14. package/themes/instacart/src/components/OrderDetails/index.tsx +8 -0
  15. package/themes/instacart/src/components/OrderSummary/index.tsx +37 -4
  16. package/themes/instacart/src/layouts/Container.tsx +1 -1
  17. package/themes/kiosk/src/layouts/Container.tsx +2 -1
  18. package/themes/original/src/components/Cart/index.tsx +268 -234
  19. package/themes/original/src/components/OrderDetails/index.tsx +723 -715
  20. package/themes/original/src/components/OrderSummary/index.tsx +37 -3
  21. package/themes/original/src/layouts/Container.tsx +1 -1
  22. package/themes/single-business/src/components/Cart/index.tsx +127 -16
  23. package/themes/single-business/src/components/Cart/styles.tsx +39 -0
  24. package/themes/single-business/src/components/CartContent/index.tsx +56 -52
  25. package/themes/single-business/src/components/CartContent/styles.tsx +2 -16
  26. package/themes/single-business/src/components/OrderDetails/index.tsx +724 -708
  27. package/themes/single-business/src/components/OrderSummary/index.tsx +189 -154
  28. package/themes/single-business/src/layouts/Container.tsx +1 -1
  29. package/themes/uber-eats/src/components/Cart/index.tsx +37 -3
  30. package/themes/uber-eats/src/components/OrderDetails/index.tsx +8 -0
  31. package/themes/uber-eats/src/components/OrderSummary/index.tsx +40 -6
  32. package/themes/uber-eats/src/layouts/Container.tsx +1 -1
  33. package/themes/franchises/index.tsx +0 -111
  34. package/themes/franchises/src/components/ActiveOrders/index.tsx +0 -134
  35. package/themes/franchises/src/components/ActiveOrders/styles.tsx +0 -44
  36. package/themes/franchises/src/components/AddressDetails/index.tsx +0 -77
  37. package/themes/franchises/src/components/AddressDetails/styles.tsx +0 -21
  38. package/themes/franchises/src/components/AddressForm/index.tsx +0 -837
  39. package/themes/franchises/src/components/AddressForm/styles.tsx +0 -27
  40. package/themes/franchises/src/components/AddressList/index.tsx +0 -338
  41. package/themes/franchises/src/components/AddressList/styles.tsx +0 -20
  42. package/themes/franchises/src/components/AppleLogin/index.tsx +0 -149
  43. package/themes/franchises/src/components/AppleLogin/styles.tsx +0 -21
  44. package/themes/franchises/src/components/BottomWrapper/index.tsx +0 -29
  45. package/themes/franchises/src/components/BusinessBasicInformation/index.tsx +0 -310
  46. package/themes/franchises/src/components/BusinessBasicInformation/styles.tsx +0 -66
  47. package/themes/franchises/src/components/BusinessController/index.tsx +0 -184
  48. package/themes/franchises/src/components/BusinessController/styles.tsx +0 -64
  49. package/themes/franchises/src/components/BusinessFeaturedController/index.tsx +0 -189
  50. package/themes/franchises/src/components/BusinessFeaturedController/styles.tsx +0 -50
  51. package/themes/franchises/src/components/BusinessInformation/index.tsx +0 -202
  52. package/themes/franchises/src/components/BusinessInformation/styles.tsx +0 -39
  53. package/themes/franchises/src/components/BusinessItemAccordion/index.tsx +0 -125
  54. package/themes/franchises/src/components/BusinessItemAccordion/styles.tsx +0 -54
  55. package/themes/franchises/src/components/BusinessProductsCategories/index.tsx +0 -87
  56. package/themes/franchises/src/components/BusinessProductsCategories/styles.tsx +0 -8
  57. package/themes/franchises/src/components/BusinessProductsList/index.tsx +0 -199
  58. package/themes/franchises/src/components/BusinessProductsList/styles.tsx +0 -14
  59. package/themes/franchises/src/components/BusinessProductsListing/index.tsx +0 -292
  60. package/themes/franchises/src/components/BusinessProductsListing/styles.tsx +0 -30
  61. package/themes/franchises/src/components/BusinessReviews/index.tsx +0 -249
  62. package/themes/franchises/src/components/BusinessReviews/styles.tsx +0 -59
  63. package/themes/franchises/src/components/BusinessTypeFilter/index.tsx +0 -127
  64. package/themes/franchises/src/components/BusinessTypeFilter/styles.tsx +0 -40
  65. package/themes/franchises/src/components/BusinessesListing/index.tsx +0 -339
  66. package/themes/franchises/src/components/BusinessesListing/styles.tsx +0 -92
  67. package/themes/franchises/src/components/Cart/index.tsx +0 -298
  68. package/themes/franchises/src/components/Cart/styles.tsx +0 -28
  69. package/themes/franchises/src/components/CartContent/index.tsx +0 -60
  70. package/themes/franchises/src/components/CartContent/styles.tsx +0 -19
  71. package/themes/franchises/src/components/Checkout/index.tsx +0 -664
  72. package/themes/franchises/src/components/Checkout/styles.tsx +0 -89
  73. package/themes/franchises/src/components/CouponControl/index.tsx +0 -119
  74. package/themes/franchises/src/components/CouponControl/styles.tsx +0 -22
  75. package/themes/franchises/src/components/DriverTips/index.tsx +0 -167
  76. package/themes/franchises/src/components/DriverTips/styles.tsx +0 -63
  77. package/themes/franchises/src/components/FacebookLogin/index.tsx +0 -107
  78. package/themes/franchises/src/components/FacebookLogin/styles.tsx +0 -21
  79. package/themes/franchises/src/components/FloatingButton/index.tsx +0 -100
  80. package/themes/franchises/src/components/FloatingButton/styles.tsx +0 -26
  81. package/themes/franchises/src/components/ForgotPasswordForm/index.tsx +0 -156
  82. package/themes/franchises/src/components/ForgotPasswordForm/styles.tsx +0 -11
  83. package/themes/franchises/src/components/GPSButton/index.tsx +0 -84
  84. package/themes/franchises/src/components/GPSButton/styles.ts +0 -6
  85. package/themes/franchises/src/components/GoogleLogin/index.tsx +0 -122
  86. package/themes/franchises/src/components/GoogleLogin/styles.tsx +0 -23
  87. package/themes/franchises/src/components/GoogleMap/index.tsx +0 -229
  88. package/themes/franchises/src/components/Help/index.tsx +0 -56
  89. package/themes/franchises/src/components/Help/styles.tsx +0 -11
  90. package/themes/franchises/src/components/HelpAccountAndPayment/index.tsx +0 -68
  91. package/themes/franchises/src/components/HelpAccountAndPayment/styles.tsx +0 -6
  92. package/themes/franchises/src/components/HelpGuide/index.tsx +0 -67
  93. package/themes/franchises/src/components/HelpGuide/styles.tsx +0 -6
  94. package/themes/franchises/src/components/HelpOrder/index.tsx +0 -79
  95. package/themes/franchises/src/components/HelpOrder/styles.tsx +0 -6
  96. package/themes/franchises/src/components/Home/index.tsx +0 -102
  97. package/themes/franchises/src/components/Home/styles.tsx +0 -18
  98. package/themes/franchises/src/components/LanguageSelector/index.tsx +0 -98
  99. package/themes/franchises/src/components/LanguageSelector/styles.tsx +0 -7
  100. package/themes/franchises/src/components/LastOrder/index.tsx +0 -168
  101. package/themes/franchises/src/components/LastOrder/styles.tsx +0 -16
  102. package/themes/franchises/src/components/LastOrders/index.tsx +0 -104
  103. package/themes/franchises/src/components/LastOrders/styles.tsx +0 -17
  104. package/themes/franchises/src/components/LoginForm/index.tsx +0 -512
  105. package/themes/franchises/src/components/LoginForm/styles.tsx +0 -77
  106. package/themes/franchises/src/components/LogoutButton/index.tsx +0 -36
  107. package/themes/franchises/src/components/Messages/index.tsx +0 -359
  108. package/themes/franchises/src/components/Messages/styles.tsx +0 -20
  109. package/themes/franchises/src/components/MomentOption/index.tsx +0 -321
  110. package/themes/franchises/src/components/MomentOption/styles.tsx +0 -66
  111. package/themes/franchises/src/components/NavBar/index.tsx +0 -129
  112. package/themes/franchises/src/components/NotFoundSource/index.tsx +0 -50
  113. package/themes/franchises/src/components/NotFoundSource/styles.tsx +0 -16
  114. package/themes/franchises/src/components/Notifications/index.tsx +0 -120
  115. package/themes/franchises/src/components/Notifications/styles.ts +0 -21
  116. package/themes/franchises/src/components/OrderDetails/index.tsx +0 -820
  117. package/themes/franchises/src/components/OrderDetails/styles.tsx +0 -120
  118. package/themes/franchises/src/components/OrderSummary/index.tsx +0 -232
  119. package/themes/franchises/src/components/OrderSummary/styles.tsx +0 -41
  120. package/themes/franchises/src/components/OrderTypeSelector/index.tsx +0 -92
  121. package/themes/franchises/src/components/OrderTypeSelector/styles.tsx +0 -27
  122. package/themes/franchises/src/components/OrdersOption/index.tsx +0 -243
  123. package/themes/franchises/src/components/OrdersOption/styles.tsx +0 -5
  124. package/themes/franchises/src/components/PaymentOptionCash/index.tsx +0 -102
  125. package/themes/franchises/src/components/PaymentOptionCash/styles.tsx +0 -18
  126. package/themes/franchises/src/components/PaymentOptionStripe/index.tsx +0 -234
  127. package/themes/franchises/src/components/PaymentOptionStripe/styles.tsx +0 -71
  128. package/themes/franchises/src/components/PaymentOptions/index.tsx +0 -430
  129. package/themes/franchises/src/components/PaymentOptions/styles.tsx +0 -77
  130. package/themes/franchises/src/components/PhoneInputNumber/index.tsx +0 -127
  131. package/themes/franchises/src/components/PhoneInputNumber/styles.tsx +0 -3
  132. package/themes/franchises/src/components/PreviousOrders/index.tsx +0 -188
  133. package/themes/franchises/src/components/PreviousOrders/styles.tsx +0 -33
  134. package/themes/franchises/src/components/ProductForm/index.tsx +0 -695
  135. package/themes/franchises/src/components/ProductForm/styles.tsx +0 -78
  136. package/themes/franchises/src/components/ProductIngredient/index.tsx +0 -43
  137. package/themes/franchises/src/components/ProductIngredient/styles.tsx +0 -7
  138. package/themes/franchises/src/components/ProductItemAccordion/index.tsx +0 -276
  139. package/themes/franchises/src/components/ProductItemAccordion/styles.tsx +0 -57
  140. package/themes/franchises/src/components/ProductOption/index.tsx +0 -50
  141. package/themes/franchises/src/components/ProductOption/styles.tsx +0 -11
  142. package/themes/franchises/src/components/ProductOptionSubOption/index.tsx +0 -146
  143. package/themes/franchises/src/components/ProductOptionSubOption/styles.tsx +0 -32
  144. package/themes/franchises/src/components/ReviewDriver/index.tsx +0 -221
  145. package/themes/franchises/src/components/ReviewDriver/styles.tsx +0 -46
  146. package/themes/franchises/src/components/ReviewOrder/index.tsx +0 -325
  147. package/themes/franchises/src/components/ReviewOrder/styles.tsx +0 -46
  148. package/themes/franchises/src/components/ReviewProduct/index.tsx +0 -275
  149. package/themes/franchises/src/components/ReviewProduct/styles.tsx +0 -53
  150. package/themes/franchises/src/components/SearchBar/index.tsx +0 -139
  151. package/themes/franchises/src/components/SignupForm/index.tsx +0 -643
  152. package/themes/franchises/src/components/SignupForm/styles.tsx +0 -27
  153. package/themes/franchises/src/components/SingleProductCard/index.tsx +0 -124
  154. package/themes/franchises/src/components/SingleProductCard/styles.tsx +0 -23
  155. package/themes/franchises/src/components/StripeCardForm/index.tsx +0 -97
  156. package/themes/franchises/src/components/StripeCardForm/naked.tsx +0 -128
  157. package/themes/franchises/src/components/StripeCardForm/styles.tsx +0 -32
  158. package/themes/franchises/src/components/StripeCardsList/index.tsx +0 -182
  159. package/themes/franchises/src/components/StripeElementsForm/index.tsx +0 -204
  160. package/themes/franchises/src/components/StripeElementsForm/naked.tsx +0 -90
  161. package/themes/franchises/src/components/StripeElementsForm/styles.tsx +0 -13
  162. package/themes/franchises/src/components/StripeRedirectForm/index.tsx +0 -159
  163. package/themes/franchises/src/components/StripeRedirectForm/styles.tsx +0 -23
  164. package/themes/franchises/src/components/TagSelector/index.tsx +0 -94
  165. package/themes/franchises/src/components/TagSelector/styles.ts +0 -0
  166. package/themes/franchises/src/components/TaxInformation/index.tsx +0 -51
  167. package/themes/franchises/src/components/TaxInformation/styles.tsx +0 -9
  168. package/themes/franchises/src/components/UpsellingProducts/index.tsx +0 -222
  169. package/themes/franchises/src/components/UpsellingProducts/styles.tsx +0 -50
  170. package/themes/franchises/src/components/UserDetails/index.tsx +0 -134
  171. package/themes/franchises/src/components/UserDetails/styles.tsx +0 -26
  172. package/themes/franchises/src/components/UserFormDetails/index.tsx +0 -351
  173. package/themes/franchises/src/components/UserFormDetails/styles.tsx +0 -35
  174. package/themes/franchises/src/components/UserProfile/index.tsx +0 -179
  175. package/themes/franchises/src/components/UserProfile/styles.ts +0 -42
  176. package/themes/franchises/src/components/UserProfileForm/index.tsx +0 -253
  177. package/themes/franchises/src/components/UserProfileForm/styles.tsx +0 -29
  178. package/themes/franchises/src/components/VerifyPhone/index.tsx +0 -188
  179. package/themes/franchises/src/components/VerifyPhone/styles.tsx +0 -43
  180. package/themes/franchises/src/components/shared/OAlert.tsx +0 -55
  181. package/themes/franchises/src/components/shared/OBottomPopup.tsx +0 -73
  182. package/themes/franchises/src/components/shared/OBottomStickBar.tsx +0 -62
  183. package/themes/franchises/src/components/shared/OButton.tsx +0 -132
  184. package/themes/franchises/src/components/shared/ODropDown.tsx +0 -169
  185. package/themes/franchises/src/components/shared/OIcon.tsx +0 -53
  186. package/themes/franchises/src/components/shared/OIconButton.tsx +0 -127
  187. package/themes/franchises/src/components/shared/OIconText.tsx +0 -54
  188. package/themes/franchises/src/components/shared/OInput.tsx +0 -113
  189. package/themes/franchises/src/components/shared/OKeyButton.tsx +0 -35
  190. package/themes/franchises/src/components/shared/OModal.tsx +0 -172
  191. package/themes/franchises/src/components/shared/OText.tsx +0 -52
  192. package/themes/franchises/src/components/shared/OTextarea.tsx +0 -36
  193. package/themes/franchises/src/components/shared/OToast.tsx +0 -93
  194. package/themes/franchises/src/components/shared/OToggle.tsx +0 -158
  195. package/themes/franchises/src/components/shared/index.tsx +0 -29
  196. package/themes/franchises/src/config/constants.tsx +0 -57
  197. package/themes/franchises/src/layouts/Container.tsx +0 -23
  198. package/themes/franchises/src/layouts/SafeAreaContainer.tsx +0 -6
  199. package/themes/franchises/src/providers/AlertProvider.tsx +0 -43
  200. package/themes/franchises/src/providers/StoreUtil.tsx +0 -50
  201. package/themes/franchises/src/types/index.tsx +0 -445
  202. package/themes/franchises/src/utils/index.tsx +0 -222
@@ -1,50 +0,0 @@
1
- import AsyncStorage from '@react-native-async-storage/async-storage';
2
-
3
- export const _retrieveStoreData = async (key: string) => {
4
- if (!key) return
5
- try {
6
- const value = await AsyncStorage.getItem(key);
7
- if (value !== null) {
8
- return JSON.parse(value)
9
- }
10
- } catch {
11
- return null
12
- }
13
- };
14
-
15
- export const _setStoreData = (key: string, val: any) => {
16
- if (!key) return
17
- try {
18
- AsyncStorage.setItem(
19
- key,
20
- typeof (val) === 'string' ? val : JSON.stringify(val)
21
- )
22
- } catch {
23
- return null
24
- }
25
- };
26
-
27
- export const _removeStoreData = (key: string) => {
28
- if (!key) return
29
- try {
30
- AsyncStorage.removeItem(key)
31
- } catch {
32
- return null
33
- }
34
- };
35
-
36
- export const _clearStoreData = async () => {
37
- try {
38
- const keys = await AsyncStorage.getAllKeys()
39
- AsyncStorage.multiRemove(keys)
40
- } catch {
41
- return null
42
- }
43
- }
44
-
45
- export const StoreMethods = {
46
- _retrieveStoreData,
47
- _setStoreData,
48
- _removeStoreData,
49
- _clearStoreData
50
- }
@@ -1,445 +0,0 @@
1
- import { TextInputProps, ViewStyle } from 'react-native';
2
- export interface LoginParams {
3
- navigation?: any;
4
- formState?: any;
5
- useLoginByEmail?: boolean;
6
- useLoginByCellphone?: boolean;
7
- loginTab?: string;
8
- handleChangeTab?: any;
9
- loginButtonText?: string;
10
- onNavigationRedirect?: any;
11
- registerButtonText?: string;
12
- forgotButtonText?: string;
13
- verifyPhoneState?: any;
14
- checkPhoneCodeState?: any;
15
- setCheckPhoneCodeState?: any;
16
- handleButtonLoginClick?: any;
17
- handleSendVerifyCode?: any;
18
- handleCheckPhoneCode?: any;
19
- notificationState?: any;
20
- }
21
- export interface ProfileParams {
22
- navigation?: any;
23
- isEdit?: boolean;
24
- formState?: any;
25
- toggleIsEdit?: any;
26
- cleanFormState?: any;
27
- setFormState?: any;
28
- handleChangeInput?: any;
29
- handleButtonUpdateClick?: any;
30
- handlechangeImage?: any;
31
- validationFields?: any;
32
- showField?: any;
33
- isRequiredField?: any;
34
- }
35
-
36
- export interface AddressListParams {
37
- navigation?: any;
38
- addressList?: any;
39
- isFromProfile?: boolean;
40
- nopadding?: boolean;
41
- userId?: any;
42
- handleDelete?: any;
43
- handleSetDefault?: any;
44
- setAddressList?: any;
45
- isGoBack?: boolean;
46
- route?: any;
47
- actionStatus?: any;
48
- isFromBusinesses?: boolean;
49
- isFromProductsList?: boolean;
50
- afterSignup?: boolean;
51
- isFromCheckout?: boolean
52
- }
53
-
54
- export interface AddressFormParams {
55
- navigation?: any,
56
- updateChanges?: any,
57
- address?: any,
58
- formState?: any,
59
- isEditing?: boolean,
60
- handleChangeInput?: any,
61
- addressState?: any,
62
- addressesList?: any,
63
- saveAddress?: any,
64
- userCustomerSetup?: boolean,
65
- isRequiredField?: (field: string) => {},
66
- isGuestUser?: boolean,
67
- useValidationFileds?: boolean,
68
- isSelectedAfterAdd?: boolean,
69
- onSaveAddress?: any,
70
- isFromProductsList?: boolean,
71
- hasAddressDefault?: any,
72
- isFromCheckout?: boolean
73
- afterSignup?: boolean
74
- isGuestFromStore?: boolean,
75
- isSingleBusiness?: boolean,
76
- singleBusiness?: string,
77
- }
78
- export interface SignupParams {
79
- navigation?: any;
80
- loginButtonText?: string;
81
- signupButtonText?: string;
82
- onNavigationRedirect?: any;
83
- formState?: any;
84
- validationFields?: any;
85
- showField?: any;
86
- isRequiredField?: any;
87
- useChekoutFileds?: boolean;
88
- useSignupByEmail?: boolean;
89
- useSignupByCellphone?: boolean;
90
- handleSuccessSignup?: any;
91
- handleButtonSignupClick?: any;
92
- verifyPhoneState?: any;
93
- checkPhoneCodeState?: any;
94
- setCheckPhoneCodeState?: any;
95
- handleSendVerifyCode?: any;
96
- handleCheckPhoneCode?: any;
97
- notificationState?: any;
98
- }
99
-
100
- export interface PhoneInputParams {
101
- data?: any;
102
- handleData?: any;
103
- defaultValue?: any;
104
- defaultCode?: number | null;
105
- forwardRef?: any;
106
- textInputProps?: TextInputProps;
107
- boxStyle?: any;
108
- inputStyle?: any;
109
- textStyle?: any;
110
- noDropIcon?: boolean;
111
- flagStyle?: any;
112
- }
113
-
114
- export interface LanguageSelectorParams {
115
- languagesState?: any;
116
- currentLanguage?: string;
117
- handleChangeLanguage?: any;
118
- iconColor?: any;
119
- pickerStyle?: any;
120
- }
121
- export interface BusinessesListingParams {
122
- navigation?: any;
123
- businessesList: { businesses: Array<any>, loading: boolean, error: null | string };
124
- searchValue: string;
125
- getBusinesses: (newFetch?: boolean) => void;
126
- handleChangeBusinessType?: any;
127
- handleBusinessClick?: void;
128
- paginationProps?: any;
129
- handleChangeSearch?: any;
130
- images?: any;
131
- businessTypes?: any;
132
- defaultBusinessType?: any;
133
- }
134
- export interface BusinessTypeFilterParams {
135
- businessTypes?: Array<any>;
136
- handleChangeBusinessType: any;
137
- currentTypeSelected?: string | null;
138
- defaultBusinessType?: string | null;
139
- images?: any
140
- typesState?: any
141
- }
142
- export interface BusinessControllerParams {
143
- key?: number;
144
- business?: any;
145
- handleCustomClick?: any;
146
- orderType?: any;
147
- handleClick?: any;
148
- isBusinessOpen?: boolean;
149
- businessWillCloseSoonMinutes?: number
150
- isBusinessClose?: number
151
- }
152
- export interface BusinessProductsListingParams {
153
- navigation?: any;
154
- errors: any;
155
- businessState: { business: any, loading: boolean, error: null };
156
- categoryState: any;
157
- searchValue?: string;
158
- featuredProducts: boolean;
159
- handleChangeSearch?: any;
160
- categorySelected: any;
161
- handleSearchRedirect: any;
162
- errorQuantityProducts?: boolean;
163
- header?: any;
164
- logo?: any;
165
- productModal?: any;
166
- handleChangeCategory: (value: any) => {};
167
- setProductLogin?: () => {};
168
- updateProductModal?: (value: any) => {}
169
- }
170
- export interface BusinessBasicInformationParams {
171
- navigation?: any;
172
- businessState?: any;
173
- openBusinessInformation?: any;
174
- isBusinessInfoShow?: boolean;
175
- header?: any;
176
- logo?: any;
177
- isMini?: boolean;
178
- }
179
- export interface BusinessProductsCategoriesParams {
180
- categories: Array<any>;
181
- // handlerClickCategory: any;
182
- onClickCategory: any;
183
- openBusinessInformation: any;
184
- categorySelected: any;
185
- featured: boolean;
186
- loading?: any;
187
- }
188
- export interface BusinessProductsListParams {
189
- errors?: any;
190
- businessId?: number;
191
- category?: any;
192
- categories?: Array<any>;
193
- categoryState?: any;
194
- onProductClick?: any;
195
- handleSearchRedirect?: () => {};
196
- featured?: any;
197
- searchValue?: any;
198
- handleClearSearch?: (value: any) => {};
199
- isBusinessLoading?: any,
200
- errorQuantityProducts?: boolean,
201
- handleCancelSearch?: () => void
202
- }
203
- export interface SingleProductCardParams {
204
- businessId: any,
205
- product: any;
206
- isSoldOut: boolean;
207
- onProductClick: any;
208
- }
209
- export interface BusinessInformationParams {
210
- navigation?: any,
211
- businessState?: any;
212
- businessSchedule?: Array<any>;
213
- businessLocation?: any
214
- business?: any
215
- }
216
- export interface BusinessReviewsParams {
217
- businessState: { business: any, loading: boolean, error: null };
218
- reviewsList: { reviews: any, loading: boolean, error: null };
219
- }
220
- export interface SearchBarParams {
221
- searchValue?: any;
222
- lazyLoad?: boolean;
223
- placeholder: string;
224
- isCancelButtonShow?: boolean;
225
- noBorderShow?: boolean;
226
- onSearch: (value: any) => {};
227
- onCancel?: any;
228
- }
229
- export interface NotFoundSourceParams {
230
- image?: any,
231
- content?: string,
232
- btnTitle?: string,
233
- conditioned?: boolean,
234
- onClickButton?: any,
235
- children?: any
236
- }
237
- export interface OrdersOptionParams {
238
- orderList?: any,
239
- activeOrders?: boolean,
240
- pagination?: any,
241
- titleContent?: string,
242
- customArray?: Array<any>,
243
- loadMoreOrders?: () => {},
244
- onNavigationRedirect?: any,
245
- orderStatus?: any,
246
- navigation?: any,
247
- loadOrders?: any,
248
- setOrderList?: any,
249
- preOrders?: boolean,
250
- businessId?: any,
251
- setOrdersLength?: ({ activeOrdersLength, previousOrdersLength }: { activeOrdersLength: number, previousOrdersLength: number }) => void,
252
- ordersLength: { activeOrdersLength: number, previousOrdersLength: number }
253
- }
254
- export interface ActiveOrdersParams {
255
- orders?: any,
256
- pagination?: any,
257
- getOrderStatus?: any,
258
- reorderLoading?: boolean,
259
- customArray?: Array<any>
260
- setScreen?: any,
261
- screen?: any,
262
- isPreorders?: boolean,
263
- preordersLength?: number,
264
- loadMoreOrders?: () => {},
265
- onNavigationRedirect?: (route: string, params?: any) => {}
266
- }
267
- export interface PreviousOrdersParams {
268
- orders?: any,
269
- pagination?: any,
270
- getOrderStatus?: any,
271
- orderID?: number
272
- reorderLoading?: boolean,
273
- loadMoreOrders?: () => {},
274
- handleReorder: (order: any) => {},
275
- onNavigationRedirect?: (route: string, params?: any) => {}
276
- }
277
- export interface OrderDetailsParams {
278
- navigation?: any,
279
- messagesReadList?: any,
280
- urlToShare?: string,
281
- messages?: any,
282
- order?: any,
283
- handleOrderRedirect?: () => {},
284
- setMessages?: () => {},
285
- readMessages?: () => {},
286
- isFromCheckout?: boolean,
287
- driverLocation?: any,
288
- isFromRoot?: any,
289
- goToBusinessList?: boolean
290
- }
291
- export interface ProductItemAccordionParams {
292
- key?: any;
293
- isCartPending?: boolean,
294
- isCartProduct?: boolean,
295
- product?: any,
296
- getProductMax?: any,
297
- changeQuantity?: (product: any, quantity: number) => {},
298
- onDeleteProduct?: (product: any) => void,
299
- onEditProduct?: (product: any) => void,
300
- offsetDisabled?: any,
301
- isFromCheckout?: any
302
- }
303
- export interface ReviewOrderParams {
304
- order?: { orderId: number, businessId: number, logo: string, products?: any, driver?: any },
305
- stars?: any,
306
- handleChangeInput?: any,
307
- handleChangeRating?: any,
308
- handleSendReview?: any,
309
- formState?: any,
310
- navigation?: any,
311
- route?: any,
312
- orderComments?: any,
313
- setStars?: any
314
- }
315
- export interface ReviewProductParams {
316
- order?: any,
317
- products?: Array<{id: number, name: string}>,
318
- formState?: any,
319
- navigation?: any,
320
- handleChangeFormState?: any,
321
- closeReviewProduct?: any,
322
- handleSendProductReview?: any,
323
- setIsProductReviewed?: any
324
- }
325
- export interface ReviewDriverParams {
326
- dirverReviews?: any,
327
- order?: any,
328
- formState?: any,
329
- setDriverReviews?: any,
330
- closeReviewDriver?: any,
331
- setIsDriverReviewed?: any,
332
- handleSendDriverReview?: any,
333
- navigation?: any,
334
- }
335
- export interface MessagesParams {
336
- type?: string,
337
- order?: any,
338
- orderId?: number,
339
- messages?: any,
340
- message?: string,
341
- image?: string,
342
- messagesToShow?: any,
343
- sendMessage?: any,
344
- handleSend?: () => {},
345
- setImage?: (image: string | null) => {},
346
- setMessage?: (comment: string) => {},
347
- setMessages?: () => {},
348
- readMessages?: () => {},
349
- onClose?: () => void,
350
- }
351
- export interface ViewInterface {
352
- navigation?: any;
353
- onLogin?: any;
354
- title?: string;
355
- subTitle?: string;
356
- backgroundColor?: string;
357
- wrapperStyle?: ViewStyle;
358
- borderRadius?: any;
359
- border?: string;
360
- placeHolderColor?: string;
361
- buttonBackground?: string;
362
- inputMargin?: string;
363
- loginButtonText?: string;
364
- loginButtonBackground?: string;
365
- loginButtonBorder?: string;
366
- buttonBorder?: string;
367
- registerButtonText?: string;
368
- registerButtonBackground?: string;
369
- registerButtonBorderColor?: string;
370
- loginButtonBorderColor?: string;
371
- onRegister?: any;
372
- onForgot?: any;
373
- forgotButtonText?: string;
374
- }
375
- export interface FloatingButtonParams {
376
- btnLeftValue?: string;
377
- btnRightValue?: string;
378
- btnText: string
379
- handleButtonClick?: any;
380
- disabled?: boolean;
381
- isSecondaryBtn?: boolean;
382
- btnLeftValueShow?: boolean;
383
- btnRightValueShow?: boolean;
384
- handleClick?: any;
385
- handleEmpty?: any;
386
- hasBottom?: any;
387
- }
388
- export interface MomentOptionParams {
389
- navigation: any;
390
- nopadding?: boolean;
391
- datesList: Array<any>;
392
- hoursList: Array<any>;
393
- dateSelected?: any;
394
- timeSelected?: any;
395
- isAsap?: boolean;
396
- handleAsap: () => {};
397
- handleChangeDate: (value: any) => {};
398
- handleChangeTime: (value: any) => {};
399
- }
400
- export interface OrderTypeSelectParams {
401
- navigation?: any;
402
- route?: any;
403
- handleChangeOrderType: (value: any) => {};
404
- typeSelected?: number;
405
- defaultValue?: number;
406
- configTypes?: Array<any>;
407
- orderTypes: Array<any>;
408
- }
409
- export interface UpsellingProductsParams {
410
- isCustomMode?: boolean;
411
- upsellingProducts?: any;
412
- business?: any;
413
- businessId?: number;
414
- cartProducts?: Array<any>;
415
- handleUpsellingPage: () => void;
416
- openUpselling: boolean;
417
- canOpenUpselling?: boolean;
418
- setCanOpenUpselling?: (value: any) => void;
419
- cart?: any;
420
- handleCloseUpsellingPage: () => void;
421
- }
422
-
423
- export interface GoogleMapsParams {
424
- location: { lat: number, lng: number }
425
- handleChangeAddressMap?: (address: any, details: any) => void
426
- setErrors?: (error: string) => void
427
- maxLimitLocation?: number
428
- readOnly?: boolean
429
- markerTitle?: string,
430
- saveLocation?: boolean,
431
- isSetInputs?: boolean,
432
- locations?: Array<any>,
433
- setSaveLocation?: (val: boolean) => void,
434
- handleToggleMap?: () => void
435
- }
436
-
437
- export interface HelpParams {
438
- navigation?: any;
439
- route?: any;
440
- }
441
-
442
- export interface LastOrdersParams {
443
- orderList?: any,
444
- onRedirect?: any,
445
- }
@@ -1,222 +0,0 @@
1
- import React from 'react';
2
- import { useLanguage } from 'ordering-components/native';
3
- import FontAwesome from 'react-native-vector-icons/FontAwesome';
4
- import {CODES} from 'ordering-components/native'
5
- import { ORDER_TYPES } from '../config/constants';
6
-
7
- export const flatArray = (arr: any) => [].concat(...arr)
8
-
9
- /**
10
- * Function to return the traduction depending of a key 't'
11
- * @param {string} key for traduction
12
- */
13
- export const getTraduction = (key: string) => {
14
- const [, t] = useLanguage()
15
- const keyList: any = {
16
- // Add the key and traduction that you need below
17
- ERROR_ORDER_WITHOUT_CART: 'The order was placed without a cart',
18
- ERROR_INVALID_COUPON: "The coupon doesn't exist",
19
- ERROR_IVALID_COUPON_MINIMUM: 'You must have more products in your cart to use the coupon',
20
- ERROR_ADD_PRODUCT_VERY_FAR_FOR_PICKUP: 'The business is too far for order type pickup',
21
- ERROR_PLACE_PAY_WITH_CARD2: 'An error occurred while trying to pay by card',
22
- ERROR_ADD_PRODUCT_BUSINESS_CLOSED: 'The business is closed at the moment',
23
- INTERNAL_ERROR: 'Server Error, please wait, we are working to fix it',
24
- ERROR_NOT_FOUND_BUSINESSES: 'No businesses found near your location',
25
- YOU_DO_NOT_HAVE_PERMISSION: 'You do not have permission',
26
- INVALID_CODE: 'Invalid verify code',
27
- STRIPE_ERROR: 'Payment service error. Try again later.',
28
- ERROR_AUTH_TWILIO_DISABLED: 'Auth error, twilio is disabled',
29
- ERROR_CART_SELECT_PAYMETHOD: 'An error occurred with selected pay method',
30
- ERROR_YOU_HAVE_ACTIVE_CART: 'You can\'t reorder this cart',
31
- ERROR_YOU_HAVE_NOT_CART: 'Cart not found',
32
- ERROR_PLACE_PAY_WITH_REDIRECT: 'An error occurred while trying to pay by redirect',
33
- ERROR_PLACE_PAY_WITH_CARD1: 'An error occurred while trying to pay by card',
34
- ERROR_PLACE_PAY_WITH_PAYPAL_CAPTURE: 'An error occurred while trying to pay by PayPal',
35
- ERROR_ADD_PRODUCT_VERY_FAR_FOR_DELIVERY: 'Error adding product, very far for delivery',
36
- ERROR_PRODUCT_NOT_FOUND: 'Error with the product'
37
- }
38
-
39
- return keyList[key] ? t(key, keyList[key]) : t(key)
40
- }
41
-
42
- /**
43
- * Function to convert delivery time in minutes
44
- * @param {string} time business delivery time
45
- */
46
- export const convertHoursToMinutes = (time: any) => {
47
- if (!time) return '0min'
48
- const [hour, minute] = time.split(':')
49
- const result = (parseInt(hour, 10) * 60) + parseInt(minute, 10)
50
- return `${result}min`
51
- }
52
-
53
- export const getIconCard = (brand: string, size: number) => {
54
- const value = brand?.toLowerCase()
55
- switch (value) {
56
- case 'visa':
57
- return (
58
- FontAwesome && <FontAwesome
59
- name='cc-visa'
60
- size={size}
61
- color={'#000'}
62
- />
63
- )
64
- case 'mastercard':
65
- return (
66
- FontAwesome && <FontAwesome
67
- name='cc-mastercard'
68
- size={size}
69
- color={'#000'}
70
- />
71
- )
72
- case 'amex':
73
- return (
74
- FontAwesome && <FontAwesome
75
- name='cc-amex'
76
- size={size}
77
- color={'#000'}
78
- />
79
- )
80
- case 'discover':
81
- return (
82
- FontAwesome && <FontAwesome
83
- name='cc-discover'
84
- size={size}
85
- color={'#000'}
86
- />
87
- )
88
- case 'jcb':
89
- return (
90
- FontAwesome && <FontAwesome
91
- name='cc-jcb'
92
- size={size}
93
- color={'#000'}
94
- />
95
- )
96
- case 'diners-club':
97
- return (
98
- FontAwesome && <FontAwesome
99
- name='cc-diners-club'
100
- size={size}
101
- color={'#000'}
102
- />
103
- )
104
- default:
105
- return (
106
- FontAwesome && <FontAwesome
107
- name='credit-card-alt'
108
- size={size}
109
- color={'#000'}
110
- />
111
- )
112
- }
113
- }
114
- /**
115
- * Function to return a static google maps image based in location
116
- * @param {object} param object with latitude and logitude
117
- */
118
- export const getGoogleMapImage = ({ lat, lng }: any, apiKey: string) => {
119
- return `https://maps.googleapis.com/maps/api/staticmap?size=500x190&center=${lat},${lng}&zoom=17&scale=2&maptype=roadmap&&markers=icon:https://res.cloudinary.com/ditpjbrmz/image/upload/f_auto,q_auto,w_45,q_auto:best,q_auto:best/v1564675872/marker-customer_kvxric.png%7Ccolor:white%7C${lat},${lng}&key=${apiKey}`
120
- }
121
- /**
122
- * List of fields with correct order
123
- */
124
- export const fieldsToSort = ['name', 'middle_name', 'lastname', 'second_lastname', 'email'];
125
- /**
126
- * Function to return a array sorted by certain fields
127
- * @param fields Array with right order
128
- * @param array Array to sort
129
- */
130
- export const sortInputFields = ({ fields, values }: any) => {
131
- let fieldsBase = fields;
132
- const fieldsSorted: any = [];
133
- const fieldsArray = Array.isArray(values) ? values : values && Object.values(values);
134
-
135
- if (!fieldsBase) {
136
- fieldsBase = fieldsToSort
137
- }
138
-
139
- fieldsBase.forEach((f: any) => {
140
- fieldsArray && fieldsArray.forEach((field: any) => {
141
- if (f === field.code) {
142
- fieldsSorted.push(field)
143
- }
144
- })
145
- });
146
- return fieldsSorted;
147
- }
148
-
149
- export const transformCountryCode = (countryCode : number) => {
150
- const code = CODES.find((code : any) => code.phoneCode === countryCode)
151
- return code?.countryCode
152
- }
153
-
154
- /**
155
- * Function to check if a number is decimal or not
156
- * @param {*} value number to check if decimal or not
157
- * @param {*} parser function fallback when is decimal
158
- * @returns string
159
- */
160
- export const verifyDecimals = (value: number, parser: any) => {
161
- if (value % 1 === 0) {
162
- return value
163
- } else {
164
- return parser(value)
165
- }
166
- }
167
-
168
- export const getTypesText = (value: number) => {
169
- const ret = ORDER_TYPES.find((type: any) => type.value == value);
170
- return ret?.content;
171
- }
172
-
173
- export const getOrderStatus = (status: number) => {
174
- switch (status) {
175
- case 0:
176
- return 'ORDER_STATUS_PENDING'
177
- case 1:
178
- return 'ORDERS_COMPLETED'
179
- case 2:
180
- return 'ORDER_REJECTED'
181
- case 3:
182
- return 'ORDER_STATUS_IN_BUSINESS'
183
- case 4:
184
- return 'ORDER_READY'
185
- case 5:
186
- return 'ORDER_REJECTED_RESTAURANT'
187
- case 6:
188
- return 'ORDER_STATUS_CANCELLEDBYDRIVER'
189
- case 7:
190
- return 'ORDER_STATUS_ACCEPTEDBYRESTAURANT'
191
- case 8:
192
- return 'ORDER_CONFIRMED_ACCEPTED_BY_DRIVER'
193
- case 9:
194
- return 'ORDER_PICKUP_COMPLETED_BY_DRIVER'
195
- case 10:
196
- return 'ORDER_PICKUP_FAILED_BY_DRIVER'
197
- case 11:
198
- return 'ORDER_DELIVERY_COMPLETED_BY_DRIVER'
199
- case 12:
200
- return 'ORDER_DELIVERY_FAILED_BY_DRIVER'
201
- case 13:
202
- return 'PREORDER'
203
- case 14:
204
- return 'ORDER_NOT_READY'
205
- case 15:
206
- return 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER'
207
- case 16:
208
- return 'ORDER_STATUS_CANCELLED_BY_CUSTOMER'
209
- case 17:
210
- return 'ORDER_NOT_PICKEDUP_BY_CUSTOMER'
211
- case 18:
212
- return 'ORDER_DRIVER_ALMOST_ARRIVED_BUSINESS'
213
- case 19:
214
- return 'ORDER_DRIVER_ALMOST_ARRIVED_CUSTOMER'
215
- case 20:
216
- return 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS'
217
- case 21:
218
- return 'ORDER_CUSTOMER_ARRIVED_BUSINESS'
219
- default:
220
- return status
221
- }
222
- }