ordering-ui-react-native 0.21.48-test → 0.21.48-test-3

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 (41) hide show
  1. package/package.json +2 -3
  2. package/src/components/StripeMethodForm/index.tsx +3 -2
  3. package/themes/business/index.tsx +0 -5
  4. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +9 -2
  5. package/themes/business/src/components/FloatingButton/index.tsx +34 -31
  6. package/themes/business/src/components/MapView/index.tsx +6 -2
  7. package/themes/business/src/components/OrderDetails/Delivery.tsx +11 -6
  8. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +12 -0
  9. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +6 -1
  10. package/themes/business/src/components/OrderSummary/index.tsx +3 -10
  11. package/themes/business/src/components/OrdersOption/index.tsx +2 -0
  12. package/themes/business/src/components/PreviousOrders/OrderList.tsx +17 -12
  13. package/themes/business/src/components/PreviousOrders/index.tsx +77 -65
  14. package/themes/kiosk/src/components/LoginForm/index.tsx +7 -4
  15. package/themes/original/index.tsx +6 -2
  16. package/themes/original/src/components/BusinessInformation/index.tsx +0 -1
  17. package/themes/original/src/components/BusinessProductsList/index.tsx +2 -2
  18. package/themes/original/src/components/BusinessProductsListing/index.tsx +5 -1
  19. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +69 -0
  20. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +406 -0
  21. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListing.tsx +76 -0
  22. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +22 -402
  23. package/themes/original/src/components/Checkout/index.tsx +9 -1
  24. package/themes/original/src/components/DatePicker/index.tsx +17 -0
  25. package/themes/original/src/components/DatePicker/styles.tsx +20 -0
  26. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
  27. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +36 -3
  28. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +67 -4
  29. package/themes/original/src/components/LastOrder/index.tsx +2 -1
  30. package/themes/original/src/components/LastOrders/index.tsx +2 -1
  31. package/themes/original/src/components/MultiCheckout/index.tsx +138 -16
  32. package/themes/original/src/components/NavBar/index.tsx +0 -1
  33. package/themes/original/src/components/OrderDetails/index.tsx +8 -4
  34. package/themes/original/src/components/OrderProgress/index.tsx +2 -1
  35. package/themes/original/src/components/PaymentOptions/index.tsx +4 -2
  36. package/themes/original/src/components/ProductForm/index.tsx +1 -2
  37. package/themes/original/src/components/UserFormDetails/index.tsx +35 -1
  38. package/themes/original/src/components/Wallets/index.tsx +1 -0
  39. package/themes/original/src/components/Wallets/styles.tsx +0 -1
  40. package/themes/business/src/components/StarPrinter/SearchPrinter.tsx +0 -106
  41. package/themes/business/src/components/StarPrinter/index.tsx +0 -235
@@ -1,59 +1,29 @@
1
1
  import React, { useCallback, useEffect, useRef, useState } from 'react';
2
2
  import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
3
3
  import Geolocation from '@react-native-community/geolocation'
4
- import { IOScrollView } from 'react-native-intersection-observer'
5
4
  import { getTrackingStatus, requestTrackingPermission } from 'react-native-tracking-transparency'
6
5
  import {
7
6
  View,
8
7
  StyleSheet,
9
- ScrollView,
10
8
  Platform,
11
9
  TouchableOpacity,
12
- RefreshControl,
13
- AppState
14
10
  } from 'react-native';
11
+
15
12
  import {
16
13
  BusinessList as BusinessesListingController,
17
- useLanguage,
18
- useSession,
19
14
  useOrder,
20
15
  useConfig,
21
- useUtils
22
16
  } from 'ordering-components/native';
23
17
  import { useTheme } from 'styled-components/native';
24
- import Ionicons from 'react-native-vector-icons/Ionicons'
25
18
 
26
19
  import {
27
- Search,
28
- OrderControlContainer,
29
- AddressInput,
30
- WrapMomentOption,
31
- HeaderWrapper,
32
- ListWrapper,
33
- FeaturedWrapper,
34
- FarAwayMessage,
35
- AddressInputContainer,
36
- PreorderInput,
37
- OrderTypesContainer,
38
20
  BusinessLogosContainer
39
21
  } from './styles';
40
22
 
41
- import { OIcon, OText, OModal } from '../../../shared';
42
23
  import { BusinessesListingParams } from '../../../../types';
