ordering-ui-react-native 0.17.3 → 0.17.4-release
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -5
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/ActiveOrders/styles.tsx +8 -14
- package/src/components/BusinessInformation/index.tsx +11 -4
- package/src/components/BusinessInformation/styles.tsx +2 -2
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/OrderCreating/index.tsx +1 -21
- package/src/components/OrdersOption/index.tsx +54 -56
- package/src/components/PaymentOptionsWebView/index.tsx +119 -120
- package/src/components/SingleProductReview/index.tsx +7 -4
- package/src/components/StripeMethodForm/index.tsx +1 -1
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OToast.tsx +4 -4
- package/src/utils/index.tsx +7 -1
- package/themes/business/index.tsx +2 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +265 -240
- package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
- package/themes/business/src/components/BusinessController/index.tsx +0 -1
- package/themes/business/src/components/Chat/index.tsx +118 -107
- package/themes/business/src/components/DriverMap/index.tsx +22 -9
- package/themes/business/src/components/GoogleMap/index.tsx +58 -57
- package/themes/business/src/components/LoginForm/Otp/index.tsx +120 -0
- package/themes/business/src/components/LoginForm/Otp/styles.tsx +7 -0
- package/themes/business/src/components/LoginForm/index.tsx +238 -80
- package/themes/business/src/components/LoginForm/styles.tsx +10 -0
- package/themes/business/src/components/MapView/index.tsx +18 -7
- package/themes/business/src/components/NewOrderNotification/index.tsx +34 -44
- package/themes/business/src/components/OrderDetails/Delivery.tsx +4 -3
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +96 -50
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +59 -62
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +195 -0
- package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
- package/themes/business/src/components/OrderMessage/index.tsx +18 -17
- package/themes/business/src/components/OrderSummary/index.tsx +113 -121
- package/themes/business/src/components/OrdersOption/index.tsx +32 -75
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +250 -0
- package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
- package/themes/business/src/components/PreviousOrders/index.tsx +445 -243
- package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
- package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
- package/themes/business/src/components/ReviewCustomer/index.tsx +41 -24
- package/themes/business/src/components/StoresList/index.tsx +2 -2
- package/themes/business/src/components/shared/OLink.tsx +33 -13
- package/themes/business/src/components/shared/OModal.tsx +16 -9
- package/themes/business/src/components/shared/OText.tsx +8 -2
- package/themes/business/src/types/index.tsx +33 -2
- package/themes/business/src/utils/index.tsx +51 -0
- package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
- package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
- package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
- package/themes/kiosk/src/components/LoginForm/Otp/index.tsx +92 -0
- package/themes/kiosk/src/components/LoginForm/Otp/styles.tsx +7 -0
- package/themes/kiosk/src/components/LoginForm/index.tsx +473 -151
- package/themes/kiosk/src/components/LoginForm/styles.tsx +14 -1
- package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
- package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
- package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +3 -2
- package/themes/kiosk/src/components/PhoneInputNumber/styles.tsx +1 -3
- package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/kiosk/src/components/shared/OModal.tsx +14 -11
- package/themes/kiosk/src/layouts/Container.tsx +7 -1
- package/themes/kiosk/src/types/index.d.ts +13 -0
- package/themes/kiosk/src/utils/index.tsx +15 -0
- package/themes/original/index.tsx +8 -0
- package/themes/original/src/components/AddressDetails/index.tsx +29 -11
- package/themes/original/src/components/AddressForm/index.tsx +41 -16
- package/themes/original/src/components/AddressList/index.tsx +26 -21
- package/themes/original/src/components/AddressList/styles.tsx +4 -2
- package/themes/original/src/components/AnalyticsSegment/index.tsx +189 -9
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +125 -82
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +9 -4
- package/themes/original/src/components/BusinessController/index.tsx +145 -68
- package/themes/original/src/components/BusinessController/styles.tsx +22 -9
- package/themes/original/src/components/BusinessFeaturedController/index.tsx +21 -54
- package/themes/original/src/components/BusinessFeaturedController/styles.tsx +8 -0
- package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +24 -23
- package/themes/original/src/components/BusinessListingSearch/index.tsx +52 -24
- package/themes/original/src/components/BusinessPreorder/index.tsx +97 -16
- package/themes/original/src/components/BusinessProductsList/index.tsx +20 -11
- package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +617 -490
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +7 -13
- package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -3
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +98 -78
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
- package/themes/original/src/components/BusinessesListing/index.tsx +5 -3
- package/themes/original/src/components/Cart/index.tsx +88 -43
- package/themes/original/src/components/CartContent/index.tsx +102 -3
- package/themes/original/src/components/CartContent/styles.tsx +15 -1
- package/themes/original/src/components/Checkout/index.tsx +311 -178
- package/themes/original/src/components/Checkout/styles.tsx +4 -2
- package/themes/original/src/components/CitiesControl/index.tsx +89 -0
- package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
- package/themes/original/src/components/CouponControl/index.tsx +10 -3
- package/themes/original/src/components/DriverTips/index.tsx +52 -37
- package/themes/original/src/components/DriverTips/styles.tsx +2 -1
- package/themes/original/src/components/Favorite/index.tsx +7 -4
- package/themes/original/src/components/Favorite/styles.tsx +1 -1
- package/themes/original/src/components/FavoriteList/index.tsx +70 -80
- package/themes/original/src/components/FloatingButton/index.tsx +1 -2
- package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
- package/themes/original/src/components/GPSButton/styles.ts +3 -3
- package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +96 -0
- package/themes/original/src/components/GiftCard/GiftCardUI/styles.tsx +5 -0
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +100 -0
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +8 -0
- package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +178 -0
- package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +8 -0
- package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +165 -0
- package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +9 -0
- package/themes/original/src/components/Help/index.tsx +8 -8
- package/themes/original/src/components/HelpAccountAndPayment/index.tsx +11 -22
- package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +6 -0
- package/themes/original/src/components/HelpGuide/index.tsx +12 -16
- package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
- package/themes/original/src/components/HelpOrder/index.tsx +12 -25
- package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
- package/themes/original/src/components/Home/index.tsx +13 -4
- package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
- package/themes/original/src/components/LastOrder/index.tsx +1 -34
- package/themes/original/src/components/LoginForm/Otp/index.tsx +89 -73
- package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
- package/themes/original/src/components/LoginForm/index.tsx +43 -19
- package/themes/original/src/components/LottieAnimation/index.tsx +78 -0
- package/themes/original/src/components/MessageListing/index.tsx +16 -42
- package/themes/original/src/components/Messages/index.tsx +32 -10
- package/themes/original/src/components/MomentOption/index.tsx +195 -88
- package/themes/original/src/components/MultiCart/index.tsx +50 -0
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +117 -96
- package/themes/original/src/components/MultiCheckout/index.tsx +248 -83
- package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +67 -20
- package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
- package/themes/original/src/components/MyOrders/index.tsx +66 -17
- package/themes/original/src/components/NavBar/index.tsx +6 -11
- package/themes/original/src/components/Notifications/index.tsx +144 -0
- package/themes/original/src/components/Notifications/styles.tsx +20 -0
- package/themes/original/src/components/OrderDetails/OrderEta.tsx +60 -0
- package/themes/original/src/components/OrderDetails/index.tsx +262 -347
- package/themes/original/src/components/OrderDetails/styles.tsx +10 -1
- package/themes/original/src/components/OrderItAgain/index.tsx +47 -43
- package/themes/original/src/components/OrderProgress/index.tsx +74 -112
- package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
- package/themes/original/src/components/OrderSummary/index.tsx +68 -29
- package/themes/original/src/components/OrderTypeSelector/index.tsx +4 -3
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +28 -19
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
- package/themes/original/src/components/OrdersOption/index.tsx +101 -89
- package/themes/original/src/components/PageBanner/index.tsx +171 -0
- package/themes/original/src/components/PageBanner/styles.tsx +11 -0
- package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +3 -3
- package/themes/original/src/components/PhoneInputNumber/index.tsx +3 -3
- package/themes/original/src/components/PlaceSpot/index.tsx +12 -6
- package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
- package/themes/original/src/components/ProductForm/index.tsx +240 -261
- package/themes/original/src/components/ProductForm/styles.tsx +4 -7
- package/themes/original/src/components/ProductItemAccordion/index.tsx +200 -128
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +18 -10
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +1 -2
- package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
- package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -49
- package/themes/original/src/components/ProfessionalProfile/index.tsx +54 -14
- package/themes/original/src/components/Promotions/index.tsx +234 -220
- package/themes/original/src/components/Promotions/styles.tsx +10 -3
- package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
- package/themes/original/src/components/ReviewOrder/index.tsx +26 -9
- package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
- package/themes/original/src/components/ReviewProducts/index.tsx +7 -4
- package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
- package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
- package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
- package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
- package/themes/original/src/components/ServiceForm/index.tsx +377 -270
- package/themes/original/src/components/Sessions/index.tsx +11 -8
- package/themes/original/src/components/Sessions/styles.tsx +5 -0
- package/themes/original/src/components/SignupForm/index.tsx +79 -66
- package/themes/original/src/components/SingleOrderCard/index.tsx +148 -62
- package/themes/original/src/components/SingleOrderCard/styles.tsx +11 -9
- package/themes/original/src/components/SingleProductCard/index.tsx +111 -56
- package/themes/original/src/components/SingleProductCard/styles.tsx +27 -13
- package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
- package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
- package/themes/original/src/components/StripeCardsList/index.tsx +1 -1
- package/themes/original/src/components/StripeElementsForm/index.tsx +4 -1
- package/themes/original/src/components/UpsellingProducts/index.tsx +238 -218
- package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
- package/themes/original/src/components/UserDetails/index.tsx +8 -4
- package/themes/original/src/components/UserFormDetails/index.tsx +53 -54
- package/themes/original/src/components/UserProfile/index.tsx +58 -35
- package/themes/original/src/components/UserProfile/styles.ts +17 -0
- package/themes/original/src/components/UserProfileForm/index.tsx +21 -28
- package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
- package/themes/original/src/components/Wallets/index.tsx +31 -17
- package/themes/original/src/components/Wallets/styles.tsx +2 -0
- package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
- package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
- package/themes/original/src/components/shared/OBottomPopup.tsx +1 -1
- package/themes/original/src/components/shared/OButton.tsx +6 -2
- package/themes/original/src/components/shared/OIcon.tsx +8 -1
- package/themes/original/src/components/shared/OInput.tsx +10 -1
- package/themes/original/src/components/shared/OModal.tsx +3 -3
- package/themes/original/src/layouts/Container.tsx +13 -9
- package/themes/original/src/types/index.tsx +47 -9
- package/themes/original/src/utils/index.tsx +364 -58
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState, useEffect, useRef } from 'react'
|
|
2
2
|
import { useTheme } from 'styled-components/native'
|
|
3
|
-
import { Platform, View, StyleSheet, Dimensions, ScrollView, TouchableOpacity } from 'react-native'
|
|
4
|
-
import { OText, OButton, OModal } from '../shared'
|
|
3
|
+
import { Platform, View, StyleSheet, Dimensions, ScrollView, TouchableOpacity, Text } from 'react-native'
|
|
4
|
+
import { OText, OButton, OModal, OIcon } from '../shared'
|
|
5
5
|
import FastImage from 'react-native-fast-image'
|
|
6
6
|
import IconAntDesign from 'react-native-vector-icons/AntDesign'
|
|
7
7
|
import SelectDropdown from 'react-native-select-dropdown'
|
|
@@ -10,6 +10,10 @@ import CalendarPicker from 'react-native-calendar-picker'
|
|
|
10
10
|
import FeatherIcon from 'react-native-vector-icons/Feather';
|
|
11
11
|
import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
|
12
12
|
import { ServiceFormParams } from '../../types'
|
|
13
|
+
import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder';
|
|
14
|
+
import uuid from 'react-native-uuid';
|
|
15
|
+
import { orderTypeList } from '../../utils'
|
|
16
|
+
|
|
13
17
|
import {
|
|
14
18
|
ProductForm as ProductFormController,
|
|
15
19
|
useUtils,
|
|
@@ -35,14 +39,17 @@ const screenWidth = Dimensions.get('window').width
|
|
|
35
39
|
const ServiceFormUI = (props: ServiceFormParams) => {
|
|
36
40
|
const {
|
|
37
41
|
professionalSelected,
|
|
38
|
-
|
|
42
|
+
productObject,
|
|
39
43
|
handleSave,
|
|
40
44
|
productCart,
|
|
41
45
|
navigation,
|
|
42
46
|
isSoldOut,
|
|
43
47
|
maxProductQuantity,
|
|
44
48
|
onClose,
|
|
45
|
-
|
|
49
|
+
professionalListState,
|
|
50
|
+
isCartProduct,
|
|
51
|
+
actionStatus,
|
|
52
|
+
handleCreateGuestUser
|
|
46
53
|
} = props
|
|
47
54
|
|
|
48
55
|
const theme = useTheme()
|
|
@@ -52,15 +59,19 @@ const ServiceFormUI = (props: ServiceFormParams) => {
|
|
|
52
59
|
const [{ configs }] = useConfig()
|
|
53
60
|
const [orderState] = useOrder()
|
|
54
61
|
const [{ auth }] = useSession()
|
|
62
|
+
const { product, loading, error } = productObject;
|
|
55
63
|
|
|
56
64
|
const [selectDate, setSelectedDate] = useState<any>(new Date())
|
|
57
65
|
const [timeList, setTimeList] = useState<any>([])
|
|
58
66
|
const [isEnabled, setIsEnabled] = useState(false)
|
|
59
|
-
const [timeSelected, setTimeSelected] = useState(null)
|
|
67
|
+
const [timeSelected, setTimeSelected] = useState<string | null>(null)
|
|
60
68
|
const [dateSelected, setDateSelected] = useState<any>(null)
|
|
61
69
|
const [isOpen, setIsOpen] = useState(false)
|
|
62
70
|
const [currentProfessional, setCurrentProfessional] = useState<any>(null)
|
|
63
71
|
|
|
72
|
+
const guestCheckoutEnabled = configs?.guest_checkout_enabled?.value === '1'
|
|
73
|
+
const orderTypeEnabled = !orderTypeList[orderState?.options?.type - 1] || configs?.allowed_order_types_guest_checkout?.value?.includes(orderTypeList[orderState?.options?.type - 1])
|
|
74
|
+
|
|
64
75
|
const dropdownRef = useRef<any>(null)
|
|
65
76
|
|
|
66
77
|
const styles = StyleSheet.create({
|
|
@@ -99,17 +110,41 @@ const ServiceFormUI = (props: ServiceFormParams) => {
|
|
|
99
110
|
height: 40,
|
|
100
111
|
marginBottom: 30
|
|
101
112
|
},
|
|
113
|
+
dropDownRow: {
|
|
114
|
+
color: theme.colors.primary,
|
|
115
|
+
fontSize: 14,
|
|
116
|
+
marginHorizontal: 0
|
|
117
|
+
},
|
|
102
118
|
professionalList: {
|
|
103
119
|
paddingHorizontal: 40,
|
|
104
|
-
paddingVertical: 30
|
|
120
|
+
paddingVertical: 30,
|
|
105
121
|
}
|
|
106
122
|
})
|
|
107
123
|
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
124
|
+
const getMomentTime = (time) => {
|
|
125
|
+
const _moment = moment(`${moment(selectDate).format('YYYY-MM-DD')} ${time}`, 'YYYY-MM-DD HH:mm').toDate()
|
|
126
|
+
return _moment
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const isBusyTime = (professional, selectedMoment) => {
|
|
130
|
+
if (!selectedMoment) return false
|
|
131
|
+
const startDay = moment(selectedMoment).utc().format('d')
|
|
132
|
+
const isStartScheduleEnabled = professional?.schedule?.[startDay]?.enabled
|
|
133
|
+
const duration = product?.duration ?? 0
|
|
134
|
+
const endDay = moment(selectedMoment).add(duration - 1, 'minutes').utc().format('d')
|
|
135
|
+
const isEndScheduleEnabled = professional?.schedule?.[endDay]?.enabled
|
|
136
|
+
if (!isStartScheduleEnabled || !isEndScheduleEnabled) return true
|
|
137
|
+
|
|
138
|
+
if (professional?.busy_times?.length === 0) return false
|
|
139
|
+
|
|
140
|
+
const busyTimes = isCartProduct
|
|
141
|
+
? professional?.busy_times.filter(item => !(item.start === productCart?.calendar_event?.start && item.end === productCart?.calendar_event?.end))
|
|
142
|
+
: [...professional?.busy_times]
|
|
143
|
+
const valid = busyTimes.some(item => {
|
|
144
|
+
return (moment.utc(item?.start).local().valueOf() <= moment(selectedMoment).valueOf() &&
|
|
145
|
+
moment(selectedMoment).valueOf() < moment.utc(item?.end).local().valueOf()) ||
|
|
146
|
+
(moment.utc(item?.start).local().valueOf() < moment(selectedMoment).add(duration, 'minutes').valueOf() &&
|
|
147
|
+
moment(selectedMoment).add(duration, 'minutes').valueOf() < moment.utc(item?.end).local().valueOf())
|
|
113
148
|
})
|
|
114
149
|
return valid
|
|
115
150
|
}
|
|
@@ -130,6 +165,11 @@ const ServiceFormUI = (props: ServiceFormParams) => {
|
|
|
130
165
|
)
|
|
131
166
|
}
|
|
132
167
|
|
|
168
|
+
const handleUpdateGuest = () => {
|
|
169
|
+
const guestToken = uuid.v4()
|
|
170
|
+
if (guestToken) handleCreateGuestUser({ guest_token: guestToken })
|
|
171
|
+
}
|
|
172
|
+
|
|
133
173
|
const customDayHeaderStylesCallback = () => {
|
|
134
174
|
return {
|
|
135
175
|
textStyle: {
|
|
@@ -141,7 +181,7 @@ const ServiceFormUI = (props: ServiceFormParams) => {
|
|
|
141
181
|
|
|
142
182
|
const handleSaveService = () => {
|
|
143
183
|
const updated = {
|
|
144
|
-
serviceTime: dateSelected,
|
|
184
|
+
serviceTime: moment(dateSelected).utc().format('YYYY-MM-DD HH:mm:00'),
|
|
145
185
|
professional: currentProfessional
|
|
146
186
|
}
|
|
147
187
|
handleSave && handleSave(updated)
|
|
@@ -153,7 +193,7 @@ const ServiceFormUI = (props: ServiceFormParams) => {
|
|
|
153
193
|
}
|
|
154
194
|
|
|
155
195
|
const handleRedirectLogin = () => {
|
|
156
|
-
navigation.navigate('Login', {
|
|
196
|
+
navigation && navigation.navigate('Login', {
|
|
157
197
|
store_slug: props.businessSlug
|
|
158
198
|
});
|
|
159
199
|
onClose && onClose()
|
|
@@ -209,7 +249,7 @@ const ServiceFormUI = (props: ServiceFormParams) => {
|
|
|
209
249
|
}
|
|
210
250
|
|
|
211
251
|
const addressRedirect = () => {
|
|
212
|
-
navigation.navigate('AddressList')
|
|
252
|
+
navigation && navigation.navigate('AddressList')
|
|
213
253
|
onClose && onClose()
|
|
214
254
|
}
|
|
215
255
|
|
|
@@ -234,102 +274,146 @@ const ServiceFormUI = (props: ServiceFormParams) => {
|
|
|
234
274
|
}, [selectDate, timeSelected])
|
|
235
275
|
|
|
236
276
|
useEffect(() => {
|
|
237
|
-
if (!professionalSelected) return
|
|
277
|
+
if (!professionalSelected?.schedule) return
|
|
238
278
|
setCurrentProfessional(professionalSelected)
|
|
239
279
|
}, [professionalSelected])
|
|
280
|
+
|
|
281
|
+
useEffect(() => {
|
|
282
|
+
if (isCartProduct && professionalListState?.professionals?.length > 0) {
|
|
283
|
+
const professional = professionalListState?.professionals?.find((item: any) => item.id === professionalSelected?.id)
|
|
284
|
+
setCurrentProfessional(professional)
|
|
285
|
+
}
|
|
286
|
+
}, [isCartProduct, professionalListState?.professionals])
|
|
287
|
+
|
|
288
|
+
useEffect(() => {
|
|
289
|
+
if (!productCart?.calendar_event?.start) return
|
|
290
|
+
setSelectedDate(moment.utc(productCart?.calendar_event?.start).local())
|
|
291
|
+
setTimeSelected(moment.utc(productCart?.calendar_event?.start).local().format('HH:mm'))
|
|
292
|
+
}, [productCart])
|
|
240
293
|
|
|
241
294
|
return (
|
|
242
295
|
<>
|
|
243
|
-
|
|
244
|
-
<
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
>
|
|
271
|
-
{product?.description}
|
|
272
|
-
</OText>
|
|
273
|
-
</InfoWrapper>
|
|
274
|
-
<Divider />
|
|
275
|
-
<ProfessionalWrapper>
|
|
276
|
-
<View
|
|
277
|
-
style={{
|
|
278
|
-
flexDirection: 'row',
|
|
279
|
-
justifyContent: 'space-between',
|
|
280
|
-
alignItems: 'center',
|
|
281
|
-
marginBottom: 23
|
|
282
|
-
}}
|
|
283
|
-
>
|
|
296
|
+
{loading && !error && (
|
|
297
|
+
<Placeholder Animation={Fade}>
|
|
298
|
+
<PlaceholderLine
|
|
299
|
+
height={258}
|
|
300
|
+
style={{ borderRadius: 0 }}
|
|
301
|
+
width={screenWidth}
|
|
302
|
+
/>
|
|
303
|
+
</Placeholder>
|
|
304
|
+
)}
|
|
305
|
+
{!loading && !error && (
|
|
306
|
+
<Container>
|
|
307
|
+
{!!product?.images ? (
|
|
308
|
+
<ProfessionalPhoto
|
|
309
|
+
source={{
|
|
310
|
+
uri: product?.images
|
|
311
|
+
}}
|
|
312
|
+
/>
|
|
313
|
+
) : (
|
|
314
|
+
<OIcon
|
|
315
|
+
src={theme?.images?.dummies?.product}
|
|
316
|
+
cover={false}
|
|
317
|
+
style={{ alignSelf: 'center' }}
|
|
318
|
+
width={200}
|
|
319
|
+
height={200}
|
|
320
|
+
/>
|
|
321
|
+
)}
|
|
322
|
+
<InfoWrapper>
|
|
284
323
|
<OText
|
|
285
|
-
size={
|
|
324
|
+
size={20}
|
|
325
|
+
style={{ marginBottom: 4 }}
|
|
286
326
|
weight={Platform.OS === 'ios' ? '600' : 'bold'}
|
|
287
327
|
>
|
|
288
|
-
{
|
|
328
|
+
{product?.name}
|
|
329
|
+
</OText>
|
|
330
|
+
<OText
|
|
331
|
+
size={16}
|
|
332
|
+
style={{ marginBottom: 10 }}
|
|
333
|
+
weight={'400'}
|
|
334
|
+
>
|
|
335
|
+
{parsePrice(product?.price)} • {product?.duration}min
|
|
289
336
|
</OText>
|
|
290
337
|
<OText
|
|
291
|
-
size={
|
|
338
|
+
size={14}
|
|
292
339
|
weight={'400'}
|
|
293
|
-
color={theme
|
|
340
|
+
color={theme?.colors?.disabled}
|
|
294
341
|
>
|
|
295
|
-
{
|
|
342
|
+
{product?.description}
|
|
296
343
|
</OText>
|
|
297
|
-
</
|
|
298
|
-
|
|
344
|
+
</InfoWrapper>
|
|
345
|
+
<Divider />
|
|
346
|
+
<ProfessionalWrapper>
|
|
347
|
+
<View
|
|
348
|
+
style={{
|
|
349
|
+
flexDirection: 'row',
|
|
350
|
+
justifyContent: 'space-between',
|
|
351
|
+
alignItems: 'center',
|
|
352
|
+
marginBottom: 23
|
|
353
|
+
}}
|
|
354
|
+
>
|
|
355
|
+
<OText
|
|
356
|
+
size={16}
|
|
357
|
+
weight={Platform.OS === 'ios' ? '600' : 'bold'}
|
|
358
|
+
>
|
|
359
|
+
{t('PROFESSIONAL', 'Professional')}
|
|
360
|
+
</OText>
|
|
361
|
+
<OText
|
|
362
|
+
size={10}
|
|
363
|
+
weight={'400'}
|
|
364
|
+
color={theme.colors?.danger5}
|
|
365
|
+
>
|
|
366
|
+
{t('REQUIRED', 'Required')}
|
|
367
|
+
</OText>
|
|
368
|
+
</View>
|
|
299
369
|
<TouchableOpacity
|
|
300
370
|
style={styles.professionalSelect}
|
|
301
371
|
onPress={() => setIsOpen(true)}
|
|
302
372
|
>
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
style={
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
373
|
+
{!!currentProfessional ? (
|
|
374
|
+
<>
|
|
375
|
+
<View style={{ flexDirection: 'row' }}>
|
|
376
|
+
{!!currentProfessional?.photo ? (
|
|
377
|
+
<FastImage
|
|
378
|
+
style={styles.photoStyle}
|
|
379
|
+
source={{
|
|
380
|
+
uri: optimizeImage(currentProfessional?.photo, 'h_250,c_limit'),
|
|
381
|
+
priority: FastImage.priority.normal,
|
|
382
|
+
}}
|
|
383
|
+
resizeMode={FastImage.resizeMode.cover}
|
|
384
|
+
/>
|
|
385
|
+
) : (
|
|
386
|
+
<OIcon
|
|
387
|
+
src={theme?.images?.general?.user}
|
|
388
|
+
cover={false}
|
|
389
|
+
style={styles.photoStyle}
|
|
390
|
+
/>
|
|
391
|
+
)}
|
|
392
|
+
<View style={{ marginLeft: 14 }}>
|
|
393
|
+
<OText
|
|
394
|
+
size={14}
|
|
395
|
+
weight={'400'}
|
|
396
|
+
lineHeight={22}
|
|
397
|
+
>
|
|
398
|
+
{currentProfessional?.name} {currentProfessional?.lastname}
|
|
399
|
+
</OText>
|
|
400
|
+
<OText
|
|
401
|
+
size={12}
|
|
402
|
+
weight={'400'}
|
|
403
|
+
lineHeight={17}
|
|
404
|
+
color={isBusyTime(currentProfessional, dateSelected) ? theme.colors.danger5 : theme.colors.success500}
|
|
405
|
+
>
|
|
406
|
+
{isBusyTime(currentProfessional, dateSelected)
|
|
407
|
+
? t('BUSY_ON_SELECTED_TIME', 'Busy on selected time')
|
|
408
|
+
: t('AVAILABLE', 'Available')
|
|
409
|
+
}
|
|
410
|
+
</OText>
|
|
411
|
+
</View>
|
|
412
|
+
</View>
|
|
413
|
+
</>
|
|
414
|
+
) : (
|
|
415
|
+
<OText size={12}>{t('SELECT_PROFESSIONAL', 'Select professional')}</OText>
|
|
416
|
+
)}
|
|
333
417
|
<View style={{ marginLeft: 5 }}>
|
|
334
418
|
<IconAntDesign
|
|
335
419
|
name='down'
|
|
@@ -338,179 +422,194 @@ const ServiceFormUI = (props: ServiceFormParams) => {
|
|
|
338
422
|
/>
|
|
339
423
|
</View>
|
|
340
424
|
</TouchableOpacity>
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
}}
|
|
351
|
-
>
|
|
352
|
-
<OText
|
|
353
|
-
size={16}
|
|
354
|
-
weight={Platform.OS === 'ios' ? '600' : 'bold'}
|
|
425
|
+
</ProfessionalWrapper>
|
|
426
|
+
<ScheduleWrapper>
|
|
427
|
+
<View
|
|
428
|
+
style={{
|
|
429
|
+
flexDirection: 'row',
|
|
430
|
+
justifyContent: 'space-between',
|
|
431
|
+
alignItems: 'center',
|
|
432
|
+
marginBottom: 23
|
|
433
|
+
}}
|
|
355
434
|
>
|
|
356
|
-
|
|
357
|
-
|
|
435
|
+
<OText
|
|
436
|
+
size={16}
|
|
437
|
+
weight={Platform.OS === 'ios' ? '600' : 'bold'}
|
|
438
|
+
>
|
|
439
|
+
{t('SCHEDULE', 'Schedule')}
|
|
440
|
+
</OText>
|
|
441
|
+
<OText
|
|
442
|
+
size={10}
|
|
443
|
+
weight={'400'}
|
|
444
|
+
color={theme.colors?.danger5}
|
|
445
|
+
>
|
|
446
|
+
{t('REQUIRED', 'Required')}
|
|
447
|
+
</OText>
|
|
448
|
+
</View>
|
|
449
|
+
{!!currentProfessional?.schedule ? (
|
|
450
|
+
<CalendarWrapper>
|
|
451
|
+
{(timeList?.length > 0 && isEnabled) ? (
|
|
452
|
+
<SelectDropdown
|
|
453
|
+
ref={dropdownRef}
|
|
454
|
+
defaultValueByIndex={timeList.findIndex((item: any) => item.value === timeSelected)}
|
|
455
|
+
data={timeList}
|
|
456
|
+
onSelect={(selectedItem, index) => {
|
|
457
|
+
setTimeSelected(selectedItem?.value)
|
|
458
|
+
}}
|
|
459
|
+
buttonTextAfterSelection={(selectedItem, index) => {
|
|
460
|
+
return selectedItem?.text
|
|
461
|
+
}}
|
|
462
|
+
rowTextForSelection={(item, index) => {
|
|
463
|
+
return item.text
|
|
464
|
+
}}
|
|
465
|
+
buttonStyle={{borderRadius: 7.6, ...styles.selectOption}}
|
|
466
|
+
buttonTextStyle={{
|
|
467
|
+
color: theme.colors.disabled,
|
|
468
|
+
fontSize: 14,
|
|
469
|
+
textAlign: 'left',
|
|
470
|
+
marginHorizontal: 0
|
|
471
|
+
}}
|
|
472
|
+
dropdownStyle={{
|
|
473
|
+
borderRadius: 8,
|
|
474
|
+
borderColor: theme.colors.lightGray,
|
|
475
|
+
marginTop: Platform.OS === 'ios' ? 12 : -top
|
|
476
|
+
}}
|
|
477
|
+
rowStyle={{
|
|
478
|
+
borderBottomColor: theme.colors.backgroundGray100,
|
|
479
|
+
backgroundColor: theme.colors.backgroundGray100,
|
|
480
|
+
height: 30,
|
|
481
|
+
flexDirection: 'column',
|
|
482
|
+
alignItems: 'flex-start',
|
|
483
|
+
paddingTop: 8,
|
|
484
|
+
paddingHorizontal: 12
|
|
485
|
+
}}
|
|
486
|
+
renderCustomizedRowChild={(item, index) => {
|
|
487
|
+
return (
|
|
488
|
+
<Text style={[styles.dropDownRow, { color: isBusyTime(currentProfessional, getMomentTime(item.value)) ? theme.colors.lightGray : theme.colors.primary } ]}>
|
|
489
|
+
{item.text}
|
|
490
|
+
</Text>
|
|
491
|
+
)
|
|
492
|
+
}}
|
|
493
|
+
renderDropdownIcon={() => dropDownIcon()}
|
|
494
|
+
dropdownOverlayColor='transparent'
|
|
495
|
+
/>
|
|
496
|
+
) : (
|
|
497
|
+
<OText
|
|
498
|
+
size={12}
|
|
499
|
+
style={{ marginBottom: 30 }}
|
|
500
|
+
weight={'400'}
|
|
501
|
+
color={theme.colors?.danger5}
|
|
502
|
+
>
|
|
503
|
+
{t('PROFESSIONAL_NOT_AVAILABLE', 'Professional is not available at the moment')}
|
|
504
|
+
</OText>
|
|
505
|
+
)}
|
|
506
|
+
<CalendarPicker
|
|
507
|
+
previousComponent={
|
|
508
|
+
<FeatherIcon
|
|
509
|
+
name='chevron-left'
|
|
510
|
+
color={theme.colors.disabled}
|
|
511
|
+
size={24}
|
|
512
|
+
style={{ marginHorizontal: 4 }}
|
|
513
|
+
/>
|
|
514
|
+
}
|
|
515
|
+
nextComponent={
|
|
516
|
+
<FeatherIcon
|
|
517
|
+
name='chevron-right'
|
|
518
|
+
color={theme.colors.disabled}
|
|
519
|
+
size={24}
|
|
520
|
+
style={{ marginHorizontal: 4 }}
|
|
521
|
+
/>
|
|
522
|
+
}
|
|
523
|
+
width={screenWidth - 110}
|
|
524
|
+
selectedDayTextColor={theme.colors.white}
|
|
525
|
+
selectedDayColor={theme.colors.primary}
|
|
526
|
+
todayBackgroundColor={theme.colors.border}
|
|
527
|
+
dayLabelsWrapper={{ borderColor: theme.colors.clear }}
|
|
528
|
+
onDateChange={onDateChange}
|
|
529
|
+
minDate={new Date()}
|
|
530
|
+
customDayHeaderStyles={customDayHeaderStylesCallback}
|
|
531
|
+
selectedStartDate={selectDate}
|
|
532
|
+
/>
|
|
533
|
+
</CalendarWrapper>
|
|
534
|
+
) : (
|
|
535
|
+
<OText
|
|
536
|
+
size={16}
|
|
537
|
+
style={{ marginBottom: 30, textAlign: 'center' }}
|
|
538
|
+
color={theme?.colors?.disabled}
|
|
539
|
+
weight={Platform.OS === 'ios' ? '600' : 'bold'}
|
|
540
|
+
>
|
|
541
|
+
{t('NO_SCHEDULE', 'No schedule')}
|
|
542
|
+
</OText>
|
|
543
|
+
)}
|
|
544
|
+
</ScheduleWrapper>
|
|
545
|
+
<ButtonWrapper>
|
|
358
546
|
<OText
|
|
359
|
-
size={
|
|
360
|
-
weight={'
|
|
361
|
-
color={theme.colors?.danger5}
|
|
547
|
+
size={14}
|
|
548
|
+
weight={Platform.OS === 'ios' ? '600' : 'bold'}
|
|
362
549
|
>
|
|
363
|
-
{
|
|
550
|
+
{dateSelected && moment(dateSelected).format('hh:mm A')}
|
|
364
551
|
</OText>
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
}}
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
}}
|
|
389
|
-
dropdownStyle={{
|
|
390
|
-
borderRadius: 8,
|
|
391
|
-
borderColor: theme.colors.lightGray,
|
|
392
|
-
marginTop: Platform.OS === 'ios' ? 12 : -top
|
|
393
|
-
}}
|
|
394
|
-
rowStyle={{
|
|
395
|
-
borderBottomColor: theme.colors.backgroundGray100,
|
|
396
|
-
backgroundColor: theme.colors.backgroundGray100,
|
|
397
|
-
height: 30,
|
|
398
|
-
flexDirection: 'column',
|
|
399
|
-
alignItems: 'flex-start',
|
|
400
|
-
paddingTop: 8,
|
|
401
|
-
paddingHorizontal: 12
|
|
402
|
-
}}
|
|
403
|
-
rowTextStyle={{
|
|
404
|
-
color: theme.colors.disabled,
|
|
405
|
-
fontSize: 14,
|
|
406
|
-
marginHorizontal: 0
|
|
407
|
-
}}
|
|
408
|
-
renderDropdownIcon={() => dropDownIcon()}
|
|
409
|
-
dropdownOverlayColor='transparent'
|
|
552
|
+
{((productCart &&
|
|
553
|
+
auth &&
|
|
554
|
+
orderState.options?.address_id)) && (
|
|
555
|
+
<OButton
|
|
556
|
+
bgColor={theme.colors.primary}
|
|
557
|
+
onClick={() => handleSaveService()}
|
|
558
|
+
text={orderState.loading
|
|
559
|
+
? t('LOADING', 'Loading')
|
|
560
|
+
: ((isSoldOut || maxProductQuantity <= 0)
|
|
561
|
+
? t('SOLD_OUT', 'Sold out')
|
|
562
|
+
: t('BOOK', 'Book'))}
|
|
563
|
+
style={styles.buttonStyle}
|
|
564
|
+
isDisabled={isSoldOut || maxProductQuantity <= 0 || !currentProfessional?.id || !dateSelected || isBusyTime(currentProfessional, dateSelected)}
|
|
565
|
+
textStyle={{ fontSize: 14, color: theme.colors.white }}
|
|
566
|
+
/>
|
|
567
|
+
)}
|
|
568
|
+
{auth &&
|
|
569
|
+
!orderState.options?.address_id &&
|
|
570
|
+
(orderState.loading ? (
|
|
571
|
+
<OButton
|
|
572
|
+
isDisabled
|
|
573
|
+
text={t('LOADING', 'Loading')}
|
|
574
|
+
imgRightSrc=""
|
|
575
|
+
textStyle={{ fontSize: 10 }}
|
|
410
576
|
/>
|
|
411
577
|
) : (
|
|
412
|
-
<
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
{
|
|
419
|
-
|
|
578
|
+
<OButton onClick={() => addressRedirect()} />
|
|
579
|
+
))}
|
|
580
|
+
{!auth && (
|
|
581
|
+
<OButton
|
|
582
|
+
isDisabled={isSoldOut || maxProductQuantity <= 0}
|
|
583
|
+
onClick={() => handleRedirectLogin()}
|
|
584
|
+
text={
|
|
585
|
+
isSoldOut || maxProductQuantity <= 0
|
|
586
|
+
? t('SOLD_OUT', 'Sold out')
|
|
587
|
+
: t('LOGIN_SIGNUP', 'Login / Sign Up')
|
|
588
|
+
}
|
|
589
|
+
imgRightSrc=""
|
|
590
|
+
textStyle={{ color: theme.colors.primary, fontSize: 14 }}
|
|
591
|
+
style={{
|
|
592
|
+
height: 44,
|
|
593
|
+
borderColor: theme.colors.primary,
|
|
594
|
+
backgroundColor: theme.colors.white,
|
|
595
|
+
}}
|
|
596
|
+
/>
|
|
420
597
|
)}
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
/>
|
|
437
|
-
}
|
|
438
|
-
width={screenWidth - 110}
|
|
439
|
-
selectedDayTextColor={theme.colors.white}
|
|
440
|
-
selectedDayColor={theme.colors.primary}
|
|
441
|
-
todayBackgroundColor={theme.colors.border}
|
|
442
|
-
dayLabelsWrapper={{ borderColor: theme.colors.clear }}
|
|
443
|
-
onDateChange={onDateChange}
|
|
444
|
-
minDate={new Date()}
|
|
445
|
-
customDayHeaderStyles={customDayHeaderStylesCallback}
|
|
446
|
-
selectedStartDate={selectDate}
|
|
447
|
-
/>
|
|
448
|
-
</CalendarWrapper>
|
|
449
|
-
) : (
|
|
450
|
-
<OText
|
|
451
|
-
size={20}
|
|
452
|
-
style={{ marginBottom: 30 }}
|
|
453
|
-
weight={Platform.OS === 'ios' ? '600' : 'bold'}
|
|
454
|
-
>
|
|
455
|
-
{t('NO_SCHEDULE', 'No schedule')}
|
|
456
|
-
</OText>
|
|
457
|
-
)}
|
|
458
|
-
</ScheduleWrapper>
|
|
459
|
-
<ButtonWrapper>
|
|
460
|
-
<OText
|
|
461
|
-
size={14}
|
|
462
|
-
weight={Platform.OS === 'ios' ? '600' : 'bold'}
|
|
463
|
-
>
|
|
464
|
-
{dateSelected && moment(dateSelected).format('hh:mm A')}
|
|
465
|
-
</OText>
|
|
466
|
-
{((productCart &&
|
|
467
|
-
auth &&
|
|
468
|
-
orderState.options?.address_id)) && (
|
|
469
|
-
<OButton
|
|
470
|
-
bgColor={theme.colors.primary}
|
|
471
|
-
onClick={() => handleSaveService()}
|
|
472
|
-
text={orderState.loading
|
|
473
|
-
? t('LOADING', 'Loading')
|
|
474
|
-
: ((isSoldOut || maxProductQuantity <= 0)
|
|
475
|
-
? t('SOLD_OUT', 'Sold out')
|
|
476
|
-
: t('BOOK', 'Book'))}
|
|
477
|
-
style={styles.buttonStyle}
|
|
478
|
-
isDisabled={isSoldOut || maxProductQuantity <= 0 || !currentProfessional?.id || !dateSelected}
|
|
479
|
-
textStyle={{ fontSize: 14, color: theme.colors.white }}
|
|
480
|
-
/>
|
|
481
|
-
)}
|
|
482
|
-
{auth &&
|
|
483
|
-
!orderState.options?.address_id &&
|
|
484
|
-
(orderState.loading ? (
|
|
485
|
-
<OButton
|
|
486
|
-
isDisabled
|
|
487
|
-
text={t('LOADING', 'Loading')}
|
|
488
|
-
imgRightSrc=""
|
|
489
|
-
textStyle={{ fontSize: 10 }}
|
|
490
|
-
/>
|
|
491
|
-
) : (
|
|
492
|
-
<OButton onClick={() => addressRedirect()} />
|
|
493
|
-
))}
|
|
494
|
-
{!auth && (
|
|
495
|
-
<OButton
|
|
496
|
-
isDisabled={isSoldOut || maxProductQuantity <= 0}
|
|
497
|
-
onClick={() => handleRedirectLogin()}
|
|
498
|
-
text={
|
|
499
|
-
isSoldOut || maxProductQuantity <= 0
|
|
500
|
-
? t('SOLD_OUT', 'Sold out')
|
|
501
|
-
: t('LOGIN_SIGNUP', 'Login / Sign Up')
|
|
502
|
-
}
|
|
503
|
-
imgRightSrc=""
|
|
504
|
-
textStyle={{ color: theme.colors.primary, fontSize: 14 }}
|
|
505
|
-
style={{
|
|
506
|
-
height: 44,
|
|
507
|
-
borderColor: theme.colors.primary,
|
|
508
|
-
backgroundColor: theme.colors.white,
|
|
509
|
-
}}
|
|
510
|
-
/>
|
|
511
|
-
)}
|
|
512
|
-
</ButtonWrapper>
|
|
513
|
-
</Container>
|
|
598
|
+
{!auth && guestCheckoutEnabled && orderTypeEnabled && (
|
|
599
|
+
<TouchableOpacity style={{ marginTop: 10 }} onPress={handleUpdateGuest}>
|
|
600
|
+
{actionStatus?.loading ? (
|
|
601
|
+
<Placeholder Animation={Fade}>
|
|
602
|
+
<PlaceholderLine width={60} height={20} />
|
|
603
|
+
</Placeholder>
|
|
604
|
+
) : (
|
|
605
|
+
<OText color={theme.colors.primary} size={13}>{t('WITH_GUEST_USER', 'With Guest user')}</OText>
|
|
606
|
+
)}
|
|
607
|
+
</TouchableOpacity>
|
|
608
|
+
)}
|
|
609
|
+
</ButtonWrapper>
|
|
610
|
+
</Container>
|
|
611
|
+
)}
|
|
612
|
+
|
|
514
613
|
<OModal
|
|
515
614
|
open={isOpen}
|
|
516
615
|
onClose={() => setIsOpen(false)}
|
|
@@ -525,21 +624,29 @@ const ServiceFormUI = (props: ServiceFormParams) => {
|
|
|
525
624
|
{t('ANY_OROFESSIONAL_MEMBER', 'Any professional member')}
|
|
526
625
|
</OText>
|
|
527
626
|
</View>
|
|
528
|
-
{
|
|
627
|
+
{professionalListState?.professionals?.map((professional: any) => (
|
|
529
628
|
<TouchableOpacity
|
|
530
629
|
key={professional?.id}
|
|
531
630
|
style={styles.professionalItem}
|
|
532
631
|
onPress={() => handleChangeProfessional(professional)}
|
|
533
632
|
>
|
|
534
633
|
<View style={{ flexDirection: 'row' }}>
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
634
|
+
{!!professional?.photo ? (
|
|
635
|
+
<FastImage
|
|
636
|
+
style={styles.photoStyle}
|
|
637
|
+
source={{
|
|
638
|
+
uri: optimizeImage(professional?.photo, 'h_250,c_limit'),
|
|
639
|
+
priority: FastImage.priority.normal,
|
|
640
|
+
}}
|
|
641
|
+
resizeMode={FastImage.resizeMode.cover}
|
|
642
|
+
/>
|
|
643
|
+
) : (
|
|
644
|
+
<OIcon
|
|
645
|
+
src={theme?.images?.general?.user}
|
|
646
|
+
cover={false}
|
|
647
|
+
style={styles.photoStyle}
|
|
648
|
+
/>
|
|
649
|
+
)}
|
|
543
650
|
<View style={{ marginLeft: 14 }}>
|
|
544
651
|
<OText
|
|
545
652
|
size={14}
|
|
@@ -552,9 +659,9 @@ const ServiceFormUI = (props: ServiceFormParams) => {
|
|
|
552
659
|
size={12}
|
|
553
660
|
weight={'400'}
|
|
554
661
|
lineHeight={17}
|
|
555
|
-
color={isBusyTime(professional) ? theme.colors.danger5 : theme.colors.success500}
|
|
662
|
+
color={isBusyTime(professional, dateSelected) ? theme.colors.danger5 : theme.colors.success500}
|
|
556
663
|
>
|
|
557
|
-
{isBusyTime(professional)
|
|
664
|
+
{isBusyTime(professional, dateSelected)
|
|
558
665
|
? t('BUSY_ON_SELECTED_TIME', 'Busy on selected time')
|
|
559
666
|
: t('AVAILABLE', 'Available')
|
|
560
667
|
}
|