ordering-ui-react-native 0.11.24 → 0.11.28
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.
- package/package.json +1 -1
- package/src/components/BusinessTypeFilter/index.tsx +155 -105
- package/themes/business/src/components/OrderDetails/Delivery.tsx +4 -2
- package/themes/business/src/components/OrdersOption/index.tsx +4 -4
- package/themes/business/src/types/index.tsx +6 -0
- package/themes/doordash/src/components/BusinessTypeFilter/index.tsx +152 -84
- package/themes/doordash/src/components/BusinessTypeFilter/styles.tsx +1 -2
- package/themes/kiosk/src/components/BusinessMenu/index.tsx +5 -6
- package/themes/kiosk/src/components/BusinessProductsListing/index.tsx +6 -14
- package/themes/kiosk/src/components/Cart/index.tsx +75 -60
- package/themes/kiosk/src/components/Cart/styles.tsx +19 -1
- package/themes/kiosk/src/components/CartBottomSheet/index.tsx +5 -2
- package/themes/kiosk/src/components/CartItem/index.tsx +144 -57
- package/themes/kiosk/src/components/CartItem/styles.tsx +24 -0
- package/themes/kiosk/src/components/CategoriesMenu/index.tsx +9 -18
- package/themes/kiosk/src/components/LoginForm/index.tsx +1 -8
- package/themes/kiosk/src/components/OrderDetails/index.tsx +132 -82
- package/themes/kiosk/src/components/OrderDetails/styles.tsx +22 -1
- package/themes/kiosk/src/components/PaymentOptions/index.tsx +2 -1
- package/themes/kiosk/src/components/ProductForm/index.tsx +7 -2
- package/themes/kiosk/src/components/ProductOption/index.tsx +1 -1
- package/themes/kiosk/src/components/ProductOption/styles.tsx +2 -2
- package/themes/kiosk/src/components/ProductOptionSubOption/index.tsx +56 -52
- package/themes/kiosk/src/components/ProductOptionSubOption/styles.tsx +10 -0
- package/themes/kiosk/src/components/UpsellingProducts/index.tsx +41 -38
- package/themes/kiosk/src/components/shared/OCard.tsx +1 -1
- package/themes/kiosk/src/components/shared/OInput.tsx +4 -0
- package/themes/kiosk/src/types/index.d.ts +3 -0
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +118 -44
- package/themes/original/src/components/BusinessTypeFilter/styles.tsx +4 -4
- package/themes/original/src/components/BusinessesListing/index.tsx +3 -0
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +122 -0
- package/themes/original/src/components/HighestRatedBusinesses/styles.tsx +7 -0
- package/themes/original/src/types/index.tsx +4 -0
- package/themes/uber-eats/src/components/BusinessTypeFilter/index.tsx +151 -76
- package/themes/uber-eats/src/components/BusinessTypeFilter/styles.tsx +0 -9
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import React from 'react'
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
2
|
import { StyleSheet, View, ScrollView, TouchableOpacity, Dimensions } from 'react-native'
|
|
3
3
|
import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder'
|
|
4
4
|
import { BusinessTypeFilter as BusinessTypeFilterController, useLanguage } from 'ordering-components/native'
|
|
5
5
|
|
|
6
6
|
import { BusinessCategoriesTitle, BusinessCategories, Category, BCContainer } from './styles'
|
|
7
|
-
import { OIcon, OText } from '../shared'
|
|
7
|
+
import { OIcon, OText, OModal } from '../shared'
|
|
8
8
|
import { BusinessTypeFilterParams } from '../../types'
|
|
9
9
|
import { useTheme } from 'styled-components/native'
|
|
10
|
+
import MaterialIcon from 'react-native-vector-icons/MaterialCommunityIcons';
|
|
10
11
|
|
|
11
|
-
import Carousel from 'react-native-snap-carousel';
|
|
12
12
|
const windowWidth = Dimensions.get('window').width;
|
|
13
13
|
|
|
14
14
|
export const BusinessTypeFilterUI = (props: BusinessTypeFilterParams) => {
|
|
@@ -20,122 +20,172 @@ export const BusinessTypeFilterUI = (props: BusinessTypeFilterParams) => {
|
|
|
20
20
|
|
|
21
21
|
const theme = useTheme();
|
|
22
22
|
const [, t] = useLanguage();
|
|
23
|
+
const [isOpenAllCategories, setIsOpenAllCategories] = useState(false)
|
|
23
24
|
|
|
24
|
-
const
|
|
25
|
+
const styles = StyleSheet.create({
|
|
26
|
+
icons: {
|
|
27
|
+
padding: 10
|
|
28
|
+
},
|
|
29
|
+
logo: {
|
|
30
|
+
width: isOpenAllCategories ? windowWidth / 3 - 27 : windowWidth / 4 - 20,
|
|
31
|
+
height: isOpenAllCategories ? windowWidth / 3 - 27 : windowWidth / 4 - 20,
|
|
32
|
+
marginBottom: 15,
|
|
33
|
+
borderRadius: 8,
|
|
34
|
+
justifyContent: 'center',
|
|
35
|
+
alignItems: 'center',
|
|
36
|
+
},
|
|
37
|
+
categoryStyle: {
|
|
38
|
+
width: isOpenAllCategories ? windowWidth / 3 - 27 : windowWidth / 4 - 20,
|
|
39
|
+
height: 150,
|
|
40
|
+
flexDirection: 'column',
|
|
41
|
+
justifyContent: 'center',
|
|
42
|
+
alignItems: 'center',
|
|
43
|
+
marginHorizontal: isOpenAllCategories ? 10 : 0,
|
|
44
|
+
marginBottom: isOpenAllCategories ? 40 : 0
|
|
45
|
+
},
|
|
46
|
+
allCategoriesContainer : {
|
|
47
|
+
paddingHorizontal: 10,
|
|
48
|
+
paddingVertical: 30
|
|
49
|
+
},
|
|
50
|
+
allCategoriesWrapper: {
|
|
51
|
+
flexDirection: 'row',
|
|
52
|
+
flexWrap: 'wrap',
|
|
53
|
+
}
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
const RenderTypes = ({ item }: any ) => {
|
|
25
57
|
return (
|
|
26
58
|
<TouchableOpacity
|
|
27
|
-
|
|
28
|
-
onPress={() =>
|
|
59
|
+
style={styles.categoryStyle}
|
|
60
|
+
onPress={() => {
|
|
61
|
+
handleChangeBusinessType(item.id)
|
|
62
|
+
isOpenAllCategories && setIsOpenAllCategories(false)
|
|
63
|
+
}}
|
|
29
64
|
>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
</OText>
|
|
51
|
-
</Category>
|
|
65
|
+
{item.image ? (
|
|
66
|
+
<OIcon
|
|
67
|
+
url={item.image}
|
|
68
|
+
style={styles.logo}
|
|
69
|
+
/>
|
|
70
|
+
) : (
|
|
71
|
+
<OIcon
|
|
72
|
+
src={theme.images.categories.all}
|
|
73
|
+
style={styles.logo}
|
|
74
|
+
/>
|
|
75
|
+
)}
|
|
76
|
+
<OText
|
|
77
|
+
style={{ textAlign: 'center' }}
|
|
78
|
+
size={14}
|
|
79
|
+
color={currentTypeSelected === item.id ? theme.colors.primary : theme.colors.textSecondary}
|
|
80
|
+
numberOfLines={1}
|
|
81
|
+
ellipsizeMode='tail'
|
|
82
|
+
>
|
|
83
|
+
{t(`BUSINESS_TYPE_${item.name.replace(/\s/g, '_').toUpperCase()}`, item.name)}
|
|
84
|
+
</OText>
|
|
52
85
|
</TouchableOpacity>
|
|
53
86
|
)
|
|
54
87
|
}
|
|
55
88
|
|
|
56
|
-
let _carousel: Carousel<any> | null;
|
|
57
|
-
|
|
58
|
-
const typeSelectedIndex = typesState?.types?.length > 0
|
|
59
|
-
? typesState?.types.findIndex((type: any) => type.id === (currentTypeSelected ?? 0))
|
|
60
|
-
: 0
|
|
61
|
-
|
|
62
89
|
return (
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
<
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
<ScrollView
|
|
71
|
-
horizontal
|
|
72
|
-
showsVerticalScrollIndicator={false}
|
|
73
|
-
showsHorizontalScrollIndicator={false}
|
|
90
|
+
<>
|
|
91
|
+
<BCContainer>
|
|
92
|
+
{typesState?.loading && (
|
|
93
|
+
<View>
|
|
94
|
+
<Placeholder
|
|
95
|
+
style={{ marginVertical: 10 }}
|
|
96
|
+
Animation={Fade}
|
|
74
97
|
>
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
98
|
+
<ScrollView
|
|
99
|
+
horizontal
|
|
100
|
+
showsVerticalScrollIndicator={false}
|
|
101
|
+
showsHorizontalScrollIndicator={false}
|
|
102
|
+
>
|
|
103
|
+
{[...Array(4)].map((_, i) => (
|
|
104
|
+
<View key={i} style={{ width: 80, borderRadius: 8, marginRight: 15 }}>
|
|
105
|
+
<PlaceholderLine
|
|
106
|
+
height={80}
|
|
107
|
+
noMargin
|
|
108
|
+
/>
|
|
109
|
+
</View>
|
|
110
|
+
))}
|
|
111
|
+
</ScrollView>
|
|
112
|
+
</Placeholder>
|
|
113
|
+
</View>
|
|
114
|
+
)}
|
|
115
|
+
{!typesState?.loading && !typesState?.error && typesState?.types && typesState?.types.length > 0 && (
|
|
116
|
+
<>
|
|
117
|
+
<BusinessCategoriesTitle>
|
|
118
|
+
<OText
|
|
119
|
+
size={16}
|
|
120
|
+
color={theme.colors.textSecondary}
|
|
121
|
+
>
|
|
122
|
+
{t('BUSINESS_CATEGORIES', 'Business Categories')}
|
|
123
|
+
</OText>
|
|
124
|
+
</BusinessCategoriesTitle>
|
|
125
|
+
<BusinessCategories>
|
|
126
|
+
{typesState?.types.slice(0, 3).map((type: any) => (
|
|
127
|
+
<RenderTypes
|
|
128
|
+
key={type.id}
|
|
129
|
+
item={type}
|
|
130
|
+
/>
|
|
82
131
|
))}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
132
|
+
{typesState?.types.length > 3 && (
|
|
133
|
+
<TouchableOpacity
|
|
134
|
+
style={styles.categoryStyle}
|
|
135
|
+
onPress={() => setIsOpenAllCategories(true)}
|
|
136
|
+
>
|
|
137
|
+
<View
|
|
138
|
+
style={{ ...styles.logo, backgroundColor: theme.colors.lightGray }}
|
|
139
|
+
>
|
|
140
|
+
<MaterialIcon
|
|
141
|
+
name='dots-horizontal'
|
|
142
|
+
size={32}
|
|
143
|
+
color={theme.colors.black}
|
|
144
|
+
/>
|
|
145
|
+
</View>
|
|
146
|
+
<OText
|
|
147
|
+
style={{ textAlign: 'center' }}
|
|
148
|
+
size={14}
|
|
149
|
+
color={theme.colors.textSecondary}
|
|
150
|
+
numberOfLines={1}
|
|
151
|
+
ellipsizeMode='tail'
|
|
152
|
+
>
|
|
153
|
+
{t('SEE_ALL', 'See all')}
|
|
154
|
+
</OText>
|
|
155
|
+
</TouchableOpacity>
|
|
156
|
+
)}
|
|
157
|
+
</BusinessCategories>
|
|
158
|
+
</>
|
|
159
|
+
)}
|
|
160
|
+
</BCContainer>
|
|
161
|
+
<OModal
|
|
162
|
+
open={isOpenAllCategories}
|
|
163
|
+
onClose={() => setIsOpenAllCategories(false)}
|
|
164
|
+
entireModal
|
|
165
|
+
>
|
|
166
|
+
<ScrollView style={styles.allCategoriesContainer}>
|
|
167
|
+
<OText
|
|
168
|
+
size={20}
|
|
169
|
+
mBottom={30}
|
|
170
|
+
color={theme.colors.textSecondary}
|
|
171
|
+
style={{ paddingHorizontal: 10 }}
|
|
172
|
+
>
|
|
173
|
+
{t('ALL_CATEGORIES', 'All categories')}
|
|
174
|
+
</OText>
|
|
175
|
+
<View style={styles.allCategoriesWrapper}>
|
|
176
|
+
{typesState?.types.map((type: any) => (
|
|
177
|
+
<RenderTypes
|
|
178
|
+
key={type.id}
|
|
179
|
+
item={type}
|
|
180
|
+
/>
|
|
181
|
+
))}
|
|
182
|
+
</View>
|
|
183
|
+
</ScrollView>
|
|
184
|
+
</OModal>
|
|
185
|
+
</>
|
|
122
186
|
)
|
|
123
187
|
}
|
|
124
188
|
|
|
125
|
-
const styles = StyleSheet.create({
|
|
126
|
-
icons: {
|
|
127
|
-
padding: 10
|
|
128
|
-
},
|
|
129
|
-
logo: {
|
|
130
|
-
width: 75,
|
|
131
|
-
height: 75,
|
|
132
|
-
marginBottom: 15,
|
|
133
|
-
borderRadius: 25,
|
|
134
|
-
justifyContent: 'center',
|
|
135
|
-
alignItems: 'center',
|
|
136
|
-
},
|
|
137
|
-
})
|
|
138
|
-
|
|
139
189
|
export const BusinessTypeFilter = (props: BusinessTypeFilterParams) => {
|
|
140
190
|
const businessTypeFilterProps = {
|
|
141
191
|
...props,
|
|
@@ -75,6 +75,8 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
75
75
|
const showFloatButtonsPickUp: any = {
|
|
76
76
|
8: true,
|
|
77
77
|
3: true,
|
|
78
|
+
4: true,
|
|
79
|
+
18: true
|
|
78
80
|
};
|
|
79
81
|
|
|
80
82
|
const showFloatButtonsAcceptOrReject: any = {
|
|
@@ -278,7 +280,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
278
280
|
showsVerticalScrollIndicator={false}>
|
|
279
281
|
<>
|
|
280
282
|
<OrderContentComponent order={order} />
|
|
281
|
-
{order?.status === 8 && order?.delivery_type === 1 && (
|
|
283
|
+
{(order?.status === 8 || order?.status === 18) && order?.delivery_type === 1 && (
|
|
282
284
|
<Pickup>
|
|
283
285
|
<OButton
|
|
284
286
|
style={styles.btnPickUp}
|
|
@@ -380,7 +382,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
380
382
|
widthButton={'45%'}
|
|
381
383
|
/>
|
|
382
384
|
)}
|
|
383
|
-
{order?.status === 9 && (
|
|
385
|
+
{(order?.status === 9 || order?.status === 19) && (
|
|
384
386
|
<>
|
|
385
387
|
<FloatingButton
|
|
386
388
|
disabled={loading}
|
|
@@ -490,25 +490,25 @@ export const OrdersOption = (props: OrdersOptionParams) => {
|
|
|
490
490
|
{
|
|
491
491
|
key: 0,
|
|
492
492
|
text: t('PENDING', 'Pending'),
|
|
493
|
-
tags: [0, 13],
|
|
493
|
+
tags: props?.orderGroupStatusCustom?.inProgress ?? [0, 13],
|
|
494
494
|
title: 'pending'
|
|
495
495
|
},
|
|
496
496
|
{
|
|
497
497
|
key: 1,
|
|
498
498
|
text: t('IN_PROGRESS', 'In Progress'),
|
|
499
|
-
tags: [3, 4, 7, 8, 9, 14, 18, 19, 20, 21],
|
|
499
|
+
tags: props?.orderGroupStatusCustom?.inProgress ?? [3, 4, 7, 8, 9, 14, 18, 19, 20, 21],
|
|
500
500
|
title: 'inProgress',
|
|
501
501
|
},
|
|
502
502
|
{
|
|
503
503
|
key: 2,
|
|
504
504
|
text: t('COMPLETED', 'Completed'),
|
|
505
|
-
tags: [1, 11, 15],
|
|
505
|
+
tags: props?.orderGroupStatusCustom?.completed ?? [1, 11, 15],
|
|
506
506
|
title: 'completed',
|
|
507
507
|
},
|
|
508
508
|
{
|
|
509
509
|
key: 3,
|
|
510
510
|
text: t('CANCELLED', 'Cancelled'),
|
|
511
|
-
tags: [2, 5, 6, 10, 12, 16, 17],
|
|
511
|
+
tags: props?.orderGroupStatusCustom?.cancelled ?? [2, 5, 6, 10, 12, 16, 17],
|
|
512
512
|
title: 'cancelled',
|
|
513
513
|
},
|
|
514
514
|
]
|
|
@@ -276,6 +276,12 @@ export interface OrdersOptionParams {
|
|
|
276
276
|
setOrdersGroup?: any;
|
|
277
277
|
setCurrentFilters?: any;
|
|
278
278
|
handleClickOrder?: any;
|
|
279
|
+
orderGroupStatusCustom?: {
|
|
280
|
+
pending?: Array<number>;
|
|
281
|
+
inProgress?: Array<number>;
|
|
282
|
+
completed?: Array<number>;
|
|
283
|
+
cancelled?: Array<number>;
|
|
284
|
+
};
|
|
279
285
|
}
|
|
280
286
|
export interface ActiveOrdersParams {
|
|
281
287
|
orders?: any;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import React from 'react'
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
2
|
import { StyleSheet, FlatList, View, ScrollView, TouchableOpacity } from 'react-native'
|
|
3
3
|
import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder'
|
|
4
4
|
import { BusinessTypeFilter as BusinessTypeFilterController, useLanguage } from 'ordering-components/native'
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { BusinessCategories, Category, BCContainer } from './styles'
|
|
7
7
|
import { OIcon, OText } from '../shared'
|
|
8
|
+
import { OModal } from '../../../../../src/components/shared'
|
|
8
9
|
import { useTheme } from 'styled-components/native'
|
|
9
10
|
import { BusinessTypeFilterParams } from '../../types'
|
|
10
11
|
import { useWindowDimensions } from 'react-native'
|
|
12
|
+
import MaterialIcon from 'react-native-vector-icons/MaterialCommunityIcons';
|
|
11
13
|
|
|
12
14
|
export const BusinessTypeFilterUI = (props: BusinessTypeFilterParams) => {
|
|
13
15
|
const {
|
|
@@ -18,103 +20,169 @@ export const BusinessTypeFilterUI = (props: BusinessTypeFilterParams) => {
|
|
|
18
20
|
|
|
19
21
|
const theme = useTheme();
|
|
20
22
|
const [, t] = useLanguage();
|
|
21
|
-
const { width } = useWindowDimensions();
|
|
23
|
+
const { width, height } = useWindowDimensions();
|
|
24
|
+
const [isOpenAllCategories, setIsOpenAllCategories] = useState(false)
|
|
22
25
|
|
|
23
|
-
const
|
|
26
|
+
const styles = StyleSheet.create({
|
|
27
|
+
icons: {
|
|
28
|
+
padding: 10
|
|
29
|
+
},
|
|
30
|
+
logo: {
|
|
31
|
+
width: isOpenAllCategories ? width / 3 - 27 : width / 4 - 30,
|
|
32
|
+
height: isOpenAllCategories ? width / 3 - 27 : width / 4 - 30,
|
|
33
|
+
marginBottom: 15,
|
|
34
|
+
borderRadius: 8,
|
|
35
|
+
justifyContent: 'center',
|
|
36
|
+
alignItems: 'center',
|
|
37
|
+
},
|
|
38
|
+
categoryStyle: {
|
|
39
|
+
width: isOpenAllCategories ? width / 3 - 27 : width / 4 - 30,
|
|
40
|
+
height: 120,
|
|
41
|
+
flexDirection: 'column',
|
|
42
|
+
justifyContent: 'center',
|
|
43
|
+
alignItems: 'center',
|
|
44
|
+
marginHorizontal: isOpenAllCategories ? 10 : 0,
|
|
45
|
+
marginBottom: isOpenAllCategories ? 40 : 0
|
|
46
|
+
},
|
|
47
|
+
allCategoriesContainer : {
|
|
48
|
+
paddingHorizontal: 10,
|
|
49
|
+
paddingVertical: 30,
|
|
50
|
+
height: height,
|
|
51
|
+
backgroundColor: 'white',
|
|
52
|
+
flex: 1
|
|
53
|
+
},
|
|
54
|
+
allCategoriesWrapper: {
|
|
55
|
+
flexDirection: 'row',
|
|
56
|
+
flexWrap: 'wrap',
|
|
57
|
+
}
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
const RenderTypes = ({ item }: any) => {
|
|
24
61
|
return (
|
|
25
62
|
<TouchableOpacity
|
|
26
63
|
key={item.id}
|
|
27
|
-
|
|
64
|
+
style={styles.categoryStyle}
|
|
65
|
+
onPress={() => {
|
|
66
|
+
handleChangeBusinessType(item.id)
|
|
67
|
+
isOpenAllCategories && setIsOpenAllCategories(false)
|
|
68
|
+
}}
|
|
28
69
|
>
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
</Category>
|
|
70
|
+
{item.image ? (
|
|
71
|
+
<OIcon
|
|
72
|
+
url={item.image}
|
|
73
|
+
style={styles.logo}
|
|
74
|
+
/>
|
|
75
|
+
) : (
|
|
76
|
+
<OIcon
|
|
77
|
+
src={theme.images.categories.all}
|
|
78
|
+
style={styles.logo}
|
|
79
|
+
/>
|
|
80
|
+
)}
|
|
81
|
+
<OText
|
|
82
|
+
style={{ textAlign: 'center' }}
|
|
83
|
+
size={12}
|
|
84
|
+
weight={'400'}
|
|
85
|
+
color={currentTypeSelected === item.id ? theme.colors.textPrimary : theme.colors.textSecondary}
|
|
86
|
+
numberOfLines={1}
|
|
87
|
+
>
|
|
88
|
+
{t(`BUSINESS_TYPE_${item.name.replace(/\s/g, '_').toUpperCase()}`, item.name)}
|
|
89
|
+
</OText>
|
|
50
90
|
</TouchableOpacity>
|
|
51
91
|
)
|
|
52
92
|
}
|
|
53
93
|
|
|
54
94
|
return (
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
<
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
<ScrollView
|
|
63
|
-
horizontal
|
|
64
|
-
showsVerticalScrollIndicator={false}
|
|
65
|
-
showsHorizontalScrollIndicator={false}
|
|
95
|
+
<>
|
|
96
|
+
<BCContainer>
|
|
97
|
+
{typesState?.loading && (
|
|
98
|
+
<View>
|
|
99
|
+
<Placeholder
|
|
100
|
+
style={{ marginVertical: 10 }}
|
|
101
|
+
Animation={Fade}
|
|
66
102
|
>
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
103
|
+
<ScrollView
|
|
104
|
+
horizontal
|
|
105
|
+
showsVerticalScrollIndicator={false}
|
|
106
|
+
showsHorizontalScrollIndicator={false}
|
|
107
|
+
>
|
|
108
|
+
{[...Array(4)].map((_, i) => (
|
|
109
|
+
<View key={i} style={{ width: 80, borderRadius: 8, marginRight: 15 }}>
|
|
110
|
+
<PlaceholderLine
|
|
111
|
+
height={80}
|
|
112
|
+
noMargin
|
|
113
|
+
/>
|
|
114
|
+
</View>
|
|
115
|
+
))}
|
|
116
|
+
</ScrollView>
|
|
117
|
+
</Placeholder>
|
|
118
|
+
</View>
|
|
119
|
+
)}
|
|
120
|
+
{!typesState?.loading && !typesState?.error && typesState?.types && typesState?.types.length > 0 && (
|
|
121
|
+
<>
|
|
122
|
+
<BusinessCategories>
|
|
123
|
+
{typesState?.types.slice(0, 3).map((type: any) => (
|
|
124
|
+
<RenderTypes
|
|
125
|
+
key={type.id}
|
|
126
|
+
item={type}
|
|
127
|
+
/>
|
|
74
128
|
))}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
129
|
+
{typesState?.types.length > 3 && (
|
|
130
|
+
<TouchableOpacity
|
|
131
|
+
style={styles.categoryStyle}
|
|
132
|
+
onPress={() => setIsOpenAllCategories(true)}
|
|
133
|
+
>
|
|
134
|
+
<View
|
|
135
|
+
style={{ ...styles.logo, backgroundColor: theme.colors.lightGray }}
|
|
136
|
+
>
|
|
137
|
+
<MaterialIcon
|
|
138
|
+
name='dots-horizontal'
|
|
139
|
+
size={32}
|
|
140
|
+
color={theme.colors.black}
|
|
141
|
+
/>
|
|
142
|
+
</View>
|
|
143
|
+
<OText
|
|
144
|
+
style={{ textAlign: 'center' }}
|
|
145
|
+
size={12}
|
|
146
|
+
color={theme.colors.textSecondary}
|
|
147
|
+
numberOfLines={1}
|
|
148
|
+
ellipsizeMode='tail'
|
|
149
|
+
>
|
|
150
|
+
{t('SEE_ALL', 'See All')}
|
|
151
|
+
</OText>
|
|
152
|
+
</TouchableOpacity>
|
|
153
|
+
)}
|
|
154
|
+
</BusinessCategories>
|
|
155
|
+
</>
|
|
156
|
+
)}
|
|
157
|
+
</BCContainer>
|
|
158
|
+
<OModal
|
|
159
|
+
open={isOpenAllCategories}
|
|
160
|
+
onClose={() => setIsOpenAllCategories(false)}
|
|
161
|
+
entireModal
|
|
162
|
+
>
|
|
163
|
+
<ScrollView style={styles.allCategoriesContainer}>
|
|
164
|
+
<OText
|
|
165
|
+
size={20}
|
|
166
|
+
mBottom={30}
|
|
167
|
+
color={theme.colors.textSecondary}
|
|
168
|
+
style={{ paddingHorizontal: 10 }}
|
|
169
|
+
>
|
|
170
|
+
{t('ALL_CATEGORIES', 'All categories')}
|
|
171
|
+
</OText>
|
|
172
|
+
<View style={styles.allCategoriesWrapper}>
|
|
173
|
+
{typesState?.types.map((type: any) => (
|
|
174
|
+
<RenderTypes
|
|
175
|
+
key={type.id}
|
|
176
|
+
item={type}
|
|
177
|
+
/>
|
|
178
|
+
))}
|
|
179
|
+
</View>
|
|
180
|
+
</ScrollView>
|
|
181
|
+
</OModal>
|
|
182
|
+
</>
|
|
102
183
|
)
|
|
103
184
|
}
|
|
104
185
|
|
|
105
|
-
const styles = StyleSheet.create({
|
|
106
|
-
icons: {
|
|
107
|
-
padding: 10
|
|
108
|
-
},
|
|
109
|
-
logo: {
|
|
110
|
-
width: 52,
|
|
111
|
-
height: 52,
|
|
112
|
-
marginBottom: 7,
|
|
113
|
-
justifyContent: 'center',
|
|
114
|
-
alignItems: 'center',
|
|
115
|
-
},
|
|
116
|
-
})
|
|
117
|
-
|
|
118
186
|
export const BusinessTypeFilter = (props: BusinessTypeFilterParams) => {
|
|
119
187
|
const businessTypeFilterProps = {
|
|
120
188
|
...props,
|
|
@@ -5,7 +5,6 @@ export const BCContainer = styled.View`
|
|
|
5
5
|
width: 100%;
|
|
6
6
|
justify-content: flex-start;
|
|
7
7
|
text-align: center;
|
|
8
|
-
min-height: 140px;
|
|
9
8
|
`
|
|
10
9
|
|
|
11
10
|
export const BusinessCategoriesTitle = styled.View`
|
|
@@ -19,7 +18,7 @@ export const BusinessCategories = styled.View`
|
|
|
19
18
|
display: flex;
|
|
20
19
|
flex-direction: row;
|
|
21
20
|
justify-content: space-between;
|
|
22
|
-
margin:
|
|
21
|
+
margin: 10px 0px;
|
|
23
22
|
width: 100%;
|
|
24
23
|
`
|
|
25
24
|
export const Category = styled.View`
|