ordering-ui-react-native 0.12.54 → 0.12.58

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 (205) 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 +36 -2
  10. package/themes/doordash/src/components/OrderDetails/index.tsx +8 -0
  11. package/themes/doordash/src/components/OrderSummary/index.tsx +36 -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 +92 -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/PhoneInputNumber/index.tsx +103 -112
  27. package/themes/single-business/src/components/UserDetails/index.tsx +107 -111
  28. package/themes/single-business/src/components/UserDetails/styles.tsx +3 -8
  29. package/themes/single-business/src/components/UserFormDetails/index.tsx +279 -326
  30. package/themes/single-business/src/components/UserFormDetails/styles.tsx +7 -5
  31. package/themes/single-business/src/layouts/Container.tsx +1 -1
  32. package/themes/uber-eats/src/components/Cart/index.tsx +37 -3
  33. package/themes/uber-eats/src/components/OrderDetails/index.tsx +8 -0
  34. package/themes/uber-eats/src/components/OrderSummary/index.tsx +40 -6
  35. package/themes/uber-eats/src/layouts/Container.tsx +1 -1
  36. package/themes/franchises/index.tsx +0 -111
  37. package/themes/franchises/src/components/ActiveOrders/index.tsx +0 -134
  38. package/themes/franchises/src/components/ActiveOrders/styles.tsx +0 -44
  39. package/themes/franchises/src/components/AddressDetails/index.tsx +0 -77
  40. package/themes/franchises/src/components/AddressDetails/styles.tsx +0 -21
  41. package/themes/franchises/src/components/AddressForm/index.tsx +0 -837
  42. package/themes/franchises/src/components/AddressForm/styles.tsx +0 -27
  43. package/themes/franchises/src/components/AddressList/index.tsx +0 -338
  44. package/themes/franchises/src/components/AddressList/styles.tsx +0 -20
  45. package/themes/franchises/src/components/AppleLogin/index.tsx +0 -149
  46. package/themes/franchises/src/components/AppleLogin/styles.tsx +0 -21
  47. package/themes/franchises/src/components/BottomWrapper/index.tsx +0 -29
  48. package/themes/franchises/src/components/BusinessBasicInformation/index.tsx +0 -310
  49. package/themes/franchises/src/components/BusinessBasicInformation/styles.tsx +0 -66
  50. package/themes/franchises/src/components/BusinessController/index.tsx +0 -184
  51. package/themes/franchises/src/components/BusinessController/styles.tsx +0 -64
  52. package/themes/franchises/src/components/BusinessFeaturedController/index.tsx +0 -189
  53. package/themes/franchises/src/components/BusinessFeaturedController/styles.tsx +0 -50
  54. package/themes/franchises/src/components/BusinessInformation/index.tsx +0 -202
  55. package/themes/franchises/src/components/BusinessInformation/styles.tsx +0 -39
  56. package/themes/franchises/src/components/BusinessItemAccordion/index.tsx +0 -125
  57. package/themes/franchises/src/components/BusinessItemAccordion/styles.tsx +0 -54
  58. package/themes/franchises/src/components/BusinessProductsCategories/index.tsx +0 -87
  59. package/themes/franchises/src/components/BusinessProductsCategories/styles.tsx +0 -8
  60. package/themes/franchises/src/components/BusinessProductsList/index.tsx +0 -199
  61. package/themes/franchises/src/components/BusinessProductsList/styles.tsx +0 -14
  62. package/themes/franchises/src/components/BusinessProductsListing/index.tsx +0 -292
  63. package/themes/franchises/src/components/BusinessProductsListing/styles.tsx +0 -30
  64. package/themes/franchises/src/components/BusinessReviews/index.tsx +0 -249
  65. package/themes/franchises/src/components/BusinessReviews/styles.tsx +0 -59
  66. package/themes/franchises/src/components/BusinessTypeFilter/index.tsx +0 -127
  67. package/themes/franchises/src/components/BusinessTypeFilter/styles.tsx +0 -40
  68. package/themes/franchises/src/components/BusinessesListing/index.tsx +0 -339
  69. package/themes/franchises/src/components/BusinessesListing/styles.tsx +0 -92
  70. package/themes/franchises/src/components/Cart/index.tsx +0 -298
  71. package/themes/franchises/src/components/Cart/styles.tsx +0 -28
  72. package/themes/franchises/src/components/CartContent/index.tsx +0 -60
  73. package/themes/franchises/src/components/CartContent/styles.tsx +0 -19
  74. package/themes/franchises/src/components/Checkout/index.tsx +0 -664
  75. package/themes/franchises/src/components/Checkout/styles.tsx +0 -89
  76. package/themes/franchises/src/components/CouponControl/index.tsx +0 -119
  77. package/themes/franchises/src/components/CouponControl/styles.tsx +0 -22
  78. package/themes/franchises/src/components/DriverTips/index.tsx +0 -167
  79. package/themes/franchises/src/components/DriverTips/styles.tsx +0 -63
  80. package/themes/franchises/src/components/FacebookLogin/index.tsx +0 -107
  81. package/themes/franchises/src/components/FacebookLogin/styles.tsx +0 -21
  82. package/themes/franchises/src/components/FloatingButton/index.tsx +0 -100
  83. package/themes/franchises/src/components/FloatingButton/styles.tsx +0 -26
  84. package/themes/franchises/src/components/ForgotPasswordForm/index.tsx +0 -156
  85. package/themes/franchises/src/components/ForgotPasswordForm/styles.tsx +0 -11
  86. package/themes/franchises/src/components/GPSButton/index.tsx +0 -84
  87. package/themes/franchises/src/components/GPSButton/styles.ts +0 -6
  88. package/themes/franchises/src/components/GoogleLogin/index.tsx +0 -122
  89. package/themes/franchises/src/components/GoogleLogin/styles.tsx +0 -23
  90. package/themes/franchises/src/components/GoogleMap/index.tsx +0 -229
  91. package/themes/franchises/src/components/Help/index.tsx +0 -56
  92. package/themes/franchises/src/components/Help/styles.tsx +0 -11
  93. package/themes/franchises/src/components/HelpAccountAndPayment/index.tsx +0 -68
  94. package/themes/franchises/src/components/HelpAccountAndPayment/styles.tsx +0 -6
  95. package/themes/franchises/src/components/HelpGuide/index.tsx +0 -67
  96. package/themes/franchises/src/components/HelpGuide/styles.tsx +0 -6
  97. package/themes/franchises/src/components/HelpOrder/index.tsx +0 -79
  98. package/themes/franchises/src/components/HelpOrder/styles.tsx +0 -6
  99. package/themes/franchises/src/components/Home/index.tsx +0 -102
  100. package/themes/franchises/src/components/Home/styles.tsx +0 -18
  101. package/themes/franchises/src/components/LanguageSelector/index.tsx +0 -98
  102. package/themes/franchises/src/components/LanguageSelector/styles.tsx +0 -7
  103. package/themes/franchises/src/components/LastOrder/index.tsx +0 -168
  104. package/themes/franchises/src/components/LastOrder/styles.tsx +0 -16
  105. package/themes/franchises/src/components/LastOrders/index.tsx +0 -104
  106. package/themes/franchises/src/components/LastOrders/styles.tsx +0 -17
  107. package/themes/franchises/src/components/LoginForm/index.tsx +0 -512
  108. package/themes/franchises/src/components/LoginForm/styles.tsx +0 -77
  109. package/themes/franchises/src/components/LogoutButton/index.tsx +0 -36
  110. package/themes/franchises/src/components/Messages/index.tsx +0 -359
  111. package/themes/franchises/src/components/Messages/styles.tsx +0 -20
  112. package/themes/franchises/src/components/MomentOption/index.tsx +0 -321
  113. package/themes/franchises/src/components/MomentOption/styles.tsx +0 -66
  114. package/themes/franchises/src/components/NavBar/index.tsx +0 -129
  115. package/themes/franchises/src/components/NotFoundSource/index.tsx +0 -50
  116. package/themes/franchises/src/components/NotFoundSource/styles.tsx +0 -16
  117. package/themes/franchises/src/components/Notifications/index.tsx +0 -120
  118. package/themes/franchises/src/components/Notifications/styles.ts +0 -21
  119. package/themes/franchises/src/components/OrderDetails/index.tsx +0 -820
  120. package/themes/franchises/src/components/OrderDetails/styles.tsx +0 -120
  121. package/themes/franchises/src/components/OrderSummary/index.tsx +0 -232
  122. package/themes/franchises/src/components/OrderSummary/styles.tsx +0 -41
  123. package/themes/franchises/src/components/OrderTypeSelector/index.tsx +0 -92
  124. package/themes/franchises/src/components/OrderTypeSelector/styles.tsx +0 -27
  125. package/themes/franchises/src/components/OrdersOption/index.tsx +0 -243
  126. package/themes/franchises/src/components/OrdersOption/styles.tsx +0 -5
  127. package/themes/franchises/src/components/PaymentOptionCash/index.tsx +0 -102
  128. package/themes/franchises/src/components/PaymentOptionCash/styles.tsx +0 -18
  129. package/themes/franchises/src/components/PaymentOptionStripe/index.tsx +0 -234
  130. package/themes/franchises/src/components/PaymentOptionStripe/styles.tsx +0 -71
  131. package/themes/franchises/src/components/PaymentOptions/index.tsx +0 -430
  132. package/themes/franchises/src/components/PaymentOptions/styles.tsx +0 -77
  133. package/themes/franchises/src/components/PhoneInputNumber/index.tsx +0 -127
  134. package/themes/franchises/src/components/PhoneInputNumber/styles.tsx +0 -3
  135. package/themes/franchises/src/components/PreviousOrders/index.tsx +0 -188
  136. package/themes/franchises/src/components/PreviousOrders/styles.tsx +0 -33
  137. package/themes/franchises/src/components/ProductForm/index.tsx +0 -695
  138. package/themes/franchises/src/components/ProductForm/styles.tsx +0 -78
  139. package/themes/franchises/src/components/ProductIngredient/index.tsx +0 -43
  140. package/themes/franchises/src/components/ProductIngredient/styles.tsx +0 -7
  141. package/themes/franchises/src/components/ProductItemAccordion/index.tsx +0 -276
  142. package/themes/franchises/src/components/ProductItemAccordion/styles.tsx +0 -57
  143. package/themes/franchises/src/components/ProductOption/index.tsx +0 -50
  144. package/themes/franchises/src/components/ProductOption/styles.tsx +0 -11
  145. package/themes/franchises/src/components/ProductOptionSubOption/index.tsx +0 -146
  146. package/themes/franchises/src/components/ProductOptionSubOption/styles.tsx +0 -32
  147. package/themes/franchises/src/components/ReviewDriver/index.tsx +0 -221
  148. package/themes/franchises/src/components/ReviewDriver/styles.tsx +0 -46
  149. package/themes/franchises/src/components/ReviewOrder/index.tsx +0 -325
  150. package/themes/franchises/src/components/ReviewOrder/styles.tsx +0 -46
  151. package/themes/franchises/src/components/ReviewProduct/index.tsx +0 -275
  152. package/themes/franchises/src/components/ReviewProduct/styles.tsx +0 -53
  153. package/themes/franchises/src/components/SearchBar/index.tsx +0 -139
  154. package/themes/franchises/src/components/SignupForm/index.tsx +0 -643
  155. package/themes/franchises/src/components/SignupForm/styles.tsx +0 -27
  156. package/themes/franchises/src/components/SingleProductCard/index.tsx +0 -124
  157. package/themes/franchises/src/components/SingleProductCard/styles.tsx +0 -23
  158. package/themes/franchises/src/components/StripeCardForm/index.tsx +0 -97
  159. package/themes/franchises/src/components/StripeCardForm/naked.tsx +0 -128
  160. package/themes/franchises/src/components/StripeCardForm/styles.tsx +0 -32
  161. package/themes/franchises/src/components/StripeCardsList/index.tsx +0 -182
  162. package/themes/franchises/src/components/StripeElementsForm/index.tsx +0 -204
  163. package/themes/franchises/src/components/StripeElementsForm/naked.tsx +0 -90
  164. package/themes/franchises/src/components/StripeElementsForm/styles.tsx +0 -13
  165. package/themes/franchises/src/components/StripeRedirectForm/index.tsx +0 -159
  166. package/themes/franchises/src/components/StripeRedirectForm/styles.tsx +0 -23
  167. package/themes/franchises/src/components/TagSelector/index.tsx +0 -94
  168. package/themes/franchises/src/components/TagSelector/styles.ts +0 -0
  169. package/themes/franchises/src/components/TaxInformation/index.tsx +0 -51
  170. package/themes/franchises/src/components/TaxInformation/styles.tsx +0 -9
  171. package/themes/franchises/src/components/UpsellingProducts/index.tsx +0 -222
  172. package/themes/franchises/src/components/UpsellingProducts/styles.tsx +0 -50
  173. package/themes/franchises/src/components/UserDetails/index.tsx +0 -134
  174. package/themes/franchises/src/components/UserDetails/styles.tsx +0 -26
  175. package/themes/franchises/src/components/UserFormDetails/index.tsx +0 -351
  176. package/themes/franchises/src/components/UserFormDetails/styles.tsx +0 -35
  177. package/themes/franchises/src/components/UserProfile/index.tsx +0 -179
  178. package/themes/franchises/src/components/UserProfile/styles.ts +0 -42
  179. package/themes/franchises/src/components/UserProfileForm/index.tsx +0 -253
  180. package/themes/franchises/src/components/UserProfileForm/styles.tsx +0 -29
  181. package/themes/franchises/src/components/VerifyPhone/index.tsx +0 -188
  182. package/themes/franchises/src/components/VerifyPhone/styles.tsx +0 -43
  183. package/themes/franchises/src/components/shared/OAlert.tsx +0 -55
  184. package/themes/franchises/src/components/shared/OBottomPopup.tsx +0 -73
  185. package/themes/franchises/src/components/shared/OBottomStickBar.tsx +0 -62
  186. package/themes/franchises/src/components/shared/OButton.tsx +0 -132
  187. package/themes/franchises/src/components/shared/ODropDown.tsx +0 -169
  188. package/themes/franchises/src/components/shared/OIcon.tsx +0 -53
  189. package/themes/franchises/src/components/shared/OIconButton.tsx +0 -127
  190. package/themes/franchises/src/components/shared/OIconText.tsx +0 -54
  191. package/themes/franchises/src/components/shared/OInput.tsx +0 -113
  192. package/themes/franchises/src/components/shared/OKeyButton.tsx +0 -35
  193. package/themes/franchises/src/components/shared/OModal.tsx +0 -172
  194. package/themes/franchises/src/components/shared/OText.tsx +0 -52
  195. package/themes/franchises/src/components/shared/OTextarea.tsx +0 -36
  196. package/themes/franchises/src/components/shared/OToast.tsx +0 -93
  197. package/themes/franchises/src/components/shared/OToggle.tsx +0 -158
  198. package/themes/franchises/src/components/shared/index.tsx +0 -29
  199. package/themes/franchises/src/config/constants.tsx +0 -57
  200. package/themes/franchises/src/layouts/Container.tsx +0 -23
  201. package/themes/franchises/src/layouts/SafeAreaContainer.tsx +0 -6
  202. package/themes/franchises/src/providers/AlertProvider.tsx +0 -43
  203. package/themes/franchises/src/providers/StoreUtil.tsx +0 -50
  204. package/themes/franchises/src/types/index.tsx +0 -445
  205. package/themes/franchises/src/utils/index.tsx +0 -222
