ordering-ui-react-native 0.16.0-release → 0.16.1-release
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
|
@@ -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' &&
|
|
142
|
+
if (product?.type === 'service' && business?.professionals?.length > 0) {
|
|
143
143
|
setCurrentProduct(product)
|
|
144
144
|
setOpenService(true)
|
|
145
145
|
return
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState, useEffect, useRef } from 'react'
|
|
2
2
|
import { useTheme } from 'styled-components/native'
|
|
3
3
|
import { Platform, View, StyleSheet, Dimensions, ScrollView, TouchableOpacity } from 'react-native'
|
|
4
|
-
import { OText, OButton, OModal } from '../shared'
|
|
4
|
+
import { OText, OButton, OModal, OIcon } from '../shared'
|
|
5
5
|
import FastImage from 'react-native-fast-image'
|
|
6
6
|
import IconAntDesign from 'react-native-vector-icons/AntDesign'
|
|
7
7
|
import SelectDropdown from 'react-native-select-dropdown'
|
|
@@ -241,13 +241,21 @@ const ServiceFormUI = (props: ServiceFormParams) => {
|
|
|
241
241
|
return (
|
|
242
242
|
<>
|
|
243
243
|
<Container>
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
244
|
+
{!!product?.images ? (
|
|
245
|
+
<ProfessionalPhoto
|
|
246
|
+
source={{
|
|
247
|
+
uri: product?.images
|
|
248
|
+
}}
|
|
249
|
+
/>
|
|
250
|
+
) : (
|
|
251
|
+
<OIcon
|
|
252
|
+
src={theme?.images?.dummies?.product}
|
|
253
|
+
cover={false}
|
|
254
|
+
style={{ alignSelf: 'center' }}
|
|
255
|
+
width={200}
|
|
256
|
+
height={200}
|
|
257
|
+
/>
|
|
258
|
+
)}
|
|
251
259
|
<InfoWrapper>
|
|
252
260
|
<OText
|
|
253
261
|
size={20}
|
|
@@ -295,50 +303,62 @@ const ServiceFormUI = (props: ServiceFormParams) => {
|
|
|
295
303
|
{t('REQUIRED', 'Required')}
|
|
296
304
|
</OText>
|
|
297
305
|
</View>
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
<
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
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>
|
|
331
349
|
</View>
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
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>
|
|
342
362
|
</ProfessionalWrapper>
|
|
343
363
|
<ScheduleWrapper>
|
|
344
364
|
<View
|
|
@@ -448,8 +468,9 @@ const ServiceFormUI = (props: ServiceFormParams) => {
|
|
|
448
468
|
</CalendarWrapper>
|
|
449
469
|
) : (
|
|
450
470
|
<OText
|
|
451
|
-
size={
|
|
452
|
-
style={{ marginBottom: 30 }}
|
|
471
|
+
size={16}
|
|
472
|
+
style={{ marginBottom: 30, textAlign: 'center' }}
|
|
473
|
+
color={theme?.colors?.disabled}
|
|
453
474
|
weight={Platform.OS === 'ios' ? '600' : 'bold'}
|
|
454
475
|
>
|
|
455
476
|
{t('NO_SCHEDULE', 'No schedule')}
|
|
@@ -525,21 +546,29 @@ const ServiceFormUI = (props: ServiceFormParams) => {
|
|
|
525
546
|
{t('ANY_OROFESSIONAL_MEMBER', 'Any professional member')}
|
|
526
547
|
</OText>
|
|
527
548
|
</View>
|
|
528
|
-
{professionalList?.map((professional: any) =>
|
|
549
|
+
{professionalList?.map((professional: any) => (
|
|
529
550
|
<TouchableOpacity
|
|
530
551
|
key={professional?.id}
|
|
531
552
|
style={styles.professionalItem}
|
|
532
553
|
onPress={() => handleChangeProfessional(professional)}
|
|
533
554
|
>
|
|
534
555
|
<View style={{ flexDirection: 'row' }}>
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
556
|
+
{!!professional?.photo ? (
|
|
557
|
+
<FastImage
|
|
558
|
+
style={styles.photoStyle}
|
|
559
|
+
source={{
|
|
560
|
+
uri: optimizeImage(professional?.photo, 'h_250,c_limit'),
|
|
561
|
+
priority: FastImage.priority.normal,
|
|
562
|
+
}}
|
|
563
|
+
resizeMode={FastImage.resizeMode.cover}
|
|
564
|
+
/>
|
|
565
|
+
) : (
|
|
566
|
+
<OIcon
|
|
567
|
+
src={theme?.images?.general?.user}
|
|
568
|
+
cover={false}
|
|
569
|
+
style={styles.photoStyle}
|
|
570
|
+
/>
|
|
571
|
+
)}
|
|
543
572
|
<View style={{ marginLeft: 14 }}>
|
|
544
573
|
<OText
|
|
545
574
|
size={14}
|