ordering-ui-react-native 0.17.13 → 0.17.14

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-react-native",
3
- "version": "0.17.13",
3
+ "version": "0.17.14",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -139,7 +139,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
139
139
 
140
140
  const onProductClick = (product: any) => {
141
141
  const productAddedToCartLength = currentCart?.products?.reduce((productsLength: number, Cproduct: any) => { return productsLength + (Cproduct?.id === product?.id ? Cproduct?.quantity : 0) }, 0)
142
- if (product?.type === 'service' && professionalSelected) {
142
+ if (product?.type === 'service' && business?.professionals?.length > 0) {
143
143
  setCurrentProduct(product)
144
144
  setOpenService(true)
145
145
  return
@@ -303,58 +303,62 @@ const ServiceFormUI = (props: ServiceFormParams) => {
303
303
  {t('REQUIRED', 'Required')}
304
304
  </OText>
305
305
  </View>
306
- {currentProfessional && (
307
- <TouchableOpacity
308
- style={styles.professionalSelect}
309
- onPress={() => setIsOpen(true)}
310
- >
311
- <View style={{ flexDirection: 'row' }}>
312
- {!!currentProfessional?.photo ? (
313
- <FastImage
314
- style={styles.photoStyle}
315
- source={{
316
- uri: optimizeImage(currentProfessional?.photo, 'h_250,c_limit'),
317
- priority: FastImage.priority.normal,
318
- }}
319
- resizeMode={FastImage.resizeMode.cover}
320
- />
321
- ) : (
322
- <OIcon
323
- src={theme?.images?.general?.user}
324
- cover={false}
325
- style={styles.photoStyle}
326
- />
327
- )}
328
- <View style={{ marginLeft: 14 }}>
329
- <OText
330
- size={14}
331
- weight={'400'}
332
- lineHeight={22}
333
- >
334
- {currentProfessional?.name} {currentProfessional?.lastname}
335
- </OText>
336
- <OText
337
- size={12}
338
- weight={'400'}
339
- lineHeight={17}
340
- color={isBusyTime(currentProfessional) ? theme.colors.danger5 : theme.colors.success500}
341
- >
342
- {isBusyTime(currentProfessional)
343
- ? t('BUSY_ON_SELECTED_TIME', 'Busy on selected time')
344
- : t('AVAILABLE', 'Available')
345
- }
346
- </OText>
306
+ <TouchableOpacity
307
+ style={styles.professionalSelect}
308
+ onPress={() => setIsOpen(true)}
309
+ >
310
+ {!!currentProfessional ? (
311
+ <>
312
+ <View style={{ flexDirection: 'row' }}>
313
+ {!!currentProfessional?.photo ? (
314
+ <FastImage
315
+ style={styles.photoStyle}
316
+ source={{
317
+ uri: optimizeImage(currentProfessional?.photo, 'h_250,c_limit'),
318
+ priority: FastImage.priority.normal,
319
+ }}
320
+ resizeMode={FastImage.resizeMode.cover}
321
+ />
322
+ ) : (
323
+ <OIcon
324
+ src={theme?.images?.general?.user}
325
+ cover={false}
326
+ style={styles.photoStyle}
327
+ />
328
+ )}
329
+ <View style={{ marginLeft: 14 }}>
330
+ <OText
331
+ size={14}
332
+ weight={'400'}
333
+ lineHeight={22}
334
+ >
335
+ {currentProfessional?.name} {currentProfessional?.lastname}
336
+ </OText>
337
+ <OText
338
+ size={12}
339
+ weight={'400'}
340
+ lineHeight={17}
341
+ color={isBusyTime(currentProfessional) ? theme.colors.danger5 : theme.colors.success500}
342
+ >
343
+ {isBusyTime(currentProfessional)
344
+ ? t('BUSY_ON_SELECTED_TIME', 'Busy on selected time')
345
+ : t('AVAILABLE', 'Available')
346
+ }
347
+ </OText>
348
+ </View>
347
349
  </View>
348
- </View>
349
- <View style={{ marginLeft: 5 }}>
350
- <IconAntDesign
351
- name='down'
352
- color={theme.colors.textThird}
353
- size={12}
354
- />
355
- </View>
356
- </TouchableOpacity>
357
- )}
350
+ </>
351
+ ) : (
352
+ <OText size={12}>{t('SELECT_PROFESSIONAL', 'Select professional')}</OText>
353
+ )}
354
+ <View style={{ marginLeft: 5 }}>
355
+ <IconAntDesign
356
+ name='down'
357
+ color={theme.colors.textThird}
358
+ size={12}
359
+ />
360
+ </View>
361
+ </TouchableOpacity>
358
362
  </ProfessionalWrapper>
359
363
  <ScheduleWrapper>
360
364
  <View
@@ -464,8 +468,9 @@ const ServiceFormUI = (props: ServiceFormParams) => {
464
468
  </CalendarWrapper>
465
469
  ) : (
466
470
  <OText
467
- size={20}
468
- style={{ marginBottom: 30 }}
471
+ size={16}
472
+ style={{ marginBottom: 30, textAlign: 'center' }}
473
+ color={theme?.colors?.disabled}
469
474
  weight={Platform.OS === 'ios' ? '600' : 'bold'}
470
475
  >
471
476
  {t('NO_SCHEDULE', 'No schedule')}
@@ -541,7 +546,7 @@ const ServiceFormUI = (props: ServiceFormParams) => {
541
546
  {t('ANY_OROFESSIONAL_MEMBER', 'Any professional member')}
542
547
  </OText>
543
548
  </View>
544
- {professionalList?.map((professional: any) => professional?.products?.includes(product?.id) && (
549
+ {professionalList?.map((professional: any) => (
545
550
  <TouchableOpacity
546
551
  key={professional?.id}
547
552
  style={styles.professionalItem}