ordering-ui-react-native 0.16.30 → 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.
Files changed (22) hide show
  1. package/package.json +2 -1
  2. package/themes/original/index.tsx +8 -0
  3. package/themes/original/src/components/BusinessBasicInformation/index.tsx +1 -1
  4. package/themes/original/src/components/BusinessProductsListing/index.tsx +255 -208
  5. package/themes/original/src/components/BusinessProductsListing/styles.tsx +5 -0
  6. package/themes/original/src/components/BusinessTypeFilter/index.tsx +106 -38
  7. package/themes/original/src/components/BusinessTypeFilter/styles.tsx +2 -0
  8. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +549 -0
  9. package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +106 -0
  10. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +519 -0
  11. package/themes/original/src/components/BusinessesListing/{styles.tsx → Layout/Original/styles.tsx} +0 -0
  12. package/themes/original/src/components/BusinessesListing/index.tsx +13 -515
  13. package/themes/original/src/components/MomentSelector/index.tsx +197 -0
  14. package/themes/original/src/components/MomentSelector/styles.tsx +6 -0
  15. package/themes/original/src/components/ProfessionalFilter/index.tsx +128 -0
  16. package/themes/original/src/components/ProfessionalFilter/styles.tsx +0 -0
  17. package/themes/original/src/components/ProfessionalProfile/index.tsx +297 -0
  18. package/themes/original/src/components/ProfessionalProfile/styles.tsx +46 -0
  19. package/themes/original/src/components/ServiceForm/index.tsx +485 -0
  20. package/themes/original/src/components/ServiceForm/styles.tsx +50 -0
  21. package/themes/original/src/types/index.tsx +31 -1
  22. package/themes/original/src/utils/index.tsx +11 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-react-native",
3
- "version": "0.16.30",
3
+ "version": "0.16.31",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -127,6 +127,7 @@
127
127
  "@types/react": "^18.0.14",
128
128
  "@types/react-dom": "^18.0.5",
129
129
  "@types/react-native": "^0.63.25",
130
+ "@types/react-native-calendar-picker": "^7.0.2",
130
131
  "babel-jest": "^26.3.0",
131
132
  "eslint": "^7.10.0",
132
133
  "jest": "^26.4.2",
@@ -70,6 +70,10 @@ import { BusinessItemAccordion } from './src/components/BusinessItemAccordion';
70
70
  import { CouponControl } from './src/components/CouponControl';
71
71
  import { TaxInformation } from './src/components/TaxInformation';
72
72
  import { PlaceSpot } from './src/components/PlaceSpot';
73
+ import { ProfessionalFilter } from './src/components/ProfessionalFilter';
74
+ import { ProfessionalProfile } from './src/components/ProfessionalProfile';
75
+ import { ServiceForm } from './src/components/ServiceForm';
76
+ import { MomentSelector } from './src/components/MomentSelector';
73
77
  import { Cart } from './src/components/Cart';
74
78
  import { LanguageSelector } from './src/components/LanguageSelector';
75
79
  import { PhoneInputNumber } from './src/components/PhoneInputNumber'
