ordering-ui-react-native 0.16.30 → 0.16.33

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 (24) hide show
  1. package/package.json +2 -1
  2. package/src/components/AddressForm/index.tsx +4 -1
  3. package/themes/business/src/components/Chat/index.tsx +4 -4
  4. package/themes/original/index.tsx +8 -0
  5. package/themes/original/src/components/BusinessBasicInformation/index.tsx +1 -1
  6. package/themes/original/src/components/BusinessProductsListing/index.tsx +255 -208
  7. package/themes/original/src/components/BusinessProductsListing/styles.tsx +5 -0
  8. package/themes/original/src/components/BusinessTypeFilter/index.tsx +106 -38
  9. package/themes/original/src/components/BusinessTypeFilter/styles.tsx +2 -0
  10. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +549 -0
  11. package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +106 -0
  12. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +519 -0
  13. package/themes/original/src/components/BusinessesListing/{styles.tsx → Layout/Original/styles.tsx} +0 -0
  14. package/themes/original/src/components/BusinessesListing/index.tsx +13 -515
  15. package/themes/original/src/components/MomentSelector/index.tsx +197 -0
  16. package/themes/original/src/components/MomentSelector/styles.tsx +6 -0
  17. package/themes/original/src/components/ProfessionalFilter/index.tsx +128 -0
  18. package/themes/original/src/components/ProfessionalFilter/styles.tsx +0 -0
  19. package/themes/original/src/components/ProfessionalProfile/index.tsx +297 -0
  20. package/themes/original/src/components/ProfessionalProfile/styles.tsx +46 -0
  21. package/themes/original/src/components/ServiceForm/index.tsx +485 -0
  22. package/themes/original/src/components/ServiceForm/styles.tsx +50 -0
  23. package/themes/original/src/types/index.tsx +31 -1
  24. 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
- <BCContainer>
76
- {typesState?.loading && (
77
- <View>
78
- <Placeholder style={{ marginVertical: 10 }} Animation={Fade}>
79
- <ScrollView
80
- horizontal
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
- {[...Array(4)].map((_, i) => (
84
- <View
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
- style={{ width: 80, borderRadius: 10, marginRight: 15 }}>
87
- <PlaceholderLine height={80} noMargin />
88
- </View>
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
- </ScrollView>
91
- </Placeholder>
92
- </View>
93
- )}
94
- {!typesState?.loading &&
95
- !typesState?.error &&
96
- typesState?.types &&
97
- typesState?.types.length > 0 && (
98
- <>
99
- <BusinessCategories>
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
- showsHorizontalScrollIndicator={false}
103
- data={typesState?.types}
104
- renderItem={renderTypes}
105
- keyExtractor={(type, index) => `${type.name}_${index}`}
106
- />
107
- <TouchableOpacity
108
- style={{ marginLeft: 15 }}
109
- onPress={() => setIsOpenAllCategories(true)}
110
- >
111
- <OText size={12} color={theme.colors.primary}>{t('SEE_ALL', 'See All')}</OText>
112
- </TouchableOpacity>
113
- </BusinessCategories>
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
- </BCContainer>
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
 
@@ -39,3 +39,5 @@ export const IconContainer = styled.View`
39
39
  border-radius: 10px;
40
40
  height: 60px;
41
41
  `
42
+
43
+ export const ServiceWrapper = styled.ScrollView``