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.
- package/package.json +2 -3
- package/themes/business/index.tsx +0 -5
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +9 -2
- package/themes/business/src/components/FloatingButton/index.tsx +34 -31
- package/themes/business/src/components/MapView/index.tsx +6 -2
- package/themes/business/src/components/MessagesOption/index.tsx +2 -1
- package/themes/business/src/components/OrderDetails/Delivery.tsx +11 -6
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +12 -0
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +6 -1
- package/themes/business/src/components/OrderSummary/index.tsx +3 -10
- package/themes/business/src/components/OrdersListManager/index.tsx +7 -2
- package/themes/business/src/components/OrdersOption/index.tsx +4 -0
- package/themes/business/src/components/PreviousOrders/OrderList.tsx +17 -12
- package/themes/business/src/components/PreviousOrders/index.tsx +77 -65
- package/themes/business/src/components/WebsocketStatus/index.tsx +171 -0
- package/themes/business/src/components/WebsocketStatus/styles.tsx +28 -0
- package/themes/kiosk/src/components/LoginForm/index.tsx +7 -4
- package/themes/original/index.tsx +6 -2
- package/themes/original/src/components/AddressForm/index.tsx +2 -2
- package/themes/original/src/components/AddressForm/styles.tsx +1 -1
- package/themes/original/src/components/AddressList/styles.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +2 -2
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -1
- package/themes/original/src/components/BusinessInformation/index.tsx +0 -1
- package/themes/original/src/components/BusinessInformation/styles.tsx +2 -2
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +11 -7
- package/themes/original/src/components/BusinessListingSearch/index.tsx +2 -3
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +1 -1
- package/themes/original/src/components/BusinessPreorder/index.tsx +2 -2
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -1
- package/themes/original/src/components/BusinessProductsList/index.tsx +2 -2
- package/themes/original/src/components/BusinessProductsListing/index.tsx +12 -8
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +2 -2
- package/themes/original/src/components/BusinessReviews/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -5
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +69 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +406 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListing.tsx +76 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +23 -403
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
- package/themes/original/src/components/Cart/index.tsx +15 -4
- package/themes/original/src/components/CartContent/index.tsx +59 -38
- package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
- package/themes/original/src/components/Checkout/index.tsx +47 -9
- package/themes/original/src/components/Checkout/styles.tsx +17 -0
- package/themes/original/src/components/CitiesControl/styles.tsx +1 -1
- package/themes/original/src/components/DatePicker/index.tsx +17 -0
- package/themes/original/src/components/DatePicker/styles.tsx +20 -0
- package/themes/original/src/components/Favorite/index.tsx +1 -3
- package/themes/original/src/components/Favorite/styles.tsx +0 -2
- package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
- package/themes/original/src/components/GPSButton/index.tsx +1 -1
- package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +36 -3
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +67 -4
- package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +1 -1
- package/themes/original/src/components/HighestRatedBusinesses/styles.tsx +1 -1
- package/themes/original/src/components/Home/index.tsx +1 -1
- package/themes/original/src/components/LastOrder/index.tsx +2 -1
- package/themes/original/src/components/LastOrders/index.tsx +2 -1
- package/themes/original/src/components/Messages/styles.tsx +1 -1
- package/themes/original/src/components/MomentOption/index.tsx +3 -3
- package/themes/original/src/components/MultiCart/index.tsx +1 -1
- package/themes/original/src/components/MultiCheckout/index.tsx +140 -18
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +1 -1
- package/themes/original/src/components/MyOrders/index.tsx +5 -5
- package/themes/original/src/components/NavBar/index.tsx +0 -1
- package/themes/original/src/components/NetworkError/styles.tsx +2 -2
- package/themes/original/src/components/Notifications/index.tsx +2 -4
- package/themes/original/src/components/Notifications/styles.tsx +0 -1
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +1 -1
- package/themes/original/src/components/OrderDetails/index.tsx +709 -664
- package/themes/original/src/components/OrderDetails/styles.tsx +24 -7
- package/themes/original/src/components/OrderProgress/index.tsx +2 -1
- package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
- package/themes/original/src/components/OrderSummary/index.tsx +3 -1
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +1 -1
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +1 -1
- package/themes/original/src/components/OrdersOption/index.tsx +1 -1
- package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
- package/themes/original/src/components/PaymentOptions/index.tsx +3 -1
- package/themes/original/src/components/ProductForm/ActionButton.tsx +117 -0
- package/themes/original/src/components/ProductForm/ExtraOptions.tsx +56 -0
- package/themes/original/src/components/ProductForm/index.tsx +52 -146
- package/themes/original/src/components/ProductItemAccordion/index.tsx +5 -0
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +1 -1
- package/themes/original/src/components/ProfessionalProfile/styles.tsx +3 -3
- package/themes/original/src/components/Promotions/index.tsx +2 -3
- package/themes/original/src/components/Promotions/styles.tsx +0 -2
- package/themes/original/src/components/ReviewDriver/styles.tsx +1 -1
- package/themes/original/src/components/ReviewOrder/styles.tsx +1 -1
- package/themes/original/src/components/ReviewProducts/styles.tsx +1 -1
- package/themes/original/src/components/ServiceForm/index.tsx +1 -1
- package/themes/original/src/components/ServiceForm/styles.tsx +4 -4
- package/themes/original/src/components/StripeElementsForm/index.tsx +1 -1
- package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +170 -0
- package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +86 -0
- package/themes/original/src/components/UpsellingProducts/index.tsx +15 -199
- package/themes/original/src/components/UpsellingProducts/styles.tsx +19 -0
- package/themes/original/src/components/UserFormDetails/index.tsx +51 -4
- package/themes/original/src/components/UserProfile/index.tsx +1 -1
- package/themes/original/src/components/WalletTransactions/styles.tsx +1 -0
- package/themes/original/src/components/Wallets/index.tsx +1 -0
- package/themes/original/src/components/Wallets/styles.tsx +0 -1
- package/themes/original/src/components/shared/OModal.tsx +12 -14
- package/themes/original/src/layouts/Container.tsx +1 -1
- package/themes/business/src/components/StarPrinter/SearchPrinter.tsx +0 -106
- 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
|
|
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:
|
|
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
|
-
|
|
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
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
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
|
|
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
|
|
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:
|
|
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:
|
|
131
|
+
paddingHorizontal: 20,
|
|
128
132
|
width: '100%'
|
|
129
133
|
},
|
|
130
134
|
wrapperNavbar: {
|
|
131
|
-
paddingVertical:
|
|
132
|
-
paddingHorizontal:
|
|
133
|
-
|
|
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 &&
|
|
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
|
-
<
|
|
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
|
+
`
|
|
@@ -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
|
+
`
|
|
@@ -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('
|
|
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('
|
|
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
|
|
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
|
-
<
|
|
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={{
|
|
@@ -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
|
-
<
|
|
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='
|
|
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
|
-
<
|
|
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>
|
|
@@ -56,7 +56,7 @@ const HighestRatedBusinessesUI = (props: HighestRatedBusinessesParams) => {
|
|
|
56
56
|
showsHorizontalScrollIndicator={false}
|
|
57
57
|
nestedScrollEnabled
|
|
58
58
|
horizontal
|
|
59
|
-
style={{ height: 300, paddingHorizontal:
|
|
59
|
+
style={{ height: 300, paddingHorizontal: 20 }}
|
|
60
60
|
>
|
|
61
61
|
{[
|
|
62
62
|
...Array(10).keys()
|