ordering-ui-react-native 0.16.28 → 0.16.31
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 +2 -1
- package/src/components/AddressForm/index.tsx +15 -2
- package/themes/original/index.tsx +8 -0
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +1 -1
- package/themes/original/src/components/BusinessListingSearch/index.tsx +3 -2
- package/themes/original/src/components/BusinessProductsListing/index.tsx +255 -208
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +5 -0
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +106 -38
- package/themes/original/src/components/BusinessTypeFilter/styles.tsx +2 -0
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +549 -0
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +106 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +519 -0
- package/themes/original/src/components/BusinessesListing/{styles.tsx → Layout/Original/styles.tsx} +0 -0
- package/themes/original/src/components/BusinessesListing/index.tsx +13 -515
- package/themes/original/src/components/MomentSelector/index.tsx +197 -0
- package/themes/original/src/components/MomentSelector/styles.tsx +6 -0
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +7 -4
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +14 -12
- package/themes/original/src/components/ProfessionalFilter/index.tsx +128 -0
- package/themes/original/src/components/ProfessionalFilter/styles.tsx +0 -0
- package/themes/original/src/components/ProfessionalProfile/index.tsx +297 -0
- package/themes/original/src/components/ProfessionalProfile/styles.tsx +46 -0
- package/themes/original/src/components/ServiceForm/index.tsx +485 -0
- package/themes/original/src/components/ServiceForm/styles.tsx +50 -0
- package/themes/original/src/types/index.tsx +31 -1
- package/themes/original/src/utils/index.tsx +11 -0
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
Dimensions
|
|
9
9
|
} from 'react-native';
|
|
10
10
|
import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
|
|
11
|
+
import { OButton } from '../shared'
|
|
11
12
|
import {
|
|
12
13
|
BusinessTypeFilter as BusinessTypeFilterController,
|
|
13
14
|
useLanguage,
|
|
@@ -17,6 +18,7 @@ import {
|
|
|
17
18
|
BusinessCategories,
|
|
18
19
|
Category,
|
|
19
20
|
BCContainer,
|
|
21
|
+
ServiceWrapper
|
|
20
22
|
} from './styles';
|
|
21
23
|
import { OIcon, OText, OModal } from '../shared';
|
|
22
24
|
import { BusinessTypeFilterParams } from '../../types';
|
|
@@ -28,7 +30,8 @@ export const BusinessTypeFilterUI = (props: BusinessTypeFilterParams) => {
|
|
|
28
30
|
typesState,
|
|
29
31
|
currentTypeSelected,
|
|
30
32
|
handleChangeBusinessType,
|
|
31
|
-
setBusinessTypes
|
|
33
|
+
setBusinessTypes,
|
|
34
|
+
isAppoint
|
|
32
35
|
} = props;
|
|
33
36
|
|
|
34
37
|
const [, t] = useLanguage();
|
|
@@ -42,6 +45,15 @@ export const BusinessTypeFilterUI = (props: BusinessTypeFilterParams) => {
|
|
|
42
45
|
}
|
|
43
46
|
}, [typesState])
|
|
44
47
|
|
|
48
|
+
const handleChangeServiceType = (serviceId: any) => {
|
|
49
|
+
if (serviceId === currentTypeSelected) {
|
|
50
|
+
handleChangeBusinessType(null)
|
|
51
|
+
return
|
|
52
|
+
}
|
|
53
|
+
handleChangeBusinessType(serviceId)
|
|
54
|
+
isOpenAllCategories && setIsOpenAllCategories(false)
|
|
55
|
+
}
|
|
56
|
+
|
|
45
57
|
const renderTypes = ({ item }: any) => {
|
|
46
58
|
return (
|
|
47
59
|
<TouchableOpacity
|
|
@@ -72,48 +84,95 @@ export const BusinessTypeFilterUI = (props: BusinessTypeFilterParams) => {
|
|
|
72
84
|
|
|
73
85
|
return (
|
|
74
86
|
<>
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
<
|
|
79
|
-
<
|
|
80
|
-
|
|
87
|
+
{isAppoint ? (
|
|
88
|
+
<>
|
|
89
|
+
{typesState?.loading && (
|
|
90
|
+
<View>
|
|
91
|
+
<Placeholder Animation={Fade}>
|
|
92
|
+
<ScrollView
|
|
93
|
+
horizontal
|
|
94
|
+
showsVerticalScrollIndicator={false}
|
|
95
|
+
showsHorizontalScrollIndicator={false}>
|
|
96
|
+
{[...Array(4)].map((_, i) => (
|
|
97
|
+
<View
|
|
98
|
+
key={i}
|
|
99
|
+
style={{ width: 80, borderRadius: 50, marginRight: 10 }}>
|
|
100
|
+
<PlaceholderLine height={25} noMargin />
|
|
101
|
+
</View>
|
|
102
|
+
))}
|
|
103
|
+
</ScrollView>
|
|
104
|
+
</Placeholder>
|
|
105
|
+
</View>
|
|
106
|
+
)}
|
|
107
|
+
{
|
|
108
|
+
!typesState?.loading &&
|
|
109
|
+
!typesState?.error &&
|
|
110
|
+
typesState?.types &&
|
|
111
|
+
typesState?.types.length > 0 && (
|
|
112
|
+
<ServiceWrapper
|
|
81
113
|
showsVerticalScrollIndicator={false}
|
|
82
|
-
showsHorizontalScrollIndicator={false}
|
|
83
|
-
|
|
84
|
-
|
|
114
|
+
showsHorizontalScrollIndicator={false}
|
|
115
|
+
horizontal
|
|
116
|
+
>
|
|
117
|
+
{typesState?.types.length > 0 && typesState?.types.map((businessType: any, i: number) => (
|
|
118
|
+
<OButton
|
|
85
119
|
key={i}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
120
|
+
bgColor={(currentTypeSelected === businessType?.id) ? theme.colors.primary : theme.colors.backgroundGray200}
|
|
121
|
+
onClick={() => handleChangeServiceType(businessType?.id)}
|
|
122
|
+
text={`${businessType?.name} ${(currentTypeSelected === businessType?.id) ? ' X' : ''}`}
|
|
123
|
+
style={styles.businessType}
|
|
124
|
+
textStyle={{ fontSize: 10, color: (currentTypeSelected === businessType?.id) ? theme.colors.backgroundLight : theme.colors.textNormal }}
|
|
125
|
+
/>
|
|
89
126
|
))}
|
|
90
|
-
</
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
typesState?.
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
<FlatList
|
|
127
|
+
</ServiceWrapper>
|
|
128
|
+
)
|
|
129
|
+
}
|
|
130
|
+
</>
|
|
131
|
+
) : (
|
|
132
|
+
<BCContainer>
|
|
133
|
+
{typesState?.loading && (
|
|
134
|
+
<View>
|
|
135
|
+
<Placeholder style={{ marginVertical: 10 }} Animation={Fade}>
|
|
136
|
+
<ScrollView
|
|
101
137
|
horizontal
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
</>
|
|
138
|
+
showsVerticalScrollIndicator={false}
|
|
139
|
+
showsHorizontalScrollIndicator={false}>
|
|
140
|
+
{[...Array(4)].map((_, i) => (
|
|
141
|
+
<View
|
|
142
|
+
key={i}
|
|
143
|
+
style={{ width: 80, borderRadius: 10, marginRight: 15 }}>
|
|
144
|
+
<PlaceholderLine height={80} noMargin />
|
|
145
|
+
</View>
|
|
146
|
+
))}
|
|
147
|
+
</ScrollView>
|
|
148
|
+
</Placeholder>
|
|
149
|
+
</View>
|
|
115
150
|
)}
|
|
116
|
-
|
|
151
|
+
{!typesState?.loading &&
|
|
152
|
+
!typesState?.error &&
|
|
153
|
+
typesState?.types &&
|
|
154
|
+
typesState?.types.length > 0 && (
|
|
155
|
+
<>
|
|
156
|
+
<BusinessCategories>
|
|
157
|
+
<FlatList
|
|
158
|
+
horizontal
|
|
159
|
+
showsHorizontalScrollIndicator={false}
|
|
160
|
+
data={typesState?.types}
|
|
161
|
+
renderItem={renderTypes}
|
|
162
|
+
keyExtractor={(type, index) => `${type.name}_${index}`}
|
|
163
|
+
/>
|
|
164
|
+
<TouchableOpacity
|
|
165
|
+
style={{ marginLeft: 15 }}
|
|
166
|
+
onPress={() => setIsOpenAllCategories(true)}
|
|
167
|
+
>
|
|
168
|
+
<OText size={12} color={theme.colors.primary}>{t('SEE_ALL', 'See All')}</OText>
|
|
169
|
+
</TouchableOpacity>
|
|
170
|
+
</BusinessCategories>
|
|
171
|
+
</>
|
|
172
|
+
)}
|
|
173
|
+
</BCContainer>
|
|
174
|
+
)}
|
|
175
|
+
|
|
117
176
|
<OModal
|
|
118
177
|
open={isOpenAllCategories}
|
|
119
178
|
onClose={() => setIsOpenAllCategories(false)}
|
|
@@ -195,6 +254,15 @@ const styles = StyleSheet.create({
|
|
|
195
254
|
allCategoriesWrapper: {
|
|
196
255
|
flexDirection: 'row',
|
|
197
256
|
flexWrap: 'wrap',
|
|
257
|
+
},
|
|
258
|
+
businessType: {
|
|
259
|
+
marginRight: 10,
|
|
260
|
+
borderRadius: 50,
|
|
261
|
+
paddingVertical: 4,
|
|
262
|
+
paddingLeft: 5,
|
|
263
|
+
paddingRight: 5,
|
|
264
|
+
height: 27,
|
|
265
|
+
borderWidth: 0
|
|
198
266
|
}
|
|
199
267
|
});
|
|
200
268
|
|