ordering-ui-react-native 0.16.83 → 0.16.84-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 +19 -4
- package/src/components/BusinessInformation/styles.tsx +2 -2
- package/src/components/BusinessProductsList/index.tsx +10 -10
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/LanguageSelector/index.tsx +21 -16
- package/src/components/Messages/index.tsx +2 -2
- 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/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OToast.tsx +4 -4
- package/src/utils/index.tsx +2 -1
- package/themes/business/index.tsx +2 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +260 -238
- package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
- package/themes/business/src/components/BusinessController/index.tsx +2 -2
- package/themes/business/src/components/Chat/index.tsx +31 -31
- 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 +236 -80
- package/themes/business/src/components/LoginForm/styles.tsx +10 -0
- package/themes/business/src/components/MapView/index.tsx +19 -8
- package/themes/business/src/components/MessagesOption/index.tsx +11 -1
- package/themes/business/src/components/NewOrderNotification/index.tsx +31 -41
- 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 +3 -3
- 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/OrdersOption/index.tsx +63 -73
- package/themes/business/src/components/OrdersOption/styles.tsx +5 -1
- package/themes/business/src/components/OrdersOptionBusiness/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionCity/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionDate/index.tsx +19 -6
- package/themes/business/src/components/OrdersOptionDelivery/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionDriver/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionPaymethod/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionStatus/index.tsx +10 -1
- package/themes/business/src/components/PreviousMessages/index.tsx +17 -18
- 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 +447 -247
- 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 +39 -15
- package/themes/business/src/components/shared/ODropDown.tsx +42 -8
- package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
- 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 +35 -3
- package/themes/business/src/utils/index.tsx +53 -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 +1 -0
- 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 +10 -8
- package/themes/original/src/components/AddressForm/index.tsx +155 -139
- package/themes/original/src/components/AddressList/index.tsx +18 -18
- package/themes/original/src/components/AddressList/styles.tsx +4 -2
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +118 -76
- package/themes/original/src/components/BusinessController/index.tsx +101 -70
- package/themes/original/src/components/BusinessController/styles.tsx +14 -9
- package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +12 -6
- package/themes/original/src/components/BusinessListingSearch/BusinessControllerSkeletons/index.tsx +57 -0
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +59 -0
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/styles.tsx +13 -0
- package/themes/original/src/components/BusinessListingSearch/index.tsx +102 -155
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +10 -12
- package/themes/original/src/components/BusinessPreorder/index.tsx +96 -15
- package/themes/original/src/components/BusinessProductsList/index.tsx +11 -8
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +564 -495
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +13 -12
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -2
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +2 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +116 -81
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
- package/themes/original/src/components/BusinessesListing/index.tsx +6 -6
- package/themes/original/src/components/Cart/index.tsx +83 -42
- package/themes/original/src/components/CartContent/index.tsx +80 -18
- package/themes/original/src/components/CartContent/styles.tsx +11 -1
- package/themes/original/src/components/Checkout/index.tsx +74 -86
- 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/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/index.tsx +20 -19
- package/themes/original/src/components/GPSButton/styles.ts +3 -3
- package/themes/original/src/components/GoogleMap/index.tsx +10 -1
- package/themes/original/src/components/Help/index.tsx +8 -8
- package/themes/original/src/components/HelpAccountAndPayment/index.tsx +14 -20
- package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +6 -0
- package/themes/original/src/components/HelpGuide/index.tsx +13 -12
- package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
- package/themes/original/src/components/HelpOrder/index.tsx +12 -20
- package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
- 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 +28 -8
- package/themes/original/src/components/LottieAnimation/index.tsx +78 -0
- package/themes/original/src/components/MessageListing/index.tsx +7 -40
- package/themes/original/src/components/Messages/index.tsx +42 -26
- 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 +92 -93
- package/themes/original/src/components/MultiCheckout/index.tsx +179 -77
- package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +85 -34
- 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 +7 -6
- package/themes/original/src/components/NetworkError/index.tsx +5 -3
- package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
- 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/index.tsx +108 -218
- package/themes/original/src/components/OrderDetails/styles.tsx +10 -1
- package/themes/original/src/components/OrderItAgain/index.tsx +46 -43
- package/themes/original/src/components/OrderProgress/index.tsx +82 -106
- package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
- package/themes/original/src/components/OrderSummary/index.tsx +2 -2
- package/themes/original/src/components/OrderTypeSelector/index.tsx +13 -6
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +93 -97
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
- package/themes/original/src/components/OrdersOption/index.tsx +83 -91
- package/themes/original/src/components/PageBanner/index.tsx +146 -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 +2 -2
- package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
- 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 -256
- package/themes/original/src/components/ProductForm/styles.tsx +5 -8
- package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -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 +7 -2
- package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
- package/themes/original/src/components/ReviewOrder/index.tsx +43 -11
- package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
- package/themes/original/src/components/ReviewProducts/index.tsx +8 -5
- 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 +78 -66
- package/themes/original/src/components/SingleOrderCard/index.tsx +125 -56
- package/themes/original/src/components/SingleOrderCard/styles.tsx +10 -8
- package/themes/original/src/components/SingleProductCard/index.tsx +112 -77
- package/themes/original/src/components/SingleProductCard/styles.tsx +14 -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 +244 -215
- package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
- package/themes/original/src/components/UserDetails/index.tsx +5 -3
- package/themes/original/src/components/UserFormDetails/index.tsx +50 -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/WalletTransactions/index.tsx +76 -0
- package/themes/original/src/components/WalletTransactions/styles.tsx +13 -0
- package/themes/original/src/components/Wallets/index.tsx +177 -164
- package/themes/original/src/components/Wallets/styles.tsx +12 -8
- 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 +9 -4
- package/themes/original/src/components/shared/OIcon.tsx +8 -1
- package/themes/original/src/components/shared/OInput.tsx +10 -1
- package/themes/original/src/layouts/Container.tsx +13 -9
- package/themes/original/src/types/index.tsx +42 -7
- package/themes/original/src/utils/index.tsx +321 -58
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components/native'
|
|
2
2
|
|
|
3
|
+
export const BContainer = styled.View`
|
|
4
|
+
padding: 20px 40px;
|
|
5
|
+
`
|
|
6
|
+
|
|
3
7
|
export const WrapHeader = styled.View`
|
|
4
8
|
width: 100%;
|
|
5
9
|
padding-vertical: 20px;
|
|
@@ -55,18 +59,6 @@ export const LoadMoreBusinessContainer = styled.View`
|
|
|
55
59
|
margin-left: 20px;
|
|
56
60
|
`
|
|
57
61
|
|
|
58
|
-
export const ProgressBar = styled.View`
|
|
59
|
-
height: 4px;
|
|
60
|
-
background: ${(props: any) => props.theme.colors.textNormal};
|
|
61
|
-
`
|
|
62
|
-
|
|
63
|
-
export const ProgressContentWrapper = styled.View`
|
|
64
|
-
height: 4px;
|
|
65
|
-
background: #F8F9FA;
|
|
66
|
-
margin-bottom: 10px;
|
|
67
|
-
flex: 1;
|
|
68
|
-
`
|
|
69
|
-
|
|
70
62
|
export const TagsContainer = styled.View`
|
|
71
63
|
padding-bottom: 10px;
|
|
72
64
|
`
|
|
@@ -94,3 +86,9 @@ export const OptionTitle = styled.View`
|
|
|
94
86
|
margin-left: ${() => props.isBusinessesSearchList ? '0' : '40px'};
|
|
95
87
|
`}
|
|
96
88
|
`
|
|
89
|
+
|
|
90
|
+
export const WrapperButtons = styled.View`
|
|
91
|
+
flex-direction: row;
|
|
92
|
+
width: 100%;
|
|
93
|
+
justify-content: space-between;
|
|
94
|
+
`
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
2
|
import { TouchableOpacity, StyleSheet, View, Dimensions, Platform } from 'react-native'
|
|
3
3
|
import { useLanguage, useUtils, useConfig, useOrder, MomentOption } from 'ordering-components/native'
|
|
4
|
-
import { OButton, OText } from '../shared'
|
|
4
|
+
import { OButton, OIcon, OText } from '../shared'
|
|
5
5
|
import { useTheme } from 'styled-components/native'
|
|
6
6
|
import IconAntDesign from 'react-native-vector-icons/AntDesign'
|
|
7
7
|
import FastImage from 'react-native-fast-image'
|
|
@@ -37,7 +37,10 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
|
|
|
37
37
|
handleChangeDate,
|
|
38
38
|
handleChangeTime,
|
|
39
39
|
handleAsap,
|
|
40
|
-
|
|
40
|
+
getActualSchedule,
|
|
41
|
+
isAsap,
|
|
42
|
+
cateringPreorder,
|
|
43
|
+
preorderLeadTime
|
|
41
44
|
} = props
|
|
42
45
|
|
|
43
46
|
const theme = useTheme()
|
|
@@ -52,6 +55,8 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
|
|
|
52
55
|
const [datesWhitelist, setDateWhitelist] = useState<any>([{ start: null, end: null }])
|
|
53
56
|
const [isEnabled, setIsEnabled] = useState(false)
|
|
54
57
|
const { top } = useSafeAreaInsets()
|
|
58
|
+
const is12hours = configs?.dates_moment_format?.value?.includes('hh:mm')
|
|
59
|
+
|
|
55
60
|
const showOrderTime = (selectedPreorderType === 1 && Object.keys(menu)?.length > 0) || selectedPreorderType === 0
|
|
56
61
|
const isPreOrderSetting = configs?.preorder_status_enabled?.value === '1'
|
|
57
62
|
const styles = StyleSheet.create({
|
|
@@ -252,10 +257,45 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
|
|
|
252
257
|
|
|
253
258
|
useEffect(() => {
|
|
254
259
|
if (selectDate === null) return
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
260
|
+
if (cateringPreorder) {
|
|
261
|
+
let _timeLists = []
|
|
262
|
+
const schedule = business && getActualSchedule()
|
|
263
|
+
if (!schedule && cateringPreorder && Object.keys(business)?.length > 0) {
|
|
264
|
+
return
|
|
265
|
+
}
|
|
266
|
+
_timeLists = hoursList
|
|
267
|
+
.filter(hour => ((Object.keys(business || {})?.length === 0) || schedule?.lapses?.some((lapse: any) =>
|
|
268
|
+
moment(dateSelected + ` ${hour.startTime}`) >= moment(dateSelected + ` ${lapse.open.hour}:${lapse.open.minute}`).add(preorderLeadTime, 'minutes') && moment(dateSelected + ` ${hour.endTime}`) <= moment(dateSelected + ` ${lapse.close.hour}:${lapse.close.minute}`))) &&
|
|
269
|
+
moment(dateSelected + ` ${hour.startTime}`) < moment(dateSelected + ` ${hour.endTime}`) &&
|
|
270
|
+
(moment().add(preorderLeadTime, 'minutes') < moment(dateSelected + ` ${hour.startTime}`) || !cateringPreorder))
|
|
271
|
+
.map(hour => {
|
|
272
|
+
return {
|
|
273
|
+
value: hour.startTime,
|
|
274
|
+
text: is12hours ? (
|
|
275
|
+
hour.startTime.includes('12')
|
|
276
|
+
? `${hour.startTime}PM`
|
|
277
|
+
: parseTime(moment(hour.startTime, 'HH:mm'), { outputFormat: 'hh:mma' })
|
|
278
|
+
) : (
|
|
279
|
+
parseTime(moment(hour.startTime, 'HH:mm'), { outputFormat: 'HH:mm' })
|
|
280
|
+
),
|
|
281
|
+
endText: is12hours ? (
|
|
282
|
+
hour.endTime.includes('12')
|
|
283
|
+
? `${hour.endTime}PM`
|
|
284
|
+
: parseTime(moment(hour.endTime, 'HH:mm'), { outputFormat: 'hh:mma' })
|
|
285
|
+
) : (
|
|
286
|
+
parseTime(moment(hour.endTime, 'HH:mm'), { outputFormat: 'HH:mm' })
|
|
287
|
+
)
|
|
288
|
+
}
|
|
289
|
+
})
|
|
290
|
+
if (_timeLists?.length > 0) {
|
|
291
|
+
setTimeList(_timeLists)
|
|
292
|
+
}
|
|
293
|
+
} else {
|
|
294
|
+
const selectedMenu = Object.keys(menu).length > 0 ? (menu?.use_business_schedule ? business : menu) : business
|
|
295
|
+
const _times = getTimes(selectDate, selectedMenu)
|
|
296
|
+
setTimeList(_times)
|
|
297
|
+
}
|
|
298
|
+
}, [selectDate, menu, business, cateringPreorder, hoursList, dateSelected])
|
|
259
299
|
|
|
260
300
|
useEffect(() => {
|
|
261
301
|
if (selectedPreorderType === 0 && Object.keys(menu).length > 0) setMenu({})
|
|
@@ -263,6 +303,7 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
|
|
|
263
303
|
|
|
264
304
|
useEffect(() => {
|
|
265
305
|
if (dateSelected) {
|
|
306
|
+
|
|
266
307
|
const dateParts = dateSelected.split('-')
|
|
267
308
|
const _dateSelected = new Date(dateParts[0], dateParts[1] - 1, dateParts[2])
|
|
268
309
|
setSelectedDate(_dateSelected)
|
|
@@ -302,7 +343,7 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
|
|
|
302
343
|
/>
|
|
303
344
|
</View>
|
|
304
345
|
</BusinessInfoWrapper>
|
|
305
|
-
{isPreOrderSetting && (
|
|
346
|
+
{isPreOrderSetting && !cateringPreorder && (
|
|
306
347
|
<PreorderTypeWrapper>
|
|
307
348
|
<OText
|
|
308
349
|
size={16}
|
|
@@ -415,19 +456,36 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
|
|
|
415
456
|
/>
|
|
416
457
|
)}
|
|
417
458
|
</View>
|
|
418
|
-
<TimeListWrapper nestedScrollEnabled={true}>
|
|
419
|
-
{(isEnabled && timeList?.length > 0) ? (
|
|
459
|
+
<TimeListWrapper nestedScrollEnabled={true} cateringPreorder={cateringPreorder}>
|
|
460
|
+
{((isEnabled || cateringPreorder) && timeList?.length > 0) ? (
|
|
420
461
|
<TimeContentWrapper>
|
|
421
462
|
{timeList.map((time: any, i: number) => (
|
|
422
463
|
<TouchableOpacity key={i} onPress={() => handleChangeTime(time.value)}>
|
|
423
|
-
<TimeItem active={timeSelected === time.value}>
|
|
464
|
+
<TimeItem active={timeSelected === time.value} cateringPreorder={cateringPreorder}>
|
|
465
|
+
{cateringPreorder && (
|
|
466
|
+
<>
|
|
467
|
+
{timeSelected === time.value ? (
|
|
468
|
+
<OIcon
|
|
469
|
+
src={theme.images.general.option_checked}
|
|
470
|
+
width={18}
|
|
471
|
+
style={{ marginEnd: 24, bottom: 2 }}
|
|
472
|
+
/>
|
|
473
|
+
) : (
|
|
474
|
+
<OIcon
|
|
475
|
+
src={theme.images.general.option_normal}
|
|
476
|
+
width={18}
|
|
477
|
+
style={{ marginEnd: 24, bottom: 2 }}
|
|
478
|
+
/>
|
|
479
|
+
)}
|
|
480
|
+
</>
|
|
481
|
+
)}
|
|
424
482
|
<OText
|
|
425
|
-
size={
|
|
483
|
+
size={cateringPreorder ? 18 : 16}
|
|
426
484
|
color={timeSelected === time.value ? theme.colors.primary : theme.colors.textNormal}
|
|
427
485
|
style={{
|
|
428
486
|
lineHeight: 24
|
|
429
487
|
}}
|
|
430
|
-
>{time.text}</OText>
|
|
488
|
+
>{time.text} {cateringPreorder && `- ${time.endText}`}</OText>
|
|
431
489
|
</TimeItem>
|
|
432
490
|
</TouchableOpacity>
|
|
433
491
|
))}
|
|
@@ -461,7 +519,7 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
|
|
|
461
519
|
marginBottom: 12,
|
|
462
520
|
textAlign: 'center'
|
|
463
521
|
}}
|
|
464
|
-
|
|
522
|
+
>
|
|
465
523
|
{t('ERROR_ADD_PRODUCT_BUSINESS_CLOSED', 'The business is closed at the moment')}
|
|
466
524
|
</OText>
|
|
467
525
|
)}
|
|
@@ -480,7 +538,7 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
|
|
|
480
538
|
|
|
481
539
|
export const BusinessPreorder = (props: any) => {
|
|
482
540
|
const [{ configs }] = useConfig()
|
|
483
|
-
|
|
541
|
+
const [orderState] = useOrder()
|
|
484
542
|
const limitDays = parseInt(configs?.max_days_preorder?.value, 10)
|
|
485
543
|
|
|
486
544
|
const currentDate = new Date()
|
|
@@ -492,10 +550,33 @@ export const BusinessPreorder = (props: any) => {
|
|
|
492
550
|
currentDate.setHours(23)
|
|
493
551
|
currentDate.setMinutes(59)
|
|
494
552
|
|
|
553
|
+
const cateringTypeString = orderState?.options?.type === 7
|
|
554
|
+
? 'catering_delivery'
|
|
555
|
+
: orderState?.options?.type === 8
|
|
556
|
+
? 'catering_pickup'
|
|
557
|
+
: null
|
|
558
|
+
|
|
559
|
+
const splitCateringValue = (configName : string) =>
|
|
560
|
+
Object.values(props?.business?.configs || {})
|
|
561
|
+
?.find(config => config?.key === configName)
|
|
562
|
+
?.value?.split('|')
|
|
563
|
+
?.find(val => val.includes(cateringTypeString || ''))?.split(',')[1]
|
|
564
|
+
const preorderSlotInterval = parseInt(splitCateringValue('preorder_slot_interval'))
|
|
565
|
+
const preorderLeadTime = parseInt(splitCateringValue('preorder_lead_time'))
|
|
566
|
+
const preorderTimeRange = parseInt(splitCateringValue('preorder_time_range'))
|
|
567
|
+
const preorderMaximumDays = parseInt(splitCateringValue('preorder_maximum_days'))
|
|
568
|
+
const preorderMinimumDays = parseInt(splitCateringValue('preorder_minimum_days'))
|
|
569
|
+
|
|
495
570
|
const businessPreorderProps = {
|
|
496
571
|
...props,
|
|
497
572
|
UIComponent: BusinessPreorderUI,
|
|
498
|
-
maxDate: currentDate
|
|
573
|
+
maxDate: currentDate,
|
|
574
|
+
preorderLeadTime,
|
|
575
|
+
preorderSlotInterval,
|
|
576
|
+
preorderTimeRange,
|
|
577
|
+
preorderMaximumDays,
|
|
578
|
+
preorderMinimumDays,
|
|
579
|
+
cateringPreorder: !!cateringTypeString
|
|
499
580
|
}
|
|
500
581
|
return <MomentOption {...businessPreorderProps} />
|
|
501
582
|
}
|
|
@@ -91,6 +91,7 @@ const BusinessProductsListUI = (props: BusinessProductsListParams) => {
|
|
|
91
91
|
navigation={navigation}
|
|
92
92
|
handleUpdateProducts={handleUpdateProducts}
|
|
93
93
|
currentCart={currentCart}
|
|
94
|
+
searchValue={searchValue}
|
|
94
95
|
/>
|
|
95
96
|
)}
|
|
96
97
|
{category.id &&
|
|
@@ -165,14 +166,16 @@ const BusinessProductsListUI = (props: BusinessProductsListParams) => {
|
|
|
165
166
|
style={bpStyles.catWrap}
|
|
166
167
|
onLayout={(event: any) => handleOnLayout(event, category.id)}
|
|
167
168
|
>
|
|
168
|
-
|
|
169
|
-
<
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
169
|
+
{!!category.image && (
|
|
170
|
+
<View style={bpStyles.catIcon}>
|
|
171
|
+
<OIcon
|
|
172
|
+
url={optimizeImage(category.image, 'h_250,c_limit')}
|
|
173
|
+
width={41}
|
|
174
|
+
height={41}
|
|
175
|
+
style={{ borderRadius: 7.6 }}
|
|
176
|
+
/>
|
|
177
|
+
</View>
|
|
178
|
+
)}
|
|
176
179
|
<OText size={16} weight="600">
|
|
177
180
|
{category.name}
|
|
178
181
|
</OText>
|
|
@@ -18,15 +18,12 @@ export const RibbonBox = styled.View`
|
|
|
18
18
|
background-color: ${(props: any) => props.theme.colors.primary};
|
|
19
19
|
padding: 2px 8px;
|
|
20
20
|
max-width: 180px;
|
|
21
|
-
|
|
22
21
|
${(props: any) => props.bgColor && css`
|
|
23
22
|
background-color: ${props.bgColor};
|
|
24
23
|
`}
|
|
25
|
-
|
|
26
24
|
${(props: any) => props.isRoundRect && css`
|
|
27
25
|
border-radius: 7.6px;
|
|
28
26
|
`}
|
|
29
|
-
|
|
30
27
|
${(props: any) => props.isCapsule && css`
|
|
31
28
|
border-radius: 50px;
|
|
32
29
|
`}
|