@@ -226,6 +230,10 @@ export {
226
230
  CouponControl,
227
231
  TaxInformation,
228
232
  PlaceSpot,
233
+ ProfessionalFilter,
234
+ ServiceForm,
235
+ ProfessionalProfile,
236
+ MomentSelector,
229
237
  Cart,
230
238
  LanguageSelector,
231
239
  PhoneInputNumber,
@@ -223,7 +223,7 @@ export const BusinessBasicInformation = (
223
223
  <WrapReviews>
224
224
  {!isBusinessInfoShow && (
225
225
  <>
226
- {isPreOrder && (
226
+ {isPreOrder && (!business?.professionals || business?.professionals?.length === 0) && (
227
227
  <>
228
228
  <TouchableOpacity onPress={() => navigation.navigate('BusinessPreorder', { business: businessState?.business, handleBusinessClick: () => navigation?.goBack() })}>
229
229
  <OText color={theme.colors.textSecondary} style={{ textDecorationLine: 'underline' }}>
@@ -26,11 +26,14 @@ import {
26
26
  BusinessProductsListingContainer,
27
27
  FiltProductsContainer,
28
28
  ContainerSafeAreaView,
29
- BackgroundGray
29
+ BackgroundGray,
30
+ ProfessionalFilterWrapper
30
31
  } from './styles'
31
32
  import { FloatingButton } from '../FloatingButton'
32
33
  import { UpsellingRedirect } from './UpsellingRedirect'
33
34
  import Animated from 'react-native-reanimated'
35
+ import { ProfessionalFilter } from '../ProfessionalFilter';
36
+ import { ServiceForm } from '../ServiceForm';
34
37
 
35
38
  const PIXELS_TO_SCROLL = 2000
36
39
 
@@ -53,7 +56,9 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
53
56
  setAlertState,
54
57
  multiRemoveProducts,
55
58
  getNextProducts,
56
- handleUpdateProducts
59
+ handleUpdateProducts,
60
+ professionalSelected,
61
+ handleChangeProfessionalSelected
57
62
  } = props
58
63
 
59
64
  const theme = useTheme();
@@ -101,6 +106,8 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
101
106
  const [productListLayout, setProductListLayout] = useState<any>(null)
102
107
  const [isCategoryClicked, setCategoryClicked] = useState(false)
103
108
  const [subcategoriesSelected, setSubcategoriesSelected] = useState([])
109
+ const [openService, setOpenService] = useState(false)
110
+ const [currentProduct, setCurrentProduct] = useState(null)
104
111
 
105
112
  const isCheckoutMultiBusinessEnabled: Boolean = configs?.checkout_multi_business_enabled?.value === '1'
106
113
  const currentCart: any = Object.values(orderState.carts).find((cart: any) => cart?.business?.slug === business?.slug) ?? {}
@@ -111,6 +118,11 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
111
118
  }
112
119
 
113
120
  const onProductClick = (product: any) => {
121
+ if (product?.type === 'service' && professionalSelected) {
122
+ setCurrentProduct(product)
123
+ setOpenService(true)
124
+ return
125
+ }
114
126
  onRedirect('ProductDetails', {
115
127
  product: product,
116
128
  businessSlug: business.slug,
@@ -210,228 +222,263 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
210
222
  }, [currentCart])
211
223
 
212
224
  return (
213
- <ContainerSafeAreaView
214
- style={{ flex: 1 }}
215
- isOpenFiltProducts={isOpenFiltProducts}
216
- >
217
- <Animated.View style={{ position: 'relative' }}>
218
- <TopHeader isIos={Platform.OS === 'ios'}>
219
- {!isOpenSearchBar && (
220
- <>
221
- <View style={{ ...styles.headerItem, flex: 1 }}>
222
- <OButton
223
- imgLeftSrc={theme.images.general.arrow_left}
224
- imgRightSrc={null}
225
- style={styles.btnBackArrow}
226
- onClick={() => handleBackNavigation()}
227
- imgLeftStyle={{ tintColor: theme.colors.textNormal, width: 16 }}
225
+ <>
226
+ <ContainerSafeAreaView
227
+ style={{ flex: 1 }}
228
+ isOpenFiltProducts={isOpenFiltProducts}
229
+ >
230
+ <Animated.View style={{ position: 'relative' }}>
231
+ <TopHeader isIos={Platform.OS === 'ios'}>
232
+ {!isOpenSearchBar && (
233
+ <>
234
+ <View style={{ ...styles.headerItem, flex: 1 }}>
235
+ <OButton
236
+ imgLeftSrc={theme.images.general.arrow_left}
237
+ imgRightSrc={null}
238
+ style={styles.btnBackArrow}
239
+ onClick={() => handleBackNavigation()}
240
+ imgLeftStyle={{ tintColor: theme.colors.textNormal, width: 16 }}
241
+ />
242
+ </View>
243
+ {!errorQuantityProducts && (
244
+ <View style={{ ...styles.headerItem }}>
245
+ <TouchableOpacity
246
+ onPress={() => setIsOpenSearchBar(true)}
247
+ style={styles.searchIcon}
248
+ >
249
+ <OIcon src={theme.images.general.search} color={theme.colors.textNormal} width={16} />
250
+ </TouchableOpacity>
251
+ </View>
252
+ )}
253
+ </>
254
+ )}
255
+ {isOpenSearchBar && (
256
+ <WrapSearchBar>
257
+ <SearchBar
258
+ onSearch={handleChangeSearch}
259
+ onCancel={() => handleCancel()}
260
+ isCancelXButtonShow
261
+ noBorderShow
262
+ placeholder={t('SEARCH_PRODUCTS', 'Search Products')}
263
+ lazyLoad={businessState?.business?.lazy_load_products_recommended}
264
+ />
265
+ </WrapSearchBar>
266
+ )}
267
+ </TopHeader>
268
+ </Animated.View>
269
+
270
+ {business?.categories?.length > 0 && isOpenFiltProducts && (
271
+ <FiltProductsContainer
272
+ isIos={Platform.OS === 'ios'}
273
+ style={{
274
+ height: Dimensions.get('window').height - filtProductsHeight
275
+ }}
276
+ >
277
+ <View style={{ padding: 20, backgroundColor: theme.colors.white }}>
278
+ <BusinessProductsList
279
+ categories={[
280
+ { id: null, name: t('ALL', 'All') },
281
+ { id: 'featured', name: t('FEATURED', 'Featured') },
282
+ ...business?.categories.sort((a: any, b: any) => a.rank - b.rank)
283
+ ]}
284
+ category={categorySelected}
285
+ categoryState={categoryState}
286
+ businessId={business.id}
287
+ errors={errors}
288
+ onProductClick={onProductClick}
289
+ handleSearchRedirect={handleSearchRedirect}
290
+ featured={featuredProducts}
291
+ searchValue={searchValue}
292
+ handleClearSearch={handleChangeSearch}
293
+ errorQuantityProducts={errorQuantityProducts}
294
+ handleCancelSearch={handleCancel}
295
+ categoriesLayout={categoriesLayout}
296
+ subcategoriesSelected={subcategoriesSelected}
297
+ lazyLoadProductsRecommended={business?.lazy_load_products_recommended}
298
+ setCategoriesLayout={setCategoriesLayout}
299
+ currentCart={currentCart}
300
+ setSubcategoriesSelected={setSubcategoriesSelected}
301
+ onClickCategory={handleChangeCategory}
302
+ handleUpdateProducts={handleUpdateProducts}
303
+ isFiltMode
228
304
  />
229
305
  </View>
230
- {!errorQuantityProducts && (
231
- <View style={{ ...styles.headerItem }}>
232
- <TouchableOpacity
233
- onPress={() => setIsOpenSearchBar(true)}
234
- style={styles.searchIcon}
235
- >
236
- <OIcon src={theme.images.general.search} color={theme.colors.textNormal} width={16} />
237
- </TouchableOpacity>
238
- </View>
306
+ </FiltProductsContainer>
307
+ )}
308
+ {isOpenFiltProducts && (
309
+ <BackgroundGray />
310
+ )}
311
+ <BusinessProductsListingContainer
312
+ stickyHeaderIndices={[2]}
313
+ style={styles.mainContainer}
314
+ ref={scrollViewRef}
315
+ isActiveFloatingButtom={currentCart?.products?.length > 0 && categoryState.products.length !== 0}
316
+ onScroll={handlePageScroll}
317
+ onScrollBeginDrag={handleTouchDrag}
318
+ scrollEventThrottle={16}
319
+ >
320
+ <BusinessBasicInformation
321
+ navigation={navigation}
322
+ businessState={businessState}
323
+ openBusinessInformation={openBusinessInformation}
324
+ header={header}
325
+ logo={logo}
326
+ isPreOrder={isPreOrder}
327
+ />
328
+ {business?.professionals?.length > 0 && (
329
+ <ProfessionalFilterWrapper>
330
+ <OText
331
+ size={16}
332
+ style={{ marginBottom: 16 }}
333
+ weight={Platform.OS === 'ios' ? '600' : 'bold'}
334
+ >
335
+ {t('PROFESSIONALS', 'Professionals')}
336
+ </OText>
337
+ <ProfessionalFilter
338
+ professionals={business?.professionals}
339
+ professionalSelected={professionalSelected}
340
+ handleChangeProfessionalSelected={handleChangeProfessionalSelected}
341
+ />
342
+ </ProfessionalFilterWrapper>
343
+ )}
344
+ <View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100 }} />
345
+ {!loading && business?.id && (
346
+ <>
347
+ {!(business?.categories?.length === 0) && (
348
+ <BusinessProductsCategories
349
+ categories={[{ id: null, name: t('ALL', 'All') }, { id: 'featured', name: t('FEATURED', 'Featured') }, ...business?.categories.sort((a: any, b: any) => a.rank - b.rank)]}
350
+ categorySelected={categorySelected}
351
+ onClickCategory={handleChangeCategory}
352
+ featured={featuredProducts}
353
+ openBusinessInformation={openBusinessInformation}
354
+ scrollViewRef={scrollViewRef}
355
+ productListLayout={productListLayout}
356
+ categoriesLayout={categoriesLayout}
357
+ selectedCategoryId={selectedCategoryId}
358
+ lazyLoadProductsRecommended={business?.lazy_load_products_recommended}
359
+ setSelectedCategoryId={setSelectedCategoryId}
360
+ setCategoryClicked={setCategoryClicked}
361
+
362
+ />
239
363
  )}
240
364
  </>
241
365
  )}
242
- {isOpenSearchBar && (
243
- <WrapSearchBar>
244
- <SearchBar
245
- onSearch={handleChangeSearch}
246
- onCancel={() => handleCancel()}
247
- isCancelXButtonShow
248
- noBorderShow
249
- placeholder={t('SEARCH_PRODUCTS', 'Search Products')}
250
- lazyLoad={businessState?.business?.lazy_load_products_recommended}
251
- />
252
- </WrapSearchBar>
366
+ {!loading && business?.id && (
367
+ <>
368
+ <WrapContent
369
+ onLayout={(event: any) => setProductListLayout(event.nativeEvent.layout)}
370
+ >
371
+ <BusinessProductsList
372
+ categories={[
373
+ { id: null, name: t('ALL', 'All') },
374
+ { id: 'featured', name: t('FEATURED', 'Featured') },
375
+ ...business?.categories.sort((a: any, b: any) => a.rank - b.rank)
376
+ ]}
377
+ category={categorySelected}
378
+ categoryState={categoryState}
379
+ businessId={business.id}
380
+ errors={errors}
381
+ onProductClick={onProductClick}
382
+ handleSearchRedirect={handleSearchRedirect}
383
+ featured={featuredProducts}
384
+ searchValue={searchValue}
385
+ handleClearSearch={handleChangeSearch}
386
+ errorQuantityProducts={errorQuantityProducts}
387
+ handleCancelSearch={handleCancel}
388
+ categoriesLayout={categoriesLayout}
389
+ subcategoriesSelected={subcategoriesSelected}
390
+ lazyLoadProductsRecommended={business?.lazy_load_products_recommended}
391
+ setCategoriesLayout={setCategoriesLayout}
392
+ currentCart={currentCart}
393
+ setSubcategoriesSelected={setSubcategoriesSelected}
394
+ onClickCategory={handleChangeCategory}
395
+ handleUpdateProducts={handleUpdateProducts}
396
+ />
397
+ </WrapContent>
398
+ </>
253
399
  )}
254
- </TopHeader>
255
- </Animated.View>
256
-
257
- {business?.categories?.length > 0 && isOpenFiltProducts && (
258
- <FiltProductsContainer
259
- isIos={Platform.OS === 'ios'}
260
- style={{
261
- height: Dimensions.get('window').height - filtProductsHeight
262
- }}
263
- >
264
- <View style={{ padding: 20, backgroundColor: theme.colors.white }}>
265
- <BusinessProductsList
266
- categories={[
267
- { id: null, name: t('ALL', 'All') },
268
- { id: 'featured', name: t('FEATURED', 'Featured') },
269
- ...business?.categories.sort((a: any, b: any) => a.rank - b.rank)
270
- ]}
271
- category={categorySelected}
272
- categoryState={categoryState}
273
- businessId={business.id}
274
- errors={errors}
275
- onProductClick={onProductClick}
276
- handleSearchRedirect={handleSearchRedirect}
277
- featured={featuredProducts}
278
- searchValue={searchValue}
279
- handleClearSearch={handleChangeSearch}
280
- errorQuantityProducts={errorQuantityProducts}
281
- handleCancelSearch={handleCancel}
282
- categoriesLayout={categoriesLayout}
283
- subcategoriesSelected={subcategoriesSelected}
284
- lazyLoadProductsRecommended={business?.lazy_load_products_recommended}
285
- setCategoriesLayout={setCategoriesLayout}
286
- currentCart={currentCart}
287
- setSubcategoriesSelected={setSubcategoriesSelected}
288
- onClickCategory={handleChangeCategory}
289
- handleUpdateProducts={handleUpdateProducts}
290
- isFiltMode
291
- />
292
- </View>
293
- </FiltProductsContainer>
294
- )}
295
- {isOpenFiltProducts && (
296
- <BackgroundGray />
297
- )}
298
- <BusinessProductsListingContainer
299
- stickyHeaderIndices={[2]}
300
- style={styles.mainContainer}
301
- ref={scrollViewRef}
302
- isActiveFloatingButtom={currentCart?.products?.length > 0 && categoryState.products.length !== 0}
303
- onScroll={handlePageScroll}
304
- onScrollBeginDrag={handleTouchDrag}
305
- scrollEventThrottle={16}
306
- >
307
- <BusinessBasicInformation
308
- navigation={navigation}
309
- businessState={businessState}
310
- openBusinessInformation={openBusinessInformation}
311
- header={header}
312
- logo={logo}
313
- isPreOrder={isPreOrder}
314
- />
315
- <View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100 }} />
316
- {!loading && business?.id && (
317
- <>
318
- {!(business?.categories?.length === 0) && (
400
+ {loading && !error && (
401
+ <>
319
402
  <BusinessProductsCategories
320
- categories={[{ id: null, name: t('ALL', 'All') }, { id: 'featured', name: t('FEATURED', 'Featured') }, ...business?.categories.sort((a: any, b: any) => a.rank - b.rank)]}
403
+ categories={[]}
321
404
  categorySelected={categorySelected}
322
405
  onClickCategory={handleChangeCategory}
323
406
  featured={featuredProducts}
324
407
  openBusinessInformation={openBusinessInformation}
325
- scrollViewRef={scrollViewRef}
326
- productListLayout={productListLayout}
327
- categoriesLayout={categoriesLayout}
328
- selectedCategoryId={selectedCategoryId}
329
- lazyLoadProductsRecommended={business?.lazy_load_products_recommended}
330
- setSelectedCategoryId={setSelectedCategoryId}
331
- setCategoryClicked={setCategoryClicked}
332
-
408
+ loading={loading}
333
409
  />
334
- )}
335
- </>
336
- )}
337
- {!loading && business?.id && (
338
- <>
339
- <WrapContent
340
- onLayout={(event: any) => setProductListLayout(event.nativeEvent.layout)}
341
- >
342
- <BusinessProductsList
343
- categories={[
344
- { id: null, name: t('ALL', 'All') },
345
- { id: 'featured', name: t('FEATURED', 'Featured') },
346
- ...business?.categories.sort((a: any, b: any) => a.rank - b.rank)
347
- ]}
348
- category={categorySelected}
349
- categoryState={categoryState}
350
- businessId={business.id}
351
- errors={errors}
352
- onProductClick={onProductClick}
353
- handleSearchRedirect={handleSearchRedirect}
354
- featured={featuredProducts}
355
- searchValue={searchValue}
356
- handleClearSearch={handleChangeSearch}
357
- errorQuantityProducts={errorQuantityProducts}
358
- handleCancelSearch={handleCancel}
359
- categoriesLayout={categoriesLayout}
360
- subcategoriesSelected={subcategoriesSelected}
361
- lazyLoadProductsRecommended={business?.lazy_load_products_recommended}
362
- setCategoriesLayout={setCategoriesLayout}
363
- currentCart={currentCart}
364
- setSubcategoriesSelected={setSubcategoriesSelected}
365
- onClickCategory={handleChangeCategory}
366
- handleUpdateProducts={handleUpdateProducts}
367
- />
368
- </WrapContent>
369
- </>
410
+ <WrapContent>
411
+ <BusinessProductsList
412
+ categories={[]}
413
+ category={categorySelected}
414
+ categoryState={categoryState}
415
+ isBusinessLoading={loading}
416
+ errorQuantityProducts={errorQuantityProducts}
417
+ handleUpdateProducts={handleUpdateProducts}
418
+ />
419
+ </WrapContent>
420
+ </>
421
+ )}
422
+ </BusinessProductsListingContainer>
423
+ {!loading && auth && currentCart?.products?.length > 0 && categoryState.products.length !== 0 && (
424
+ <FloatingButton
425
+ btnText={
426
+ openUpselling
427
+ ? t('LOADING', 'Loading')
428
+ : currentCart?.subtotal >= currentCart?.minimum
429
+ ? t('VIEW_ORDER', 'View Order')
430
+ : `${t('MINIMUN_SUBTOTAL_ORDER', 'Minimum subtotal order:')} ${parsePrice(currentCart?.minimum)}`
431
+ }
432
+ isSecondaryBtn={currentCart?.subtotal < currentCart?.minimum || openUpselling}
433
+ btnLeftValueShow={currentCart?.subtotal >= currentCart?.minimum && currentCart?.products?.length > 0}
434
+ btnRightValueShow={currentCart?.subtotal >= currentCart?.minimum && currentCart?.products?.length > 0}
435
+ btnLeftValue={currentCart?.products.reduce((prev: number, product: any) => prev + product.quantity, 0)}
436
+ btnRightValue={parsePrice(currentCart?.total)}
437
+ disabled={currentCart?.subtotal < currentCart?.minimum || openUpselling}
438
+ handleClick={() => setOpenUpselling(true)}
439
+ />
370
440
  )}
371
- {loading && !error && (
372
- <>
373
- <BusinessProductsCategories
374
- categories={[]}
375
- categorySelected={categorySelected}
376
- onClickCategory={handleChangeCategory}
377
- featured={featuredProducts}
378
- openBusinessInformation={openBusinessInformation}
379
- loading={loading}
380
- />
381
- <WrapContent>
382
- <BusinessProductsList
383
- categories={[]}
384
- category={categorySelected}
385
- categoryState={categoryState}
386
- isBusinessLoading={loading}
387
- errorQuantityProducts={errorQuantityProducts}
388
- handleUpdateProducts={handleUpdateProducts}
389
- />
390
- </WrapContent>
391
- </>
441
+ {openUpselling && (
442
+ <UpsellingRedirect
443
+ businessId={currentCart?.business_id}
444
+ business={currentCart?.business}
445
+ cartProducts={currentCart?.products}
446
+ cart={currentCart}
447
+ setOpenUpselling={setOpenUpselling}
448
+ handleUpsellingPage={handleUpsellingPage}
449
+ handleCloseUpsellingPage={handleCloseUpsellingPage}
450
+ openUpselling={openUpselling}
451
+ canOpenUpselling={canOpenUpselling}
452
+ setCanOpenUpselling={setCanOpenUpselling}
453
+ onRedirect={onRedirect}
454
+ />
392
455
  )}
393
- </BusinessProductsListingContainer>
394
- {!loading && auth && currentCart?.products?.length > 0 && categoryState.products.length !== 0 && (
395
- <FloatingButton
396
- btnText={
397
- openUpselling
398
- ? t('LOADING', 'Loading')
399
- : currentCart?.subtotal >= currentCart?.minimum
400
- ? t('VIEW_ORDER', 'View Order')
401
- : `${t('MINIMUN_SUBTOTAL_ORDER', 'Minimum subtotal order:')} ${parsePrice(currentCart?.minimum)}`
402
- }
403
- isSecondaryBtn={currentCart?.subtotal < currentCart?.minimum || openUpselling}
404
- btnLeftValueShow={currentCart?.subtotal >= currentCart?.minimum && currentCart?.products?.length > 0}
405
- btnRightValueShow={currentCart?.subtotal >= currentCart?.minimum && currentCart?.products?.length > 0}
406
- btnLeftValue={currentCart?.products.reduce((prev: number, product: any) => prev + product.quantity, 0)}
407
- btnRightValue={parsePrice(currentCart?.total)}
408
- disabled={currentCart?.subtotal < currentCart?.minimum || openUpselling}
409
- handleClick={() => setOpenUpselling(true)}
456
+ <Alert
457
+ open={alertState?.open || false}
458
+ title=''
459
+ content={[t('NOT_AVAILABLE_PRODUCTS', 'These products are not available.')]}
460
+ onAccept={() => setAlertState({ open: false, content: [] })}
461
+ onClose={() => setAlertState({ open: false, content: [] })}
410
462
  />
411
- )}
412
- {openUpselling && (
413
- <UpsellingRedirect
414
- businessId={currentCart?.business_id}
415
- business={currentCart?.business}
416
- cartProducts={currentCart?.products}
417
- cart={currentCart}
418
- setOpenUpselling={setOpenUpselling}
419
- handleUpsellingPage={handleUpsellingPage}
420
- handleCloseUpsellingPage={handleCloseUpsellingPage}
421
- openUpselling={openUpselling}
422
- canOpenUpselling={canOpenUpselling}
423
- setCanOpenUpselling={setCanOpenUpselling}
424
- onRedirect={onRedirect}
463
+ </ContainerSafeAreaView>
464
+ <OModal
465
+ open={openService}
466
+ onClose={() => setOpenService(false)}
467
+ entireModal
468
+ >
469
+ <ServiceForm
470
+ navigation={navigation}
471
+ product={currentProduct}
472
+ businessSlug={business.slug}
473
+ businessId={business.id}
474
+ professionalList={business?.professionals}
475
+ professionalSelected={professionalSelected}
476
+ handleChangeProfessional={handleChangeProfessionalSelected}
477
+ onSave={() => setOpenService(false)}
478
+ onClose={() => setOpenService(false)}
425
479
  />
426
- )}
427
- <Alert
428
- open={alertState?.open || false}
429
- title=''
430
- content={[t('NOT_AVAILABLE_PRODUCTS', 'These products are not available.')]}
431
- onAccept={() => setAlertState({ open: false, content: [] })}
432
- onClose={() => setAlertState({ open: false, content: [] })}
433
- />
434
- </ContainerSafeAreaView>
480
+ </OModal>
481
+ </>
435
482
  )
436
483
  }
437
484
 
@@ -55,3 +55,8 @@ export const BackgroundGray = styled.View`
55
55
  z-index: 100;
56
56
  width: 100%;
57
57
  `
58
+
59
+ export const ProfessionalFilterWrapper = styled.View`
60
+ padding-left: 40px;
61
+ margin-bottom: 35px;
62
+ `