ordering-ui-react-native 0.21.49-test → 0.21.49-test-v2

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 (112) hide show
  1. package/package.json +2 -3
  2. package/themes/business/index.tsx +0 -5
  3. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +9 -2
  4. package/themes/business/src/components/FloatingButton/index.tsx +34 -31
  5. package/themes/business/src/components/MapView/index.tsx +6 -2
  6. package/themes/business/src/components/MessagesOption/index.tsx +2 -1
  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/OrdersListManager/index.tsx +7 -2
  12. package/themes/business/src/components/OrdersOption/index.tsx +4 -0
  13. package/themes/business/src/components/PreviousOrders/OrderList.tsx +17 -12
  14. package/themes/business/src/components/PreviousOrders/index.tsx +77 -65
  15. package/themes/business/src/components/WebsocketStatus/index.tsx +171 -0
  16. package/themes/business/src/components/WebsocketStatus/styles.tsx +28 -0
  17. package/themes/kiosk/src/components/LoginForm/index.tsx +7 -4
  18. package/themes/original/index.tsx +6 -2
  19. package/themes/original/src/components/AddressForm/index.tsx +2 -2
  20. package/themes/original/src/components/AddressForm/styles.tsx +1 -1
  21. package/themes/original/src/components/AddressList/styles.tsx +4 -4
  22. package/themes/original/src/components/BusinessBasicInformation/index.tsx +2 -2
  23. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -1
  24. package/themes/original/src/components/BusinessInformation/index.tsx +0 -1
  25. package/themes/original/src/components/BusinessInformation/styles.tsx +2 -2
  26. package/themes/original/src/components/BusinessItemAccordion/index.tsx +11 -7
  27. package/themes/original/src/components/BusinessListingSearch/index.tsx +2 -3
  28. package/themes/original/src/components/BusinessListingSearch/styles.tsx +1 -1
  29. package/themes/original/src/components/BusinessPreorder/index.tsx +2 -2
  30. package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -1
  31. package/themes/original/src/components/BusinessProductsList/index.tsx +2 -2
  32. package/themes/original/src/components/BusinessProductsListing/index.tsx +12 -8
  33. package/themes/original/src/components/BusinessProductsListing/styles.tsx +2 -2
  34. package/themes/original/src/components/BusinessReviews/index.tsx +1 -1
  35. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  36. package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -5
  37. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +69 -0
  38. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +406 -0
  39. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListing.tsx +76 -0
  40. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +23 -403
  41. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
  42. package/themes/original/src/components/Cart/index.tsx +15 -4
  43. package/themes/original/src/components/CartContent/index.tsx +59 -38
  44. package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
  45. package/themes/original/src/components/Checkout/index.tsx +47 -9
  46. package/themes/original/src/components/Checkout/styles.tsx +17 -0
  47. package/themes/original/src/components/CitiesControl/styles.tsx +1 -1
  48. package/themes/original/src/components/DatePicker/index.tsx +17 -0
  49. package/themes/original/src/components/DatePicker/styles.tsx +20 -0
  50. package/themes/original/src/components/Favorite/index.tsx +1 -3
  51. package/themes/original/src/components/Favorite/styles.tsx +0 -2
  52. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  53. package/themes/original/src/components/GPSButton/index.tsx +1 -1
  54. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
  55. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +36 -3
  56. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +1 -1
  57. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +67 -4
  58. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +1 -1
  59. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +1 -1
  60. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +1 -1
  61. package/themes/original/src/components/HighestRatedBusinesses/styles.tsx +1 -1
  62. package/themes/original/src/components/Home/index.tsx +1 -1
  63. package/themes/original/src/components/LastOrder/index.tsx +2 -1
  64. package/themes/original/src/components/LastOrders/index.tsx +2 -1
  65. package/themes/original/src/components/Messages/styles.tsx +1 -1
  66. package/themes/original/src/components/MomentOption/index.tsx +3 -3
  67. package/themes/original/src/components/MultiCart/index.tsx +1 -1
  68. package/themes/original/src/components/MultiCheckout/index.tsx +140 -18
  69. package/themes/original/src/components/MultiOrdersDetails/index.tsx +1 -1
  70. package/themes/original/src/components/MyOrders/index.tsx +5 -5
  71. package/themes/original/src/components/NavBar/index.tsx +0 -1
  72. package/themes/original/src/components/NetworkError/styles.tsx +2 -2
  73. package/themes/original/src/components/Notifications/index.tsx +2 -4
  74. package/themes/original/src/components/Notifications/styles.tsx +0 -1
  75. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +1 -1
  76. package/themes/original/src/components/OrderDetails/index.tsx +709 -664
  77. package/themes/original/src/components/OrderDetails/styles.tsx +24 -7
  78. package/themes/original/src/components/OrderProgress/index.tsx +2 -1
  79. package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
  80. package/themes/original/src/components/OrderSummary/index.tsx +3 -1
  81. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +1 -1
  82. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +1 -1
  83. package/themes/original/src/components/OrdersOption/index.tsx +1 -1
  84. package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
  85. package/themes/original/src/components/PaymentOptions/index.tsx +3 -1
  86. package/themes/original/src/components/ProductForm/ActionButton.tsx +117 -0
  87. package/themes/original/src/components/ProductForm/ExtraOptions.tsx +56 -0
  88. package/themes/original/src/components/ProductForm/index.tsx +52 -146
  89. package/themes/original/src/components/ProductItemAccordion/index.tsx +5 -0
  90. package/themes/original/src/components/ProductOptionSubOption/index.tsx +1 -1
  91. package/themes/original/src/components/ProfessionalProfile/styles.tsx +3 -3
  92. package/themes/original/src/components/Promotions/index.tsx +2 -3
  93. package/themes/original/src/components/Promotions/styles.tsx +0 -2
  94. package/themes/original/src/components/ReviewDriver/styles.tsx +1 -1
  95. package/themes/original/src/components/ReviewOrder/styles.tsx +1 -1
  96. package/themes/original/src/components/ReviewProducts/styles.tsx +1 -1
  97. package/themes/original/src/components/ServiceForm/index.tsx +1 -1
  98. package/themes/original/src/components/ServiceForm/styles.tsx +4 -4
  99. package/themes/original/src/components/StripeElementsForm/index.tsx +1 -1
  100. package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +170 -0
  101. package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +86 -0
  102. package/themes/original/src/components/UpsellingProducts/index.tsx +15 -199
  103. package/themes/original/src/components/UpsellingProducts/styles.tsx +19 -0
  104. package/themes/original/src/components/UserFormDetails/index.tsx +51 -4
  105. package/themes/original/src/components/UserProfile/index.tsx +1 -1
  106. package/themes/original/src/components/WalletTransactions/styles.tsx +1 -0
  107. package/themes/original/src/components/Wallets/index.tsx +1 -0
  108. package/themes/original/src/components/Wallets/styles.tsx +0 -1
  109. package/themes/original/src/components/shared/OModal.tsx +12 -14
  110. package/themes/original/src/layouts/Container.tsx +1 -1
  111. package/themes/business/src/components/StarPrinter/SearchPrinter.tsx +0 -106
  112. package/themes/business/src/components/StarPrinter/index.tsx +0 -235
