ordering-ui-react-native 0.12.5 → 0.12.9

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 (35) hide show
  1. package/package.json +1 -1
  2. package/src/components/BusinessBasicInformation/index.tsx +14 -8
  3. package/src/components/PreviousOrders/index.tsx +21 -9
  4. package/src/components/ProductItemAccordion/index.tsx +1 -1
  5. package/themes/instacart/src/components/BusinessProductsList/index.tsx +38 -30
  6. package/themes/instacart/src/components/BusinessProductsListing/index.tsx +44 -3
  7. package/themes/instacart/src/components/BusinessProductsListing/styles.tsx +1 -1
  8. package/themes/instacart/src/types/index.tsx +1 -0
  9. package/themes/kiosk/src/components/BusinessProductsListing/index.tsx +2 -2
  10. package/themes/kiosk/src/components/CategoriesMenu/index.tsx +2 -2
  11. package/themes/kiosk/src/components/NavBar/index.tsx +3 -2
  12. package/themes/kiosk/src/components/OrderDetails/index.tsx +8 -2
  13. package/themes/kiosk/src/components/UpsellingProducts/index.tsx +1 -1
  14. package/themes/single-business/index.tsx +4 -0
  15. package/themes/single-business/src/components/AddressForm/index.tsx +39 -44
  16. package/themes/single-business/src/components/BusinessInformation/styles.tsx +1 -1
  17. package/themes/single-business/src/components/Cart/index.tsx +301 -234
  18. package/themes/single-business/src/components/Cart/styles.tsx +34 -0
  19. package/themes/single-business/src/components/Messages/index.tsx +4 -4
  20. package/themes/single-business/src/components/Messages/styles.tsx +1 -1
  21. package/themes/single-business/src/components/PromotionCard/index.tsx +103 -0
  22. package/themes/single-business/src/components/PromotionCard/styles.tsx +28 -0
  23. package/themes/single-business/src/components/Promotions/index.tsx +78 -0
  24. package/themes/single-business/src/components/Promotions/styles.tsx +3 -0
  25. package/themes/single-business/src/components/UpsellingProducts/styles.tsx +2 -1
  26. package/themes/uber-eats/src/components/BusinessController/index.tsx +1 -1
  27. package/themes/uber-eats/src/components/BusinessProductsCategories/index.tsx +77 -9
  28. package/themes/uber-eats/src/components/BusinessProductsList/index.tsx +56 -10
  29. package/themes/uber-eats/src/components/BusinessProductsListing/index.tsx +50 -9
  30. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +4 -0
  31. package/themes/uber-eats/src/components/HighestRatedBusinesses/index.tsx +132 -0
  32. package/themes/uber-eats/src/components/HighestRatedBusinesses/styles.tsx +6 -0
  33. package/themes/uber-eats/src/components/Messages/index.tsx +1 -1
  34. package/themes/uber-eats/src/components/OrderDetails/index.tsx +4 -2
  35. package/themes/uber-eats/src/types/index.tsx +12 -1