43
- import { NotFoundSource } from '../../../NotFoundSource';
44
- import { BusinessTypeFilter } from '../../../BusinessTypeFilter';
45
- import { BusinessController } from '../../../BusinessController';
46
- import { OrderTypeSelector } from '../../../OrderTypeSelector';
47
- import { useSafeAreaInsets } from 'react-native-safe-area-context';
48
- import { BusinessFeaturedController } from '../../../BusinessFeaturedController';
49
- import { HighestRatedBusinesses } from '../../../HighestRatedBusinesses';
50
- import { getTypesText } from '../../../../utils';
51
- import { OrderProgress } from '../../../OrderProgress';
52
- import { useFocusEffect, useIsFocused } from '@react-navigation/native';
24
+ import { useFocusEffect } from '@react-navigation/native';
53
25
  import FastImage from 'react-native-fast-image';
54
- import IconAntDesign from 'react-native-vector-icons/AntDesign';
55
- import { PageBanner } from '../../../PageBanner'
56
- import { CitiesControl } from '../../../CitiesControl'
26
+ import { FlatListBusinessListing } from './FlatListBusinessListing'
57
27
 
58
28
  const PIXELS_TO_SCROLL = 2000;
59
29
 
@@ -62,36 +32,19 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
62
32
  navigation,
63
33
  businessesList,
64
34
  getBusinesses,
65
- handleChangeBusinessType,
66
35
  handleBusinessClick,
67
36
  paginationProps,
68
- businessId,
69
- isGuestUser,
70
- handleUpdateBusinessList,
71
37
  citiesState,
72
38
  actualSlug,
73
39
  logosLayout
74
40
  } = props;
75
41
  const theme = useTheme();
76
- const isFocused = useIsFocused();
77
42
 
78
- const [, t] = useLanguage();
79
- const [{ user, auth }] = useSession();
80
43
  const [orderState, { changeCityFilter }] = useOrder();
81
44
  const [{ configs }] = useConfig();
82
- const [{ parseDate }] = useUtils();
83
45
 
84
- const appState = useRef(AppState.currentState)
85
46
  const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
86
- const [refreshing] = useState(false);
87
47
  const allCitiesDisabled = citiesState?.cities?.every((city: any) => !city.enabled)
88
- const hideCities = (theme?.business_listing_view?.components?.cities?.hidden || orderState?.options?.type !== 2 || allCitiesDisabled) ?? true
89
- const hideHero = theme?.business_listing_view?.components?.business_hero?.hidden
90
- const hidePreviousOrders = theme?.business_listing_view?.components?.previous_orders_block?.hidden
91
- const hideHighestBusiness = theme?.business_listing_view?.components?.highest_rated_business_block?.hidden
92
- const isAllCategoriesHidden = theme?.business_listing_view?.components?.categories?.hidden
93
- const bgHeader = theme?.business_listing_view?.components?.business_hero?.components?.image
94
- const bgHeaderHeight = theme?.business_listing_view?.components?.business_hero?.components?.style?.height
95
48
 
96
49
  const styles = StyleSheet.create({
97
50
  container: {
@@ -156,32 +109,14 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
156
109
  },
157
110
  });
158
111
 
159
- const { top } = useSafeAreaInsets();
160
-
161
112
  const [featuredBusiness, setFeaturedBusinesses] = useState(Array);
162
113
  const [isFarAway, setIsFarAway] = useState(false)
163
- const [businessTypes, setBusinessTypes] = useState(null)
164
114
  const [orderTypeValue, setOrderTypeValue] = useState(orderState?.options?.value)
165
115
  const [isOpenCities, setIsOpenCities] = useState(false)
166
- const isPreorderEnabled = (configs?.preorder_status_enabled?.value === '1' || configs?.preorder_status_enabled?.value === 'true') &&
167
- Number(configs?.max_days_preorder?.value) > 0
168
- const isPreOrderSetting = configs?.preorder_status_enabled?.value === '1'
169
116
  const timerId = useRef<any>(false)
170
117
  const [favoriteIds, setFavoriteIds] = useState<any>([])
171
- const chewOrderTypes = [{ name: t('DELIVERY', 'Delivery').toUpperCase(), value: 1 }, { name: t('PICKUP', 'Pickup').toUpperCase(), value: 2 }]
172
118
  const enabledPoweredByOrdering = configs?.powered_by_ordering_module?.value
173
119
 