@@ -1,6 +1,6 @@
1
- import React, { useState } from 'react';
1
+ import React, { useCallback, useState } from 'react';
2
2
  import { View } from 'react-native';
3
- import { useLanguage, useConfig, useUtils } from 'ordering-components/native';
3
+ import { useLanguage, useConfig, useUtils, useOrder } from 'ordering-components/native';
4
4
  import { useTheme } from 'styled-components/native';
5
5
  import { CCContainer, CCNotCarts, CCList, CheckoutAction, ChCartsTotal } from './styles';
6
6
 
@@ -11,10 +11,9 @@ import { NotFoundSource } from '../NotFoundSource';
11
11
 
12
12
  export const CartContent = (props: any) => {
13
13
  const {
14
- carts,
15
- isOrderStateCarts,
16
14
  onNavigationRedirect,
17
- singleBusiness
15
+ singleBusiness,
16
+ businessSlug
18
17
  } = props
19
18
 
20
19
  const theme = useTheme();
@@ -22,16 +21,22 @@ export const CartContent = (props: any) => {
22
21
  const [{ configs }] = useConfig()
23
22
  const [{ parsePrice }] = useUtils();
24
23
  const [isCartsLoading, setIsCartsLoading] = useState(false)
25
-
26
- const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
24
+ const [cartsOpened, setCartsOpened] = useState([])
25
+ const [{ carts: cartsContext }] = useOrder();
26
+ const cartsList =
27
+ (cartsContext &&
28
+ Object.values(cartsContext).filter((cart: any) => cart.products.length > 0)) ??
29
+ [];
30
+ const carts = businessSlug
31
+ ? cartsList.filter((cart: any) => cart?.business?.slug === businessSlug || parseInt(businessSlug) === cart?.business_id)
32
+ : cartsList
33
+ const isOrderStateCarts = !!carts
27
34
  const isMultiCheckout = configs?.checkout_multi_business_enabled?.value === '1'
28
- const cartsAvailable: any = Object.values(carts)?.filter((cart: any) => cart?.valid && cart?.status !== 2)
29
-
35
+ const cartsAvailable: any = Object.values(carts || {})?.filter((cart: any) => cart?.valid && cart?.status !== 2)
30
36
  const totalCartsPrice = cartsAvailable?.length && cartsAvailable.reduce((total: any, cart: any) => { return total + cart?.total }, 0)
31
37
  const totalCartsFee = cartsAvailable?.length && cartsAvailable
32
38
  ?.filter((cart: any) => cart?.status !== 1 && cart?.valid && cart?.products?.length)
33
39
  ?.reduce((total: any, cart: any) => { return total + (cart?.delivery_price_with_discount) }, 0)
34
-
35
40
  const handleCheckoutRedirect = () => {
36
41
  if (cartsAvailable.length === 1) {
37
42
  onNavigationRedirect('CheckoutNavigator', {
@@ -66,9 +71,21 @@ export const CartContent = (props: any) => {
66
71
  }
67
72
  }
68
73
 
74
+ const changeActiveState = useCallback((isClosed : boolean, uuid : string) => {
75
+ const isActive = cartsOpened?.includes?.(uuid) || !!singleBusiness
76
+ if (isActive || !isClosed) {
77
+ setCartsOpened(cartsOpened?.filter?.((_uuid) => _uuid !== uuid))
78
+ } else {
79
+ setCartsOpened([
80
+ ...cartsOpened,
81
+ uuid
82
+ ])
83
+ }
84
+ }, [cartsOpened])
85
+
69
86
  return (
70
87
  <CCContainer
71
- style={{ paddingHorizontal: isChewLayout ? 20 : 40 }}
88
+ style={{ paddingHorizontal: 20 }}
72
89
  >
73
90
  {isOrderStateCarts && carts?.length > 0 && (
74
91
  <>
@@ -88,8 +105,12 @@ export const CartContent = (props: any) => {
88
105
  hideUpselling
89
106
  businessConfigs={cart?.business?.configs}
90
107
  hideCouponInput={configs?.multi_business_checkout_coupon_input_style?.value === 'group'}
91
- hideDeliveryFee={configs?.multi_business_checkout_show_combined_delivery_fee?.value === '1'}
108
+ hideDeliveryFee={configs?.multi_business_checkout_show_combined_delivery_fee?.value === '1'}
92
109
  hideDriverTip={configs?.multi_business_checkout_show_combined_driver_tip?.value === '1'}
110
+ cartsOpened={cartsOpened}
111
+ setCartsOpened={setCartsOpened}
112
+ changeActiveState={changeActiveState}
113
+ isActive={cartsOpened?.includes?.(cart?.uuid) || !!singleBusiness}
93
114
  />
94
115
  <View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginHorizontal: -40, marginTop: 20 }} />
95
116
  </>
@@ -101,32 +122,32 @@ export const CartContent = (props: any) => {
101
122
  {!!cartsAvailable.length && (
102
123
  <ChCartsTotal>
103
124
  {!!totalCartsFee && configs?.multi_business_checkout_show_combined_delivery_fee?.value === '1' && (
104
- <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
105
- <OText size={14} lineHeight={24} color={theme.colors.textNormal} weight={'400'}>
106
- {t('TOTAL_DELIVERY_FEE', 'Total delivery fee')}
107
- </OText>
108
- <OText size={14} lineHeight={24} color={theme.colors.textNormal} weight={'400'}>
109
- {parsePrice(totalCartsFee)}
110
- </OText>
111
- </View>
112
- )}
113
- {cartsAvailable.reduce((sum: any, cart: any) => sum + cart?.driver_tip, 0) > 0 &&
114
- configs?.multi_business_checkout_show_combined_driver_tip?.value === '1' && (
115
- <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
116
- <OText size={14} lineHeight={24} color={theme.colors.textNormal} weight={'400'}>
117
- {t('DRIVER_TIP', 'Driver tip')}
118
- </OText>
119
- <OText size={14} lineHeight={24} color={theme.colors.textNormal} weight={'400'}>
120
- {parsePrice(cartsAvailable.reduce((sum: any, cart: any) => sum + cart?.driver_tip, 0))}
121
- </OText>
122
- </View>
123
- )}
124
- <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
125
- <OText size={16} lineHeight={24} color={theme.colors.textNormal} weight={'500'}>
126
- {t('TOTAL_FOR_ALL_CARTS', 'Total for all Carts')}
127
- </OText>
128
- <OText size={16} lineHeight={24} color={theme.colors.textNormal} weight={'500'}>{parsePrice(totalCartsPrice)}</OText>
129
- </View>
125
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
126
+ <OText size={14} lineHeight={24} color={theme.colors.textNormal} weight={'400'}>
127
+ {t('TOTAL_DELIVERY_FEE', 'Total delivery fee')}
128
+ </OText>
129
+ <OText size={14} lineHeight={24} color={theme.colors.textNormal} weight={'400'}>
130
+ {parsePrice(totalCartsFee)}
131
+ </OText>
132
+ </View>
133
+ )}
134
+ {cartsAvailable.reduce((sum: any, cart: any) => sum + cart?.driver_tip, 0) > 0 &&
135
+ configs?.multi_business_checkout_show_combined_driver_tip?.value === '1' && (
136
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
137
+ <OText size={14} lineHeight={24} color={theme.colors.textNormal} weight={'400'}>
138
+ {t('DRIVER_TIP', 'Driver tip')}
139
+ </OText>
140
+ <OText size={14} lineHeight={24} color={theme.colors.textNormal} weight={'400'}>
141
+ {parsePrice(cartsAvailable.reduce((sum: any, cart: any) => sum + cart?.driver_tip, 0))}
142
+ </OText>
143
+ </View>
144
+ )}
145
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
146
+ <OText size={16} lineHeight={24} color={theme.colors.textNormal} weight={'500'}>
147
+ {t('TOTAL_FOR_ALL_CARTS', 'Total for all Carts')}
148
+ </OText>
149
+ <OText size={16} lineHeight={24} color={theme.colors.textNormal} weight={'500'}>{parsePrice(totalCartsPrice)}</OText>
150
+ </View>
130
151
  <View style={{ flexDirection: 'row', justifyContent: 'center', marginVertical: 20 }}>
131
152
  <OText size={14} color={theme.colors.textNormal} weight={'300'} style={{ textAlign: 'center' }}>
132
153
  {t('CART_GROUP_MESSAGE_ALERT', 'Discounts may be applied at the time of payment for this group.')}
@@ -9,7 +9,7 @@ export const Container = styled.View`
9
9
  `
10
10
 
11
11
  export const ItemListing = styled.ScrollView`
12
- padding: 0 40px;
12
+ padding: 0 20px;
13
13
  margin: 0 0 140px;
14
14
  `
15
15
 
@@ -19,7 +19,7 @@ export const TopHeader = styled.View`
19
19
  align-items: center;
20
20
  justify-content: space-between;
21
21
  z-index: 1;
22
- padding: 0 40px;
22
+ padding: 0 20px;
23
23
  `
24
24
 
25
25
  export const HeaderItem = styled.TouchableOpacity`
@@ -1,9 +1,11 @@
1
1
  import React, { useState, useEffect, useCallback } from 'react';
2
- import { View, StyleSheet, TouchableOpacity, Platform, I18nManager, ScrollView } from 'react-native';
2
+ import { View, StyleSheet, TouchableOpacity, Platform, I18nManager, ScrollView, SafeAreaView } from 'react-native';
3
3
  import { initStripe, useConfirmPayment } from '@stripe/stripe-react-native';
4
4
  import NativeStripeSdk from '@stripe/stripe-react-native/src/NativeStripeSdk'
5
5
  import Picker from 'react-native-country-picker-modal';
6
6
  import MaterialIcons from 'react-native-vector-icons/MaterialIcons'
7
+ import IconAntDesign from 'react-native-vector-icons/AntDesign';
8
+
7
9
  import ReactNativeHapticFeedback from "react-native-haptic-feedback";
8
10
  import {
9
11
  Checkout as CheckoutController,
@@ -46,7 +48,9 @@ import {
46
48
  DeliveryOptionsContainer,
47
49
  DeliveryOptionItem,
48
50
  WalletPaymentOptionContainer,
49
- CartHeader
51
+ CartHeader,
52
+ TopHeader,
53
+ TopActions
50
54
  } from './styles';
51
55
  import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
52
56
  import { FloatingButton } from '../FloatingButton';
@@ -115,7 +119,7 @@ const CheckoutUI = (props: any) => {
115
119
  padding: 20
116
120
  },
117
121
  pagePadding: {
118
- paddingHorizontal: 40
122
+ paddingHorizontal: 20
119
123
  },
120
124
  icon: {
121
125
  top: 15,
@@ -124,13 +128,14 @@ const CheckoutUI = (props: any) => {
124
128
  fontSize: 20
125
129
  },
126
130
  detailWrapper: {
127
- paddingHorizontal: 40,
131
+ paddingHorizontal: 20,
128
132
  width: '100%'
129
133
  },
130
134
  wrapperNavbar: {
131
- paddingVertical: 0,
132
- paddingHorizontal: 40,
133
- marginVertical: 2
135
+ paddingVertical: 2,
136
+ paddingHorizontal: 20,
137
+ backgroundColor: theme?.colors?.white,
138
+ borderWidth: 0
134
139
  }
135
140
  })
136
141
 
@@ -163,6 +168,7 @@ const CheckoutUI = (props: any) => {
163
168
  const [placeByMethodPay, setPlaceByMethodPay] = useState(false)
164
169
  const [methodPaySupported, setMethodPaySupported] = useState({ enabled: false, message: null, loading: true })
165
170
  const [paymethodClicked, setPaymethodClicked] = useState<any>(null)
171
+ const [showTitle, setShowTitle] = useState(false)
166
172
  const [cardList, setCardList] = useState<any>({ cards: [], loading: false, error: null })
167
173
  const cardsMethods = ['credomatic']
168
174
  const stripePaymethods: any = ['stripe', 'stripe_direct', 'stripe_connect', 'stripe_redirect']
@@ -192,7 +198,11 @@ const CheckoutUI = (props: any) => {
192
198
  }, cart?.subtotal)
193
199
 
194
200
  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
201
+ const validateZipcodeCard = validationFields?.fields?.card?.zipcode?.enabled &&
202
+ validationFields?.fields?.card?.zipcode?.required &&
203
+ paymethodSelected?.data?.card &&
204
+ !paymethodSelected?.data?.card?.zipcode &&
205
+ paymethodSelected?.gateway === 'stripe'
196
206
 
197
207
  const isDisabledButtonPlace = loading || !cart?.valid || (!paymethodSelected && cart?.balance > 0) ||
198
208
  placing || errorCash || subtotalWithTaxes < cart?.minimum ||
@@ -327,6 +337,10 @@ const CheckoutUI = (props: any) => {
327
337
  setPhoneUpdate(val)
328
338
  }
329
339
 
340
+ const handleScroll = ({ nativeEvent: { contentOffset } }: any) => {
341
+ setShowTitle(contentOffset.y > 30)
342
+ }
343
+
330
344
  useEffect(() => {
331
345
  if (validationFields && validationFields?.fields?.checkout) {
332
346
  checkValidationFields()
@@ -399,9 +413,33 @@ const CheckoutUI = (props: any) => {
399
413
 
400
414
  return (
401
415
  <>
402
- <Container noPadding>
416
+ <View style={styles.wrapperNavbar}>
417
+ <TopHeader>
418
+ <>
419
+ <TopActions onPress={() => onNavigationRedirect('BottomTab', { screen: 'Cart' }, !props.fromMulti)}>
420
+ <IconAntDesign
421
+ name='arrowleft'
422
+ size={26}
423
+ />
424
+ </TopActions>
425
+ {showTitle && (
426
+ <OText
427
+ size={16}
428
+ style={{ flex: 1, textAlign: 'center', right: 15 }}
429
+ weight={Platform.OS === 'ios' ? '600' : 'bold'}
430
+ numberOfLines={2}
431
+ ellipsizeMode='tail'
432
+ >
433
+ {t('CHECKOUT', 'Checkout')}
434
+ </OText>
435
+ )}
436
+ </>
437
+ </TopHeader>
438
+ </View>
439
+ <Container noPadding onScroll={handleScroll}>
403
440
  <View style={styles.wrapperNavbar}>
404
441
  <NavBar
442
+ hideArrowLeft
405
443
  title={t('CHECKOUT', 'Checkout')}
406
444
  titleAlign={'center'}
407
445
  onActionLeft={() => onNavigationRedirect('BottomTab', { screen: 'Cart' }, !props.fromMulti)}
@@ -113,3 +113,20 @@ export const CartHeader = styled.View`
113
113
  justify-content: space-between;
114
114
  margin-bottom: 10px;
115
115
  `
116
+
117
+ export const TopActions = styled.TouchableOpacity`
118
+ height: 60px;
119
+ justify-content: center;
120
+ min-width: 30px;
121
+ padding-right: 15px;
122
+ `;
123
+
124
+ export const TopHeader = styled.View`
125
+ width: 100%;
126
+ flex-direction: row;
127
+ align-items: center;
128
+ justify-content: space-between;
129
+ z-index: 1;
130
+ height: 60px;
131
+ min-height: 60px;
132
+ `
@@ -2,7 +2,7 @@ import styled, { css } from 'styled-components/native'
2
2
 
3
3
  export const Container = styled.View`
4
4
  width: 100%;
5
- padding: 0 40px;
5
+ padding: 0 20px;
6
6
  justify-content: space-between;
7
7
  padding-bottom: 12px;
8
8
 
@@ -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
+ `
@@ -35,9 +35,7 @@ export const Favorite = (props: any) => {
35
35
  }
36
36
 
37
37
  return (
38
- <Container
39
- pdng={Platform.OS === 'ios' ? '10px' : '20px'}
40
- >
38
+ <Container>
41
39
  <NavBar
42
40
  title={t('FAVORITE', 'Favorite')}
43
41
  titleAlign={'center'}
@@ -16,7 +16,5 @@ export const Tab = styled.TouchableOpacity`
16
16
  `
17
17
 
18
18
  export const Container = styled.View`
19
- padding-horizontal: 40px;
20
19
  padding-bottom: 20px;
21
- padding-top: ${(props: any) => props.pdng};
22
20
  `
@@ -5,7 +5,7 @@ export const Container = styled.View`
5
5
  bottom: 0px;
6
6
  left: 0;
7
7
  right: 0;
8
- padding: 12px 40px;
8
+ padding: 12px 20px;
9
9
  flex-direction: row;
10
10
  border-top-width: 1px;
11
11
  border-color: ${(props: any) => props.theme.colors.border};
@@ -61,7 +61,7 @@ export const GPSButton = (props: any) => {
61
61
  if (trackingStatus === 'not-determined') {
62
62
  trackingStatus = await requestTrackingPermission()
63
63
  }
64
- if (trackingStatus === 'authorized' || trackingStatus === 'unavailable') {
64
+ if ( trackingStatus === 'authorized' || trackingStatus === 'denied' || trackingStatus === 'unavailable') {
65
65
  setLoading(true)
66
66
  Geolocation.getCurrentPosition((pos) => {
67
67
  geoCodePosition(pos.coords)
@@ -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={{
@@ -2,7 +2,7 @@ import styled from 'styled-components/native'
2
2
 
3
3
  export const Container = styled.View`
4
4
  width: 100%;
5
- padding-horizontal: 40px;
5
+ padding-horizontal: 20px;
6
6
  flex: 1;
7
7
  padding-bottom: 30px;
8
8
  `
@@ -3,9 +3,10 @@ import {
3
3
  useLanguage, useUtils, RedeemGiftCard as RedeemGiftCardController
4
4
  } from 'ordering-components/native'
5
5
  import { useForm, Controller } from 'react-hook-form'
6
- import { StyleSheet, View, Alert } from 'react-native';
6
+ import { StyleSheet, View, Alert, Platform } from 'react-native';
7
7
  import { useTheme } from 'styled-components/native';
8
8
  import { OText, OButton, OInput } from '../../shared';
9
+ import AntDesignIcon from 'react-native-vector-icons/AntDesign'
9
10
 
10
11
  import {
11
12
  Container,
@@ -93,7 +94,38 @@ const RedeemGiftCardUI = (props: any) => {
93
94
  <Container>
94
95
  {!redeemedGiftCard ? (
95
96
  <View>
96
- <OText color={theme.colors.textNormal} weight='bold' size={20} mBottom={40}>{t('REDEEM_GIFT_CARD', 'Redeem a gift card')}</OText>
97
+ <View style={{
98
+ marginBottom: 40,
99
+ marginTop: Platform.OS === 'ios' ? 30 : 50,
100
+ display: 'flex',
101
+ flexDirection: 'row',
102
+ alignItems: 'center',
103
+ }}>
104
+ <OButton
105
+ imgLeftStyle={{ width: 18 }}
106
+ imgRightSrc={null}
107
+ style={{
108
+ borderWidth: 0,
109
+ width: 26,
110
+ height: 26,
111
+ backgroundColor: '#FFF',
112
+ borderColor: '#FFF',
113
+ shadowColor: '#FFF',
114
+ paddingLeft: 0,
115
+ paddingRight: 0,
116
+ }}
117
+ onClick={onClose}
118
+ icon={AntDesignIcon}
119
+ iconProps={{
120
+ name: 'arrowleft',
121
+ size: 26,
122
+ style: {
123
+ color: theme.colors.textNormal
124
+ }
125
+ }}
126
+ />
127
+ <OText color={theme.colors.textNormal} weight='bold' size={20} mLeft={10}>{t('REDEEM_GIFT_CARD', 'Redeem a gift card')}</OText>
128
+ </View>
97
129
  <FormController>
98
130
  <OText color={theme.colors.textNormal} size={14} mBottom={10}>{t('GIFT_CARD_CODE', 'Gift card code')}</OText>
99
131
  <Controller
@@ -106,7 +138,7 @@ const RedeemGiftCardUI = (props: any) => {
106
138
  onChange(val)
107
139
  handleChangeCode(val)
108
140
  }}
109
- autoCapitalize='none'
141
+ autoCapitalize='characters'
110
142
  autoCorrect={false}
111
143
  blurOnSubmit={false}
112
144
  style={style.inputStyle}
@@ -156,7 +188,38 @@ const RedeemGiftCardUI = (props: any) => {
156
188
  </View>
157
189
  ) : (
158
190
  <>
159
- <OText color={theme.colors.textNormal} weight='bold' size={20} mBottom={40}>{t('GIFT_CARD', 'Gift card')}</OText>
191
+ <View style={{
192
+ marginBottom: 40,
193
+ marginTop: Platform.OS === 'ios' ? 30 : 50,
194
+ display: 'flex',
195
+ flexDirection: 'row',
196
+ alignItems: 'center',
197
+ }}>
198
+ <OButton
199
+ imgLeftStyle={{ width: 18 }}
200
+ imgRightSrc={null}
201
+ style={{
202
+ borderWidth: 0,
203
+ width: 26,
204
+ height: 26,
205
+ backgroundColor: '#FFF',
206
+ borderColor: '#FFF',
207
+ shadowColor: '#FFF',
208
+ paddingLeft: 0,
209
+ paddingRight: 0,
210
+ }}
211
+ onClick={onClose}
212
+ icon={AntDesignIcon}
213
+ iconProps={{
214
+ name: 'arrowleft',
215
+ size: 26,
216
+ style: {
217
+ color: theme.colors.textNormal
218
+ }
219
+ }}
220
+ />
221
+ <OText color={theme.colors.textNormal} weight='bold' size={20} mLeft={10}>{t('GIFT_CARD', 'Gift card')}</OText>
222
+ </View>
160
223
  <View>
161
224
  <OText color={theme.colors.textNormal} size={14} mBottom={6}>{t('TYPE', 'Type')}: {redeemedGiftCard?.type}</OText>
162
225
  <OText color={theme.colors.textNormal} size={14} mBottom={6}>{t('AMOUNT', 'Amount')}: {parsePrice(redeemedGiftCard?.amount)}</OText>
@@ -1,7 +1,7 @@
1
1
  import styled from 'styled-components/native'
2
2
 
3
3
  export const Container = styled.View`
4
- padding-horizontal: 40px;
4
+ padding-horizontal: 20px;
5
5
  `
6
6
  export const FormController = styled.View`
7
7
  margin-bottom: 25px;
@@ -1,7 +1,7 @@
1
1
  import styled from 'styled-components/native'
2
2
 
3
3
  export const Container = styled.View`
4
- padding-horizontal: 40px;
4
+ padding-horizontal: 20px;
5
5
  margin-bottom: 30px;
6
6
  `
7
7
  export const FormController = styled.View`
@@ -56,7 +56,7 @@ const HighestRatedBusinessesUI = (props: HighestRatedBusinessesParams) => {
56
56
  showsHorizontalScrollIndicator={false}
57
57
  nestedScrollEnabled
58
58
  horizontal
59
- style={{ height: 300, paddingHorizontal: 40 }}
59
+ style={{ height: 300, paddingHorizontal: 20 }}
60
60
  >
61
61
  {[
62
62
  ...Array(10).keys()
@@ -2,6 +2,6 @@ import styled from 'styled-components/native'
2
2
 
3
3
  export const ListWrapper = styled.View`
4
4
  background-color: ${(props: any) => props.theme.colors.backgroundLight};
5
- padding-horizontal: 40px;
5
+ padding-horizontal: 20px;
6
6
  padding-top: 30px;
7
7
  `;
@@ -92,7 +92,7 @@ const styles = StyleSheet.create({
92
92
  flex: 1,
93
93
  alignItems: 'center',
94
94
  justifyContent: 'space-between',
95
- paddingHorizontal: 40,
95
+ paddingHorizontal: 20,
96
96
  },
97
97
  logo: {
98
98
  marginTop: 64,
@@ -129,7 +129,8 @@ export const LastOrder = (props: OrdersOptionParams) => {
129
129
  initialPage: 1,
130
130
  pageSize: 3,
131
131
  controlType: 'infinity'
132
- }
132
+ },
133
+ noGiftCardOrders: true
133
134
  }
134
135
 
135
136
  return <OrderList {...MyOrdersProps} />