@@ -0,0 +1,132 @@
1
+ import React from 'react';
2
+ import {
3
+ BusinessList as BusinessesListingController,
4
+ useLanguage,
5
+ useOrder
6
+ } from 'ordering-components/native';
7
+ import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
8
+ import { View, ScrollView, Platform, Dimensions } from 'react-native';
9
+ import { OText } from '../shared';
10
+ import { HighestRatedBusinessesParams } from '../../types';
11
+ import { BusinessController } from '../BusinessController'
12
+ import { NotFoundSource } from '../NotFoundSource'
13
+ import {
14
+ ListWrapper
15
+ } from './styles'
16
+
17
+ const HighestRatedBusinessesUI = (props: HighestRatedBusinessesParams) => {
18
+ const {
19
+ businessesList,
20
+ onBusinessClick
21
+ } = props;
22
+
23
+ const [, t] = useLanguage()
24
+ const [orderState] = useOrder();
25
+
26
+ const windowWidth = Dimensions.get('window').width;
27
+
28
+ return (
29
+ <>
30
+ <ListWrapper>
31
+ <OText size={16} mBottom={5} weight={Platform.OS === 'ios' ? '600' : 'bold'}>{t('HIGHEST_RATED', 'Highest rated')}</OText>
32
+ <OText size={12}>{t('TOP_RATINGS_AND_GREAT_SERVICE', 'Top ratings and great service')}</OText>
33
+ <ScrollView
34
+ showsHorizontalScrollIndicator={false}
35
+ nestedScrollEnabled
36
+ horizontal
37
+ style={{ height: 330 }}
38
+ >
39
+ {businessesList.loading ? (
40
+ <>
41
+ {[
42
+ ...Array(10).keys()
43
+ ].map((item, i) => (
44
+ <Placeholder
45
+ Animation={Fade}
46
+ key={i}
47
+ style={{
48
+ marginTop: 20,
49
+ width: windowWidth - 100,
50
+ paddingHorizontal: 5,
51
+ height: '100%'
52
+ }}>
53
+ <View style={{ width: '100%' }}>
54
+ <PlaceholderLine
55
+ height={180}
56
+ style={{ marginBottom: 20, borderRadius: 8 }}
57
+ />
58
+ <View style={{ paddingHorizontal: 10 }}>
59
+ <View
60
+ style={{
61
+ flexDirection: 'row',
62
+ justifyContent: 'space-between',
63
+ }}>
64
+ <PlaceholderLine
65
+ height={15}
66
+ width={40}
67
+ style={{ marginBottom: 15 }}
68
+ />
69
+ <PlaceholderLine
70
+ height={15}
71
+ width={20}
72
+ style={{ marginBottom: 15 }}
73
+ />
74
+ </View>
75
+ <PlaceholderLine
76
+ height={15}
77
+ width={30}
78
+ style={{ marginBottom: 10 }}
79
+ />
80
+ <PlaceholderLine
81
+ height={15}
82
+ width={80}
83
+ style={{ marginBottom: 10 }}
84
+ />
85
+ </View>
86
+ </View>
87
+ </Placeholder>
88
+ ))}
89
+ </>
90
+ ) : (
91
+ <>
92
+ {businessesList.businesses.length > 0 ? (
93
+ businessesList.businesses?.map(
94
+ (business: any) => (
95
+ <View
96
+ key={business.id}
97
+ style={{
98
+ width: windowWidth - 100,
99
+ paddingHorizontal: 5,
100
+ height: '100%'
101
+ }}
102
+ >
103
+ <BusinessController
104
+ business={business}
105
+ handleCustomClick={onBusinessClick}
106
+ orderType={orderState?.options?.type}
107
+ isBusinessOpen={business?.open}
108
+ />
109
+ </View>
110
+ )
111
+ )
112
+ ) : (
113
+ <NotFoundSource />
114
+ )}
115
+ </>
116
+ )}
117
+ </ScrollView>
118
+ </ListWrapper>
119
+ </>
120
+ )
121
+ }
122
+
123
+ export const HighestRatedBusinesses = (props: any) => {
124
+ const highestRatedBusinessesProps = {
125
+ ...props,
126
+ UIComponent: HighestRatedBusinessesUI,
127
+ initialOrderByValue: 'rating',
128
+ propsToFetch: ['id', 'name', 'header', 'logo', 'location', 'schedule', 'open', 'delivery_price', 'distance', 'delivery_time', 'pickup_time', 'reviews', 'featured', 'offers', 'food', 'laundry', 'alcohol', 'groceries', 'slug'],
129
+ };
130
+
131
+ return <BusinessesListingController {...highestRatedBusinessesProps} />;
132
+ };
@@ -0,0 +1,6 @@
1
+ import styled from 'styled-components/native'
2
+
3
+ export const ListWrapper = styled.View`
4
+ background-color: ${(props: any) => props.theme.colors.backgroundLight};
5
+ margin-top: 30px;
6
+ `;
@@ -108,7 +108,7 @@ const MessagesUI = (props: MessagesParams) => {
108
108
 
109
109
  useEffect(() => {
110
110
  let newMessages: Array<any> = []
111
- const console = `${t('ORDER_PLACED_FOR', 'Order placed for')} ${parseDate(order?.created_at)} ${t('VIA', 'Via')} ${order?.app_id ? t(order?.app_id.toUpperCase(), order?.app_id) : t('OTHER', 'Other')}`
111
+ const console = `${t('ORDER_PLACED_FOR', 'Order placed for')} ${parseDate(order?.created_at)}`
112
112
  const firstMessage = {
113
113
  _id: 0,
114
114
  text: console,
@@ -210,7 +210,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
210
210
  display: 'flex',
211
211
  flexDirection: 'column',
212
212
  alignItems: 'flex-start',
213
- flexGrow: 1
213
+ width: '70%'
214
214
  }}
215
215
  >
216
216
  <View>
@@ -223,7 +223,9 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
223
223
  {order?.business?.name}
224
224
  </OText>
225
225
  </View>
226
- <OText color={theme.colors.gray} numberOfLines={1}>{order?.business?.address}</OText>
226
+ <OText color={theme.colors.gray} numberOfLines={1}>
227
+ {order?.business?.address}
228
+ </OText>
227
229
  <OText>
228
230
  {
229
231
  order?.delivery_datetime_utc
@@ -182,6 +182,11 @@ export interface BusinessProductsCategoriesParams {
182
182
  categorySelected: any;
183
183
  featured: boolean;
184
184
  loading?: any;
185
+ scrollViewRef?: any;
186
+ productListLayout?: any;
187
+ categoriesLayout?: any;
188
+ selectedCategoryId?: any;
189
+ lazyLoadProductsRecommended?: any;
185
190
  }
186
191
  export interface BusinessProductsListParams {
187
192
  errors?: any;
@@ -196,7 +201,9 @@ export interface BusinessProductsListParams {
196
201
  handleClearSearch?: (value: any) => {};
197
202
  isBusinessLoading?: any,
198
203
  errorQuantityProducts?: boolean,
199
- handleCancelSearch?: () => void
204
+ handleCancelSearch?: () => void,
205
+ categoriesLayout?: any,
206
+ setCategoriesLayout?: any
200
207
  }
201
208
  export interface SingleProductCardParams {
202
209
  businessId: any,
@@ -438,3 +445,7 @@ export interface HelpGuideParams {
438
445
  export interface HelpAccountAndPaymentParams {
439
446
  navigation: any;
440
447
  }
448
+ export interface HighestRatedBusinessesParams {
449
+ businessesList: { businesses: Array<any>, loading: boolean, error: null | string };
450
+ onBusinessClick?: void;
451
+ }