174
- const handleMomentClick = () => {
175
- if (isPreorderEnabled) {
176
- navigation.navigate('MomentOption')
177
- }
178
- }
179
-
180
- const configTypes =
181
- configs?.order_types_allowed?.value
182
- .split('|')
183
- .map((value: any) => Number(value)) || [];
184
-
185
120
  const handleScroll = ({ nativeEvent }: any) => {
186
121
  const y = nativeEvent.contentOffset.y;
187
122
  const height = nativeEvent.contentSize.height;
@@ -355,340 +290,25 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
355
290
  }
356
291
 
357
292
  return (
358
- <IOScrollView
359
- style={styles.container}
360
- onScroll={(e) => handleScroll(e)}
361
- showsVerticalScrollIndicator={false}
362
- refreshControl={
363
- <RefreshControl
364
- refreshing={refreshing}
365
- onRefresh={() => handleOnRefresh()}
366
- />
367
- }
368
- >
369
- {enabledPoweredByOrdering && auth && (
370
- <View style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', top: 20 }}>
371
- <OText>
372
- Powered By Ordering.co
373
- </OText>
374
- </View>
375
- )}
376
- <View style={{
377
- height: !isPreOrderSetting && isChewLayout ? 150 : isChewLayout ? 200 : isFarAway ? 150 : 100,
378
- marginTop: isChewLayout ? 0 : Platform.OS == 'ios' ? 0 : 50,
379
- backgroundColor: isChewLayout ? theme?.colors?.chew : theme.colors?.white
380
- }}
381
- >
382
- {isChewLayout && (
383
- <View style={{ marginTop: 30, paddingHorizontal: 30, flexDirection: 'row', justifyContent: 'space-between' }}>
384
- <OText size={24} weight={700} color={theme.colors?.white}>
385
- {t('WELCOME', 'Welcome')} {user?.name}
386
- </OText>
387
- </View>
388
- )}
389
- <Search isChewLayout={isChewLayout}>
390
- <AddressInput
391
- isChewLayout={isChewLayout}
392
- onPress={() =>
393
- auth
394
- ? navigation.navigate('AddressList', { isFromBusinesses: true })
395
- : navigation.navigate('AddressForm', {
396
- address: orderState.options?.address,
397
- isFromBusinesses: true,
398
- isGuestUser: isGuestUser
399
- })
400
- }>
401
- <AddressInputContainer isChewLayout={isChewLayout}>
402
- <OIcon
403
- src={theme.images.general.pin}
404
- color={theme.colors.disabled}
405
- width={16}
406
- style={{ marginRight: isChewLayout ? 0 : 10 }}
407
- />
408
- <OText size={12} numberOfLines={1} style={{ flex: 1 }}>
409
- {orderState?.options?.address?.address || t('WHAT_IS_YOUR_ADDRESS', 'What\'s your address?')}
410
- </OText>
411
- {!isChewLayout && (
412
- <OIcon
413
- src={theme.images.general.arrow_down}
414
- width={10}
415
- style={{ marginStart: 8 }}
416
- />
417
- )}
418
- </AddressInputContainer>
419
- </AddressInput>
420
- </Search>
421
- {isFarAway && !isChewLayout && (
422
- <FarAwayMessage style={styles.farAwayMsg}>
423
- <Ionicons name='md-warning-outline' style={styles.iconStyle} />
424
- <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'You are far from this address')}</OText>
425
- </FarAwayMessage>
426
- )}
427
- {!isChewLayout ? (
428
- <OrderControlContainer>
429
- <View style={styles.wrapperOrderOptions}>
430
- {isPreOrderSetting && (
431
- <WrapMomentOption
432
- onPress={() => handleMomentClick()}>
433
- <OText
434
- size={12}
435
- numberOfLines={1}
436
- ellipsizeMode="tail"
437
- color={theme.colors.textSecondary}>
438
- {orderState.options?.moment
439
- ? parseDate(orderState.options?.moment, { outputFormat: configs?.dates_moment_format?.value })
440
- : t('ASAP_ABBREVIATION', 'ASAP')}
441
- </OText>
442
- {isPreorderEnabled && (
443
- <OIcon
444
- src={theme.images.general.arrow_down}
445
- width={10}
446
- style={{ marginStart: 8 }}
447
- />
448
- )}
449
- </WrapMomentOption>
450
- )}
451
- <WrapMomentOption onPress={() => navigation.navigate('OrderTypes', { configTypes: configTypes, setOrderTypeValue })}>
452
- <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textSecondary}>{t(getTypesText(orderTypeValue || orderState?.options?.type || 1), 'Delivery')}</OText>
453
- <OIcon
454
- src={theme.images.general.arrow_down}
455
- width={10}
456
- style={{ marginStart: 8 }}
457
- />
458
- </WrapMomentOption>
459
- </View>
460
- </OrderControlContainer>
461
- ) : (
462
- <>
463
- {isPreOrderSetting && (
464
- <View style={{ paddingHorizontal: 30 }}>
465
- <PreorderInput
466
- isChewLayout={isChewLayout}
467
- onPress={() => handleMomentClick()}
468
- >
469
- <OText color={theme.colors.textSecondary}>
470
- {orderState.options?.moment
471
- ? parseDate(orderState.options?.moment, { outputFormat: configs?.dates_moment_format?.value })
472
- : t('ASAP_ABBREVIATION', 'ASAP')}</OText>
473
- </PreorderInput>
474
- </View>
475
- )}
476
- </>
477
- )}
478
- </View>
479
- {!isChewLayout ? (
480
- <>
481
- {!hideHero ? (
482
- <HeaderWrapper
483
- source={bgHeader ? { uri: bgHeader } : theme.images.backgrounds.business_list_header}
484
- style={{ paddingTop: top + 20 }}
485
- resizeMode='cover'
486
- bgHeaderHeight={bgHeaderHeight}
487
- >
488
- {!auth && (
489
- <TouchableOpacity onPress={() => navigation?.canGoBack() && navigation.goBack()} style={{ position: 'absolute', marginStart: 40, paddingVertical: 20 }}>
490
- <OIcon src={theme.images.general.arrow_left} color={theme.colors.textNormal} />
491
- </TouchableOpacity>
492
- )}
493
- </HeaderWrapper>
494
- ) : (
495
- <>
496
- {!auth && (
497
- <TouchableOpacity onPress={() => navigation?.canGoBack() && navigation.goBack()} style={{ position: 'absolute', marginStart: 40, paddingVertical: 20 }}>
498
- <OIcon src={theme.images.general.arrow_left} color={theme.colors.textNormal} />
499
- </TouchableOpacity>
500
- )}
501
- </>
502
- )}
503
- </>
504
- ) : (
505
- <OrderTypesContainer>
506
- <OrderTypeSelector
507
- handleChangeBusinessType={handleChangeBusinessType}
508
- isChewLayout
509
- chewOrderTypes={chewOrderTypes}
510
- handleChangeType={setOrderTypeValue}
511
- />
512
- </OrderTypesContainer>
513
- )}
514
-
515
- {!hideCities && orderTypeValue === 2 && (
516
- <View style={{ marginTop: 20 }}>
517
- <TouchableOpacity
518
- style={styles.buttonCityStyle}
519
- onPress={() => setIsOpenCities(true)}
520
- disabled={orderState?.loading}
521
- >
522
- <OText size={18} color={theme.colors.backgroundGray} weight='bold' style={{ textAlign: 'center' }}>
523
- {citiesState?.cities?.find((city: any) => city?.id === orderState?.options?.city_id)?.name || t('FILTER_BY_CITY', 'Filter by city')}
524
- </OText>
525
- </TouchableOpacity>
526
- </View>
527
- )}
528
- {!hidePreviousOrders && (
529
- <OrderProgress
530
- {...props}
531
- isFocused={isFocused}
532
- />
533
- )}
534
- {
535
- !businessId && !props.franchiseId && featuredBusiness && featuredBusiness.length > 0 && (
536
- <FeaturedWrapper>
537
- <OText size={16} style={{ marginLeft: 40 }} weight={Platform.OS === 'ios' ? '600' : 'bold'}>{t('BUSINESS_FEATURE', 'Featured business')}</OText>
538
- <ScrollView
539
- showsHorizontalScrollIndicator={false}
540
- nestedScrollEnabled
541
- horizontal
542
- contentContainerStyle={{ paddingHorizontal: 40 }}
543
- >
544
- {featuredBusiness.map((bAry: any, idx) => (
545
- <View key={'f-listing_' + idx}>
546
- <BusinessFeaturedController
547
- business={bAry[0]}
548
- isBusinessOpen={bAry[0]?.open}
549
- handleCustomClick={handleBusinessClick}
550
- orderType={orderState?.options?.type}
551
- />
552
- {bAry.length > 1 && (
553
- <BusinessFeaturedController
554
- business={bAry[1]}
555
- isBusinessOpen={bAry[1]?.open}
556
- handleCustomClick={handleBusinessClick}
557
- orderType={orderState?.options?.type}
558
- />
559
- )}
560
- </View>
561
- ))}
562
- </ScrollView>
563
- </FeaturedWrapper>
564
- )
565
- }
566
- {!isChewLayout && !hideHighestBusiness && (
567
- <>
568
- <View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100 }} />
569
- {
570
- !businessId && !props.franchiseId && (
571
- <HighestRatedBusinesses
572
- propsToFetch={props.propsToFetch}
573
- onBusinessClick={handleBusinessClick}
574
- navigation={navigation}
575
- favoriteIds={favoriteIds}
576
- setFavoriteIds={setFavoriteIds}
577
- />
578
- )
579
- }
580
- </>
581
- )}
582
-
583
- <PageBanner position='app_business_listing' navigation={navigation} />
584
-
585
- <View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100 }} />
586
- <ListWrapper style={{ paddingHorizontal: isChewLayout ? 20 : 40 }}>
587
- {!businessId && !isAllCategoriesHidden && (
588
- <BusinessTypeFilter
589
- images={props.images}
590
- businessTypes={props.businessTypes}
591
- defaultBusinessType={props.defaultBusinessType}
592
- handleChangeBusinessType={handleChangeBusinessType}
593
- setBusinessTypes={setBusinessTypes}
594
- />
595
- )}
596
- {!businessesList.loading && businessesList.businesses.length === 0 && businessesList?.fetched && (
597
- <NotFoundSource
598
- content={t(
599
- 'NOT_FOUND_BUSINESSES',
600
- 'No businesses to delivery / pick up at this address, please change filters or change address.',
601
- )}
602
- />
603
- )}
604
- {businessesList.businesses?.map(
605
- (business: any, i: number) => (
606
- <BusinessController
607
- key={`${business.id}_` + i}
608
- enableIntersection
609
- business={business}
610
- isBusinessOpen={business.open}
611
- handleCustomClick={handleBusinessClick}
612
- orderType={orderState?.options?.type}
613
- navigation={navigation}
614
- businessHeader={business?.header}
615
- businessFeatured={business?.featured}
616
- businessLogo={business?.logo}
617
- businessReviews={business?.reviews}
618
- businessDeliveryPrice={business?.delivery_price}
619
- businessDeliveryTime={business?.delivery_time}
620
- businessPickupTime={business?.pickup_time}
621
- businessDistance={business?.distance}
622
- handleUpdateBusinessList={handleUpdateBusinessList}
623
- favoriteIds={favoriteIds}
624
- setFavoriteIds={setFavoriteIds}
625
- />
626
- )
627
- )}
628
- {(businessesList.loading || !businessesList?.fetched) && (
629
- <>
630
- {[
631
- ...Array(
632
- paginationProps.nextPageItems
633
- ? paginationProps.nextPageItems
634
- : 8,
635
- ).keys(),
636
- ].map((item, i) => (
637
- <Placeholder
638
- Animation={Fade}
639
- key={i}
640
- style={{ marginBottom: 20 }}>
641
- <View style={{ width: '100%' }}>
642
- <PlaceholderLine
643
- height={200}
644
- style={{ marginBottom: 20, borderRadius: 25 }}
645
- />
646
- <View style={{ paddingHorizontal: 10 }}>
647
- <View
648
- style={{
649
- flexDirection: 'row',
650
- justifyContent: 'space-between',
651
- }}>
652
- <PlaceholderLine
653
- height={25}
654
- width={40}
655
- style={{ marginBottom: 10 }}
656
- />
657
- <PlaceholderLine
658
- height={25}
659
- width={20}
660
- style={{ marginBottom: 10 }}
661
- />
662
- </View>
663
- <PlaceholderLine
664
- height={20}
665
- width={30}
666
- style={{ marginBottom: 10 }}
667
- />
668
- <PlaceholderLine
669
- height={20}
670
- width={80}
671
- style={{ marginBottom: 10 }}
672
- />
673
- </View>
674
- </View>
675
- </Placeholder>
676
- ))}
677
- </>
678
- )}
679
- </ListWrapper>
680
- <OModal
681
- open={isOpenCities}
682
- onClose={() => setIsOpenCities(false)}
683
- title={t('SELECT_A_CITY', 'Select a city')}
684
- >
685
- <CitiesControl
686
- cities={citiesState?.cities}
687
- onClose={() => setIsOpenCities(false)}
688
- handleChangeCity={handleChangeCity}
689
- />
690
- </OModal>
691
- </IOScrollView>
293
+ <FlatListBusinessListing
294
+ {...props}
295
+ navigation={navigation}
296
+ businessesList={businessesList}
297
+ enabledPoweredByOrdering={enabledPoweredByOrdering}
298
+ orderTypeValue={orderTypeValue}
299
+ allCitiesDisabled={allCitiesDisabled}
300
+ featuredBusiness={featuredBusiness}
301
+ favoriteIds={favoriteIds}
302
+ isFarAway={isFarAway}
303
+ isOpenCities={isOpenCities}
304
+ isChewLayout={isChewLayout}
305
+ handleScroll={handleScroll}
306
+ setIsOpenCities={setIsOpenCities}
307
+ setFavoriteIds={setFavoriteIds}
308
+ handleOnRefresh={handleOnRefresh}
309
+ setOrderTypeValue={setOrderTypeValue}
310
+ handleChangeCity={handleChangeCity}
311
+ />
692
312
  );