@@ -1,339 +0,0 @@
1
- import React, { useEffect, useState } from 'react';
2
- import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
3
- import {
4
- View,
5
- StyleSheet,
6
- ScrollView,
7
- Platform,
8
- TouchableOpacity,
9
- } from 'react-native';
10
- import {
11
- BusinessList as BusinessesListingController,
12
- useLanguage,
13
- useSession,
14
- useOrder,
15
- useConfig,
16
- useUtils,
17
- } from 'ordering-components/native';
18
- import { useTheme } from 'styled-components/native';
19
-
20
- import {
21
- Search,
22
- OrderControlContainer,
23
- AddressInput,
24
- WrapMomentOption,
25
- HeaderWrapper,
26
- ListWrapper,
27
- FeaturedWrapper,
28
- HeaderContainer,
29
- SearchWrap,
30
- DistanceWarning,
31
- } from './styles';
32
-
33
- import { SearchBar } from '../SearchBar';
34
- import { OIcon, OText } from '../shared';
35
- import { BusinessesListingParams } from '../../types';
36
- import { NotFoundSource } from '../NotFoundSource';
37
- import { BusinessTypeFilter } from '../BusinessTypeFilter';
38
- import { BusinessController } from '../BusinessController';
39
- import { OrderTypeSelector } from '../OrderTypeSelector';
40
- import { useSafeAreaInsets } from 'react-native-safe-area-context';
41
- import { BusinessFeaturedController } from '../BusinessFeaturedController';
42
- import { getTypesText } from '../../utils';
43
-
44
- const PIXELS_TO_SCROLL = 1000;
45
-
46
- const BusinessesListingUI = (props: BusinessesListingParams) => {
47
- const {
48
- navigation,
49
- businessesList,
50
- searchValue,
51
- getBusinesses,
52
- handleChangeBusinessType,
53
- handleBusinessClick,
54
- paginationProps,
55
- handleChangeSearch,
56
- } = props;
57
-
58
- const theme = useTheme();
59
-
60
- const styles = StyleSheet.create({
61
- container: {
62
- marginBottom: 0,
63
- },
64
- welcome: {
65
- flex: 1,
66
- flexDirection: 'row',
67
- },
68
- inputStyle: {
69
- backgroundColor: theme.colors.inputDisabled,
70
- flex: 1,
71
- },
72
- wrapperOrderOptions: {
73
- width: '100%',
74
- flexDirection: 'row',
75
- justifyContent: 'flex-start',
76
- marginBottom: 10,
77
- zIndex: 100,
78
- },
79
- searchInput: {
80
- fontSize: 14,
81
- }
82
- });
83
-
84
-
85
- const [, t] = useLanguage();
86
- const [{ user, auth }] = useSession();
87
- const [orderState] = useOrder();
88
- const [{ configs }] = useConfig();
89
- const [{ parseDate }] = useUtils();
90
-
91
- const { top } = useSafeAreaInsets();
92
-
93
- const [featuredBusiness, setFeaturedBusinesses] = useState([]);
94
-
95
- // const timerId = useRef<any>(false)
96
- // const panResponder = useRef(
97
- // PanResponder.create({
98
- // onMoveShouldSetPanResponder: (e, gestureState) => {
99
- // const {dx, dy} = gestureState;
100
- // resetInactivityTimeout()
101
- // return (Math.abs(dx) > 20) || (Math.abs(dy) > 20);
102
- // },
103
- // })
104
- // ).current
105
-
106
- const configTypes =
107
- configs?.order_types_allowed?.value
108
- .split('|')
109
- .map((value: any) => Number(value)) || [];
110
-
111
- const handleScroll = ({ nativeEvent }: any) => {
112
- const y = nativeEvent.contentOffset.y;
113
- const height = nativeEvent.contentSize.height;
114
- const hasMore = !(
115
- paginationProps.totalPages === paginationProps.currentPage
116
- );
117
-
118
- if (y + PIXELS_TO_SCROLL > height && !businessesList.loading && hasMore) {
119
- getBusinesses();
120
- }
121
- };
122
-
123
- useEffect(() => {
124
- if (businessesList.businesses.length > 0) {
125
- const fb = businessesList.businesses.filter((b) => b.reviews?.total === 5);
126
- // const ary = [];
127
- // while (fb.length > 0) {
128
- // ary.push(fb.splice(0, 2));
129
- // }
130
- setFeaturedBusinesses(fb as Array<never>);
131
- }
132
- }, [businessesList.businesses]);
133
- // const resetInactivityTimeout = () => {
134
- // clearTimeout(timerId.current)
135
- // timerId.current = setInterval(() => {
136
- // getBusinesses(true)
137
- // }, 600000)
138
- // }
139
-
140
- // useEffect(() => {
141
- // resetInactivityTimeout()
142
- // }, [])
143
-
144
- return (
145
- <ScrollView style={styles.container} onScroll={(e) => handleScroll(e)} showsVerticalScrollIndicator={false}>
146
- <HeaderContainer>
147
- <HeaderWrapper
148
- source={theme.images.backgrounds.business_list_header}
149
- style={{ paddingTop: 40 }}>
150
- {!auth && (
151
- <TouchableOpacity onPress={() => navigation?.canGoBack() && navigation.goBack()} style={{ position: 'absolute', marginStart: 40, paddingVertical: 20 }}>
152
- <OIcon src={theme.images.general.arrow_left} width={20} style={{ tintColor: theme.colors.white }} />
153
- </TouchableOpacity>
154
- )}
155
- <Search>
156
- <AddressInput
157
- onPress={() =>
158
- auth
159
- ? navigation.navigate('AddressList', { isFromBusinesses: true })
160
- : navigation.navigate('AddressForm', {
161
- address: orderState.options?.address,
162
- isFromBusinesses: true,
163
- })
164
- }>
165
- <OIcon
166
- src={theme.images.general.pin}
167
- color={theme.colors.disabled}
168
- width={16}
169
- style={{ marginRight: 10 }}
170
- />
171
- <OText size={12} weight={'bold'} numberOfLines={1} style={{ width: '90%' }}>
172
- {orderState?.options?.address?.address}
173
- </OText>
174
- </AddressInput>
175
- <DistanceWarning>
176
- <OIcon src={theme.images.general.warning} width={16} />
177
- <OText size={12} lineHeight={18} mLeft={10}>{t('YOU_FAR_FROM_THIS_ADDRESS', 'You are far from this address')}</OText>
178
- </DistanceWarning>
179
- </Search>
180
- <OrderControlContainer>
181
- <View style={styles.wrapperOrderOptions}>
182
- <WrapMomentOption activeOpacity={0.7} onPress={() => navigation.navigate('OrderTypes', { configTypes: configTypes })}>
183
- <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textSecondary}>{t(getTypesText(orderState?.options?.type || 1), 'Delivery')}</OText>
184
- <OIcon
185
- src={theme.images.general.arrow_down}
186
- width={10}
187
- style={{ marginStart: 8 }}
188
- />
189
- </WrapMomentOption>
190
- <WrapMomentOption
191
- onPress={() => navigation.navigate('MomentOption')}>
192
- <OText
193
- size={12}
194
- numberOfLines={1}
195
- ellipsizeMode="tail"
196
- color={theme.colors.textSecondary}>
197
- {orderState.options?.moment
198
- ? parseDate(orderState.options?.moment, {
199
- outputFormat:
200
- configs?.format_time?.value === '12'
201
- ? 'MM/DD hh:mma'
202
- : 'MM/DD HH:mm',
203
- })
204
- : t('ASAP_ABBREVIATION', 'ASAP')}
205
- </OText>
206
- <OIcon
207
- src={theme.images.general.arrow_down}
208
- width={10}
209
- style={{ marginStart: 8 }}
210
- />
211
- </WrapMomentOption>
212
- </View>
213
- </OrderControlContainer>
214
- </HeaderWrapper>
215
- <SearchWrap>
216
- <SearchBar
217
- onSearch={handleChangeSearch}
218
- searchValue={searchValue}
219
- lazyLoad
220
- isCancelXButtonShow={!!searchValue}
221
- onCancel={() => handleChangeSearch('')}
222
- placeholder={t('SEARCH_BUSINESS', 'Search business')}
223
- height={27}
224
- inputStyle={{ ...styles.searchInput, ...Platform.OS === 'ios' ? {} : { paddingBottom: 4 } }}
225
- inputWrapStyle={{ paddingLeft: 0, paddingRight: 0, paddingBottom: 12}}
226
- showFilter
227
- onHandleFilter={() => {}}
228
- />
229
- </SearchWrap>
230
- </HeaderContainer>
231
- <View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100 }} />
232
- {featuredBusiness && featuredBusiness.length > 0 && (
233
- <FeaturedWrapper>
234
- <OText size={16} style={{ marginLeft: 40 }} weight={Platform.OS === 'ios' ? '600' : 'bold'}>{t('HIGHEST_RATED', 'Highest rated')}</OText>
235
- <OText size={12} lineHeight={22} style={{ marginLeft: 40 }} >{t('TOP_RATING_GREAT_SERVICE', 'Top ratings and great service')}</OText>
236
- <ListWrapper>
237
- {featuredBusiness.map((business: any) => (
238
- <BusinessController
239
- key={business.id}
240
- business={business}
241
- handleCustomClick={handleBusinessClick}
242
- orderType={orderState?.options?.type}
243
- />
244
- ))}
245
- </ListWrapper>
246
- </FeaturedWrapper>
247
- )}
248
- <View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100 }} />
249
- <ListWrapper>
250
- {/* <BusinessTypeFilter
251
- images={props.images}
252
- businessTypes={props.businessTypes}
253
- defaultBusinessType={props.defaultBusinessType}
254
- handleChangeBusinessType={handleChangeBusinessType}
255
- /> */}
256
- {!businessesList.loading && businessesList.businesses.length === 0 && (
257
- <NotFoundSource
258
- content={t(
259
- 'NOT_FOUND_BUSINESSES',
260
- 'No businesses to delivery / pick up at this address, please change filters or change address.',
261
- )}
262
- />
263
- )}
264
- {businessesList.businesses?.map(
265
- (business: any) =>
266
- !business.featured && (
267
- <BusinessController
268
- key={business.id}
269
- business={business}
270
- handleCustomClick={handleBusinessClick}
271
- orderType={orderState?.options?.type}
272
- />
273
- ),
274
- )}
275
- {businessesList.loading && (
276
- <>
277
- {[
278
- ...Array(
279
- paginationProps.nextPageItems
280
- ? paginationProps.nextPageItems
281
- : 8,
282
- ).keys(),
283
- ].map((item, i) => (
284
- <Placeholder
285
- Animation={Fade}
286
- key={i}
287
- style={{ marginBottom: 20 }}>
288
- <View style={{ width: '100%' }}>
289
- <PlaceholderLine
290
- height={200}
291
- style={{ marginBottom: 20, borderRadius: 25 }}
292
- />
293
- <View style={{ paddingHorizontal: 10 }}>
294
- <View
295
- style={{
296
- flexDirection: 'row',
297
- justifyContent: 'space-between',
298
- }}>
299
- <PlaceholderLine
300
- height={25}
301
- width={40}
302
- style={{ marginBottom: 10 }}
303
- />
304
- <PlaceholderLine
305
- height={25}
306
- width={20}
307
- style={{ marginBottom: 10 }}
308
- />
309
- </View>
310
- <PlaceholderLine
311
- height={20}
312
- width={30}
313
- style={{ marginBottom: 10 }}
314
- />
315
- <PlaceholderLine
316
- height={20}
317
- width={80}
318
- style={{ marginBottom: 10 }}
319
- />
320
- </View>
321
- </View>
322
- </Placeholder>
323
- ))}
324
- </>
325
- )}
326
- </ListWrapper>
327
- </ScrollView>
328
- );
329
- };
330
-
331
- export const BusinessesListing = (props: BusinessesListingParams) => {
332
- const BusinessesListingProps = {
333
- ...props,
334
- isForceSearch: Platform.OS === 'ios',
335
- UIComponent: BusinessesListingUI,
336
- };
337
-
338
- return <BusinessesListingController {...BusinessesListingProps} />;
339
- };
@@ -1,92 +0,0 @@
1
- import styled from 'styled-components/native'
2
-
3
- export const WelcomeTitle = styled.View`
4
- flex: 1;
5
- flex-direction: row;
6
- align-items: center;
7
- margin-bottom: 15px;
8
- `
9
-
10
- export const BusinessList = styled.View`
11
- flex-wrap: wrap;
12
- `
13
-
14
- export const Search = styled.View`
15
- justify-content: flex-end;
16
- align-items: center;
17
- margin-vertical: 10px;
18
- `
19
-
20
- export const DistanceWarning = styled.View`
21
- border-radius: 7.6px;
22
- border-width: 1px;
23
- border-color: ${(props: any) => props.theme.colors.warningDark};
24
- background-color: ${(props: any) => props.theme.colors.warning};
25
- padding: 2px 16px;
26
- margin-top: 11px;
27
- flex-direction: row;
28
- align-items: center;
29
- width: 100%;
30
- `
31
-
32
- export const AddressInput = styled.TouchableOpacity`
33
- flex-direction: row;
34
- background-color: ${(props: any) => props.theme.colors.white};
35
- border-radius: 22px;
36
- padding-horizontal: 20px;
37
- align-items: center;
38
- width: 100%;
39
- height: 44px;
40
- max-height: 44px;
41
- `
42
-
43
- export const OrderControlContainer = styled.View`
44
- width: 100%;
45
- flex-direction: column;
46
- align-items: center;
47
- justify-content: space-between;
48
- z-index: 10;
49
- padding-bottom: 20px;
50
- margin-top: 12px;
51
- flex: 1;
52
- `
53
-
54
- export const WrapMomentOption = styled.TouchableOpacity`
55
- background-color: ${(props: any) => props.theme.colors.backgroundGray100};
56
- border-radius: 7.6px;
57
- font-size: 12px;
58
- max-width: 240px;
59
- height: 26px;
60
- align-items: center;
61
- justify-content: center;
62
- padding-horizontal: 8px;
63
- flex-direction: row;
64
- margin-end: 19px;
65
- `
66
-
67
- export const HeaderWrapper = styled.ImageBackground`
68
- width: 100%;
69
- height: 224px;
70
- padding: 20px 40px;
71
- background-color: transparent;
72
- `;
73
-
74
- export const HeaderContainer = styled.View`
75
- background-color: white;
76
- `;
77
- export const SearchWrap = styled.View`
78
- background-color: white;
79
- min-height: 80px;
80
- padding: 30px 40px 20px;
81
- `;
82
-
83
- export const ListWrapper = styled.View`
84
- background-color: ${(props: any) => props.theme.colors.backgroundLight};
85
- padding-horizontal: 40px;
86
- padding-top: 12px;
87
- `;
88
-
89
- export const FeaturedWrapper = styled.View`
90
- background-color: ${(props: any) => props.theme.colors.backgroundLight};
91
- paddingVertical: 24px;
92
- `;