693
313
  };
694
314
 
@@ -192,7 +192,11 @@ const CheckoutUI = (props: any) => {
192
192
  }, cart?.subtotal)
193
193
 
194
194
  const validateCommentsCartField = validationFields?.fields?.checkout?.comments?.enabled && validationFields?.fields?.checkout?.comments?.required && (cart?.comment === null || cart?.comment?.trim().length === 0)
195
- const validateZipcodeCard = validationFields?.fields?.card?.zipcode?.enabled && validationFields?.fields?.card?.zipcode?.required && !paymethodSelected?.data?.card?.zipcode
195
+ const validateZipcodeCard = validationFields?.fields?.card?.zipcode?.enabled &&
196
+ validationFields?.fields?.card?.zipcode?.required &&
197
+ paymethodSelected?.data?.card &&
198
+ !paymethodSelected?.data?.card?.zipcode &&
199
+ paymethodSelected?.gateway === 'stripe'
196
200
 
197
201
  const isDisabledButtonPlace = loading || !cart?.valid || (!paymethodSelected && cart?.balance > 0) ||
198
202
  placing || errorCash || subtotalWithTaxes < cart?.minimum ||
@@ -400,6 +404,10 @@ const CheckoutUI = (props: any) => {
400
404
  return (
401
405
  <>
402
406
  <Container noPadding>
407
+ <OText>
408
+ si esta viendo esto uste ha instalado correctamente mi rama :)
409
+ gateway: {JSON.stringify(paymethodSelected)}
410
+ </OText>
403
411
  <View style={styles.wrapperNavbar}>
404
412
  <NavBar
405
413
  title={t('CHECKOUT', 'Checkout')}
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import DatePicker from 'react-native-date-picker'
3
+ import { DateContainer } from './styles';
4
+
5
+ export const DatePickerUI = (props: any) => {
6
+ const {
7
+ birthdate,
8
+ handleChangeDate
9
+ } = props;
10
+
11
+ return (
12
+ <DateContainer>
13
+ <DatePicker mode="date" date={birthdate ? new Date(birthdate) : new Date()} onDateChange={handleChangeDate} />
14
+ </DateContainer>
15
+ );
16
+ };
17
+
@@ -0,0 +1,20 @@
1
+ import styled from 'styled-components/native';
2
+
3
+ export const DateContainer = styled.View`
4
+ display: flex;
5
+ align-items: center;
6
+ margin-bottom: 20px;
7
+
8
+ input {
9
+ border-radius: 20px;
10
+ width: 140px;
11
+ outline: none;
12
+ padding: 10px 15px;
13
+ border: 1px solid #E9ECEF;
14
+ }
15
+
16
+ .react-datepicker__triangle {
17
+ transform: translate(40px, 0px) !important;
18
+ }
19
+
20
+ `
@@ -56,7 +56,7 @@ export const GiftCardUI = React.memo((props: any) => {
56
56
  <View style={style.actionWrapper}>
57
57
  <OButton
58
58
  onClick={() => setOpenModal('purchase')}
59
- text={t('PURCHASE_GIFT_CARD', 'Purchase gift card')}
59
+ text={t('PURCHASE', 'Purchase')}
60
60
  bgColor={theme.colors.primary}
61
61
  borderColor={theme.colors.primary}
62
62
  textStyle={{ color: 'white', fontSize: 13 }}
@@ -66,7 +66,7 @@ export const GiftCardUI = React.memo((props: any) => {
66
66
 
67
67
  <OButton
68
68
  onClick={() => setOpenModal('redeem')}
69
- text={t('REDEEM_GIFT_CARD', 'Redeem gift card')}
69
+ text={t('REDEEM', 'Redeem')}
70
70
  bgColor={theme.colors.lightPrimary}
71
71
  borderColor={theme.colors.lightPrimary}
72
72
  textStyle={{ color: theme.colors.primary, fontSize: 13 }}
@@ -79,13 +79,18 @@ export const GiftCardUI = React.memo((props: any) => {
79
79
  open={openModal === 'purchase'}
80
80
  onClose={() => setOpenModal(null)}
81
81
  entireModal
82
+ customClose
82
83
  >
83
- <PurchaseGiftCard handleCustomGoToCheckout={handleCustomGoToCheckout} />
84
+ <PurchaseGiftCard
85
+ handleCustomGoToCheckout={handleCustomGoToCheckout}
86
+ onClose={() => setOpenModal(null)}
87
+ />
84
88
  </OModal>
85
89
  <OModal
86
90
  open={openModal === 'redeem'}
87
91
  onClose={() => setOpenModal(null)}
88
92
  entireModal
93
+ customClose
89
94
  >
90
95
  <RedeemGiftCard
91
96
  onClose={() => setOpenModal(null)}
@@ -3,10 +3,11 @@ import {
3
3
  useLanguage,
4
4
  PurchaseGiftCard as PurchaseGiftCardController
5
5
  } from 'ordering-components/native'
6
- import { StyleSheet, View, TouchableOpacity, ScrollView } from 'react-native'
6
+ import { StyleSheet, View, TouchableOpacity, ScrollView, Platform } from 'react-native'
7
7
  import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
8
8
  import { useTheme } from 'styled-components/native';
9
9
  import { OText, OButton, OIcon } from '../../shared';
10
+ import AntDesignIcon from 'react-native-vector-icons/AntDesign'
10
11
 
11
12
  import {
12
13
  Container
@@ -17,7 +18,8 @@ const PurchaseGiftCardUI = (props: any) => {
17
18
  productsListState,
18
19
  selectedProduct,
19
20
  setSelectedProduct,
20
- handleAccept
21
+ handleAccept,
22
+ onClose
21
23
  } = props
22
24
 
23
25
  const theme = useTheme()
@@ -42,7 +44,38 @@ const PurchaseGiftCardUI = (props: any) => {
42
44
 
43
45
  return (
44
46
  <Container>
45
- <OText color={theme.colors.textNormal} weight='bold' size={20} mBottom={40}>{t('PURCHASE_GIFT_CARD', 'Purchase gift card')}</OText>
47
+ <View style={{
48
+ marginBottom: 40,
49
+ marginTop: Platform.OS === 'ios' ? 30 : 50,
50
+ display: 'flex',
51
+ flexDirection: 'row',
52
+ alignItems: 'center',
53
+ }}>
54
+ <OButton
55
+ imgLeftStyle={{ width: 18 }}
56
+ imgRightSrc={null}
57
+ style={{
58
+ borderWidth: 0,
59
+ width: 26,
60
+ height: 26,
61
+ backgroundColor: '#FFF',
62
+ borderColor: '#FFF',
63
+ shadowColor: '#FFF',
64
+ paddingLeft: 0,
65
+ paddingRight: 0,
66
+ }}
67
+ onClick={onClose}
68
+ icon={AntDesignIcon}
69
+ iconProps={{
70
+ name: 'arrowleft',
71
+ size: 26,
72
+ style: {
73
+ color: theme.colors.textNormal
74
+ }
75
+ }}
76
+ />
77
+ <OText color={theme.colors.textNormal} weight='bold' size={20} mLeft={10}>{t('PURCHASE_GIFT_CARD', 'Purchase gift card')}</OText>
78
+ </View>
46
79
  <OText color={theme.colors.textNormal} size={14}>{t('SELECT_ONE_OPTION', 'Select one option')}</OText>
47
80
  <ScrollView
48
81
  contentContainerStyle={{