ordering-ui-react-native 0.17.72 → 0.17.73-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 +8 -7
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/BusinessInformation/index.tsx +10 -9
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/OrderCreating/index.tsx +1 -21
- package/src/components/PaymentOptionsWebView/index.tsx +29 -8
- package/src/components/PhoneInputNumber/index.tsx +6 -2
- package/src/components/StripeMethodForm/index.tsx +136 -102
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OToast.tsx +3 -2
- package/src/types/index.tsx +5 -0
- package/src/utils/index.tsx +5 -0
- package/themes/business/index.tsx +2 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +28 -24
- package/themes/business/src/components/BusinessController/index.tsx +0 -1
- package/themes/business/src/components/Chat/index.tsx +149 -118
- package/themes/business/src/components/DriverMap/index.tsx +17 -6
- package/themes/business/src/components/DriverSchedule/index.tsx +45 -8
- package/themes/business/src/components/GoogleMap/index.tsx +58 -57
- package/themes/business/src/components/LoginForm/Otp/index.tsx +31 -3
- package/themes/business/src/components/LoginForm/index.tsx +15 -22
- package/themes/business/src/components/MapView/index.tsx +10 -10
- package/themes/business/src/components/MessagesOption/index.tsx +20 -93
- package/themes/business/src/components/NewOrderNotification/index.tsx +37 -21
- package/themes/business/src/components/NotFoundSource/index.tsx +2 -2
- package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
- package/themes/business/src/components/OrderDetails/Delivery.tsx +191 -6
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +103 -39
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +61 -60
- 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 +19 -18
- package/themes/business/src/components/OrderSummary/index.tsx +114 -123
- package/themes/business/src/components/OrdersOption/index.tsx +17 -15
- package/themes/business/src/components/PreviousMessages/FooterMessageComponent.tsx +103 -0
- package/themes/business/src/components/PreviousMessages/index.tsx +97 -55
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +17 -12
- package/themes/business/src/components/PreviousOrders/OrderList.tsx +88 -0
- package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +1 -1
- package/themes/business/src/components/PreviousOrders/index.tsx +186 -114
- package/themes/business/src/components/PreviousOrders/styles.tsx +1 -1
- package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
- package/themes/business/src/components/ReviewCustomer/index.tsx +18 -13
- package/themes/business/src/components/StoresList/index.tsx +3 -4
- package/themes/business/src/components/UserProfileForm/index.tsx +14 -15
- package/themes/business/src/components/shared/OLink.tsx +11 -3
- package/themes/business/src/components/shared/OModal.tsx +16 -9
- package/themes/business/src/components/shared/OText.tsx +6 -1
- package/themes/business/src/types/index.tsx +25 -10
- package/themes/business/src/utils/index.tsx +29 -2
- 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/Checkout/index.tsx +6 -0
- package/themes/kiosk/src/components/Intro/index.tsx +16 -1
- package/themes/kiosk/src/components/LoginForm/index.tsx +7 -9
- 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 +2 -2
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/original/index.tsx +1 -1
- package/themes/original/src/components/AddressDetails/index.tsx +19 -3
- package/themes/original/src/components/AddressForm/index.tsx +61 -39
- package/themes/original/src/components/AddressList/index.tsx +25 -24
- package/themes/original/src/components/AddressList/styles.tsx +4 -2
- package/themes/original/src/components/AnalyticsSegment/index.tsx +193 -10
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/AppleLogin/styles.tsx +3 -1
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +153 -96
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +10 -12
- package/themes/original/src/components/BusinessController/index.tsx +80 -66
- package/themes/original/src/components/BusinessController/styles.tsx +12 -5
- 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 +139 -85
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +15 -20
- package/themes/original/src/components/BusinessListingSearch/index.tsx +349 -339
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +0 -18
- package/themes/original/src/components/BusinessPreorder/index.tsx +103 -19
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -2
- package/themes/original/src/components/BusinessProductsList/index.tsx +15 -7
- package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
- package/themes/original/src/components/BusinessProductsListing/UpsellingRedirect.tsx +1 -1
- package/themes/original/src/components/BusinessProductsListing/index.tsx +684 -557
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +2 -2
- package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +69 -38
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +0 -1
- package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
- package/themes/original/src/components/Cart/index.tsx +77 -79
- package/themes/original/src/components/CartContent/index.tsx +117 -20
- package/themes/original/src/components/CartContent/styles.tsx +17 -7
- package/themes/original/src/components/Checkout/index.tsx +355 -123
- package/themes/original/src/components/CitiesControl/index.tsx +1 -1
- package/themes/original/src/components/CouponControl/index.tsx +10 -3
- package/themes/original/src/components/DriverTips/index.tsx +52 -34
- package/themes/original/src/components/FacebookLogin/styles.tsx +3 -1
- package/themes/original/src/components/Favorite/index.tsx +2 -6
- package/themes/original/src/components/FavoriteList/index.tsx +1 -35
- package/themes/original/src/components/FloatingButton/index.tsx +10 -13
- package/themes/original/src/components/GPSButton/index.tsx +6 -4
- 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 +191 -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/GoogleLogin/styles.tsx +1 -1
- package/themes/original/src/components/GoogleMap/index.tsx +60 -5
- package/themes/original/src/components/Help/index.tsx +2 -2
- package/themes/original/src/components/HelpAccountAndPayment/index.tsx +10 -31
- package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +5 -3
- package/themes/original/src/components/HelpGuide/index.tsx +6 -6
- package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
- package/themes/original/src/components/HelpOrder/index.tsx +6 -15
- 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/LastOrder/index.tsx +1 -34
- package/themes/original/src/components/LoginForm/Otp/index.tsx +91 -25
- package/themes/original/src/components/LoginForm/index.tsx +64 -34
- package/themes/original/src/components/LottieAnimation/index.tsx +88 -63
- package/themes/original/src/components/MessageListing/index.tsx +16 -42
- package/themes/original/src/components/Messages/index.tsx +14 -7
- package/themes/original/src/components/MomentOption/index.tsx +193 -90
- package/themes/original/src/components/MomentSelector/index.tsx +1 -1
- package/themes/original/src/components/MultiCart/index.tsx +41 -54
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +162 -50
- package/themes/original/src/components/MultiCheckout/index.tsx +329 -100
- package/themes/original/src/components/MultiCheckout/styles.tsx +3 -1
- package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +54 -21
- package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
- package/themes/original/src/components/MyOrders/index.tsx +40 -29
- package/themes/original/src/components/NavBar/index.tsx +20 -17
- package/themes/original/src/components/NotFoundSource/index.tsx +14 -10
- package/themes/original/src/components/Notifications/index.tsx +42 -52
- package/themes/original/src/components/Notifications/styles.tsx +6 -3
- package/themes/original/src/components/OrderDetails/OrderEta.tsx +76 -0
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +21 -5
- package/themes/original/src/components/OrderDetails/index.tsx +191 -363
- package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
- package/themes/original/src/components/OrderItAgain/index.tsx +3 -1
- package/themes/original/src/components/OrderProgress/index.tsx +30 -56
- package/themes/original/src/components/OrderSummary/index.tsx +88 -59
- package/themes/original/src/components/OrderTypeSelector/index.tsx +2 -1
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +14 -14
- package/themes/original/src/components/OrdersOption/index.tsx +67 -85
- package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
- package/themes/original/src/components/PageBanner/index.tsx +98 -38
- package/themes/original/src/components/PageBanner/styles.tsx +0 -10
- package/themes/original/src/components/PaymentOptionCard/index.tsx +180 -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 +78 -35
- package/themes/original/src/components/PhoneInputNumber/index.tsx +18 -4
- package/themes/original/src/components/ProductForm/index.tsx +104 -29
- package/themes/original/src/components/ProductForm/styles.tsx +5 -5
- package/themes/original/src/components/ProductItemAccordion/index.tsx +12 -9
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +20 -18
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +5 -9
- package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
- package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -50
- package/themes/original/src/components/ProfessionalProfile/index.tsx +36 -7
- package/themes/original/src/components/Promotions/index.tsx +2 -2
- package/themes/original/src/components/Promotions/styles.tsx +3 -1
- package/themes/original/src/components/ReviewProducts/index.tsx +16 -7
- package/themes/original/src/components/ScheduleAccordion/index.tsx +3 -3
- package/themes/original/src/components/ServiceForm/index.tsx +63 -20
- 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 +43 -27
- package/themes/original/src/components/SingleOrderCard/index.tsx +102 -63
- package/themes/original/src/components/SingleOrderCard/styles.tsx +1 -1
- package/themes/original/src/components/SingleProductCard/index.tsx +72 -31
- package/themes/original/src/components/SingleProductCard/styles.tsx +20 -4
- package/themes/original/src/components/SingleProductReview/styles.tsx +1 -1
- package/themes/original/src/components/StripeCardsList/index.tsx +49 -5
- package/themes/original/src/components/StripeElementsForm/index.tsx +48 -34
- package/themes/original/src/components/StripeElementsForm/naked.tsx +12 -1
- package/themes/original/src/components/UpsellingProducts/index.tsx +238 -224
- package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
- package/themes/original/src/components/UserDetails/index.tsx +3 -1
- package/themes/original/src/components/UserFormDetails/index.tsx +76 -7
- package/themes/original/src/components/UserFormDetails/styles.tsx +1 -1
- package/themes/original/src/components/UserProfile/index.tsx +88 -79
- package/themes/original/src/components/UserProfileForm/index.tsx +17 -21
- package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
- package/themes/original/src/components/UserVerification/index.tsx +55 -50
- package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
- package/themes/original/src/components/WalletTransactions/index.tsx +3 -3
- package/themes/original/src/components/Wallets/index.tsx +66 -30
- package/themes/original/src/components/Wallets/styles.tsx +3 -4
- package/themes/original/src/components/shared/OButton.tsx +6 -2
- package/themes/original/src/components/shared/OInput.tsx +6 -1
- package/themes/original/src/components/shared/OModal.tsx +3 -3
- package/themes/original/src/types/index.tsx +40 -11
- package/themes/original/src/utils/index.tsx +273 -1
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
|
-
import { StyleSheet, View, TouchableOpacity, Linking, Pressable } from 'react-native';
|
|
2
|
+
import { StyleSheet, View, TouchableOpacity, Linking, Pressable, Image } from 'react-native';
|
|
3
3
|
import FastImage from 'react-native-fast-image'
|
|
4
4
|
import { useUtils, useOrder, useLanguage } from 'ordering-components/native';
|
|
5
5
|
import { useTheme } from 'styled-components/native';
|
|
6
6
|
import { OIcon, OText, OModal } from '../shared';
|
|
7
7
|
import { BusinessBasicInformationParams } from '../../types';
|
|
8
|
-
import { convertHoursToMinutes, shape } from '../../utils';
|
|
8
|
+
import { convertHoursToMinutes, lightenDarkenColor, shape } from '../../utils';
|
|
9
9
|
import MaterialComIcon from 'react-native-vector-icons/MaterialCommunityIcons'
|
|
10
10
|
import dayjs from 'dayjs';
|
|
11
11
|
import timezone from 'dayjs/plugin/timezone';
|
|
@@ -21,7 +21,6 @@ import {
|
|
|
21
21
|
BusinessInfo,
|
|
22
22
|
BusinessInfoItem,
|
|
23
23
|
WrapReviews,
|
|
24
|
-
WrapBusinessInfo,
|
|
25
24
|
TitleWrapper,
|
|
26
25
|
RibbonBox,
|
|
27
26
|
SocialListWrapper
|
|
@@ -46,15 +45,24 @@ export const BusinessBasicInformation = (
|
|
|
46
45
|
const [openBusinessReviews, setOpenBusinessReviews] = useState(false);
|
|
47
46
|
const [businessInformationObtained, setBusinessInformationObtained] = useState(false)
|
|
48
47
|
const [businessReviewsObtained, setBusinessReviewsObtainedbtained] = useState(false)
|
|
49
|
-
const
|
|
50
|
-
const
|
|
48
|
+
const [imageRealSize, setImageRealSize] = useState({ width: 16, height: 9, loading: true })
|
|
49
|
+
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
50
|
+
const hideLogo = theme?.business_view?.components?.header?.components?.business?.components?.logo?.hidden
|
|
51
|
+
const hideDeliveryFee = theme?.business_view?.components?.header?.components?.business?.components?.fee?.hidden
|
|
52
|
+
const hideTime = theme?.business_view?.components?.header?.components?.business?.components?.time?.hidden
|
|
53
|
+
const hideReviews = theme?.business_view?.components?.header?.components?.business?.components?.reviews?.hidden
|
|
54
|
+
const hideReviewsPopup = theme?.business_view?.components?.header?.components?.reviews?.hidden
|
|
55
|
+
const hideDistance = theme?.business_view?.components?.header?.components?.business?.components?.distance?.hidden
|
|
56
|
+
const hideInfoIcon = theme?.business_view?.components?.header?.components?.business?.components?.business_info?.hidden
|
|
57
|
+
const hideCity = theme?.business_view?.components?.header?.components?.business?.components?.city?.hidden
|
|
58
|
+
const hideHeader = theme?.business_view?.components?.header?.hidden
|
|
51
59
|
|
|
52
60
|
const styles = StyleSheet.create({
|
|
53
61
|
businesInfoheaderStyle: {
|
|
54
62
|
height: 150,
|
|
55
63
|
},
|
|
56
64
|
headerStyle: {
|
|
57
|
-
|
|
65
|
+
aspectRatio: imageRealSize?.width / imageRealSize?.height
|
|
58
66
|
},
|
|
59
67
|
logoStyle: {
|
|
60
68
|
width: 72,
|
|
@@ -93,11 +101,11 @@ export const BusinessBasicInformation = (
|
|
|
93
101
|
borderRadius: 3,
|
|
94
102
|
borderColor: theme.colors.border,
|
|
95
103
|
borderWidth: isChewLayout ? 0 : 1,
|
|
96
|
-
width:
|
|
97
|
-
height:
|
|
104
|
+
width: 30,
|
|
105
|
+
height: 30,
|
|
98
106
|
justifyContent: 'center',
|
|
99
107
|
alignItems: 'center',
|
|
100
|
-
marginRight:
|
|
108
|
+
marginRight: 10,
|
|
101
109
|
marginBottom: 7
|
|
102
110
|
},
|
|
103
111
|
tiktokIcon: {
|
|
@@ -138,7 +146,7 @@ export const BusinessBasicInformation = (
|
|
|
138
146
|
}
|
|
139
147
|
|
|
140
148
|
const getBusinessType = () => {
|
|
141
|
-
if (Object.keys(business).length <= 0) return t('GENERAL', 'General');
|
|
149
|
+
if (Object.keys(business || {}).length <= 0) return t('GENERAL', 'General');
|
|
142
150
|
const _types: any = [];
|
|
143
151
|
types.forEach(
|
|
144
152
|
(type) =>
|
|
@@ -158,7 +166,7 @@ export const BusinessBasicInformation = (
|
|
|
158
166
|
<MaterialComIcon
|
|
159
167
|
name={iconTitle}
|
|
160
168
|
color={isChewLayout ? theme.colors.black : theme.colors.textNormal}
|
|
161
|
-
size={isChewLayout ?
|
|
169
|
+
size={isChewLayout ? 25 : 22}
|
|
162
170
|
/>
|
|
163
171
|
</TouchableOpacity>
|
|
164
172
|
)
|
|
@@ -188,6 +196,20 @@ export const BusinessBasicInformation = (
|
|
|
188
196
|
}
|
|
189
197
|
}, [businessState?.business])
|
|
190
198
|
|
|
199
|
+
useEffect(() => {
|
|
200
|
+
const bannerImage = header || businessState?.business?.header
|
|
201
|
+
if (!bannerImage) {
|
|
202
|
+
setImageRealSize({ width: 16, height: 9, loading: false })
|
|
203
|
+
return
|
|
204
|
+
}
|
|
205
|
+
Image.getSize(bannerImage, (width: number, height: number) => {
|
|
206
|
+
setImageRealSize({ width: width, height: height, loading: false });
|
|
207
|
+
}, (error: any) => {
|
|
208
|
+
setImageRealSize({ ...imageRealSize, loading: false });
|
|
209
|
+
console.log(error);
|
|
210
|
+
});
|
|
211
|
+
}, [header, businessState?.business?.header])
|
|
212
|
+
|
|
191
213
|
const SocialIcons = () => {
|
|
192
214
|
return (
|
|
193
215
|
<>
|
|
@@ -249,9 +271,9 @@ export const BusinessBasicInformation = (
|
|
|
249
271
|
iconTitle='snapchat'
|
|
250
272
|
/>
|
|
251
273
|
)}
|
|
252
|
-
{isChewLayout && (
|
|
274
|
+
{isChewLayout && !hideInfoIcon && (
|
|
253
275
|
<TouchableOpacity onPress={() => handleClickBusinessInformation()}>
|
|
254
|
-
<OText
|
|
276
|
+
<OText
|
|
255
277
|
color={theme.colors.primary}
|
|
256
278
|
style={{ textDecorationColor: theme.colors.primary, textDecorationLine: 'underline' }}
|
|
257
279
|
size={12}
|
|
@@ -267,61 +289,68 @@ export const BusinessBasicInformation = (
|
|
|
267
289
|
}
|
|
268
290
|
|
|
269
291
|
return (
|
|
270
|
-
<BusinessContainer isChewLayout={isChewLayout &&
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
<
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
{isChewLayout && !loading && (
|
|
291
|
-
<View style={styles.headerChewStyle}>
|
|
292
|
-
<OText size={24} weight={'600'} mBottom={-5}>
|
|
293
|
-
{business?.name}
|
|
294
|
-
</OText>
|
|
295
|
-
{business?.city?.name && (
|
|
296
|
-
<OText>
|
|
297
|
-
{business?.city?.name}
|
|
292
|
+
<BusinessContainer isChewLayout={isChewLayout && hideLogo}>
|
|
293
|
+
{!hideHeader && (
|
|
294
|
+
<BusinessHeader
|
|
295
|
+
isChewLayout={isChewLayout}
|
|
296
|
+
style={
|
|
297
|
+
isBusinessInfoShow
|
|
298
|
+
? styles.businesInfoheaderStyle
|
|
299
|
+
: { ...styles.headerStyle, backgroundColor: theme.colors.backgroundGray }
|
|
300
|
+
}
|
|
301
|
+
{...(!loading && !imageRealSize?.loading && {
|
|
302
|
+
source: (header || businessState?.business?.header || typeof theme?.images?.dummies?.businessHeader === 'string') ? {
|
|
303
|
+
uri: optimizeImage(businessState?.business?.header, 'h_250,c_limit') || header || theme?.images?.dummies?.businessHeader
|
|
304
|
+
} : theme?.images?.dummies?.businessHeader
|
|
305
|
+
})}
|
|
306
|
+
imageStyle={{ opacity: isChewLayout ? 0.5 : 1 }}
|
|
307
|
+
>
|
|
308
|
+
{isChewLayout && !loading && (
|
|
309
|
+
<View style={styles.headerChewStyle}>
|
|
310
|
+
<OText size={24} weight={'600'} mBottom={-5}>
|
|
311
|
+
{business?.name}
|
|
298
312
|
</OText>
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
313
|
+
{business?.city?.name && !hideCity && (
|
|
314
|
+
<OText>
|
|
315
|
+
{business?.city?.name}
|
|
316
|
+
</OText>
|
|
317
|
+
)}
|
|
318
|
+
<View style={styles.socialIconsChewContainer}>
|
|
319
|
+
<SocialIcons />
|
|
320
|
+
</View>
|
|
302
321
|
</View>
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
322
|
+
)}
|
|
323
|
+
</BusinessHeader>
|
|
324
|
+
)}
|
|
306
325
|
<BusinessInfo style={styles.businessInfo}>
|
|
307
|
-
{
|
|
326
|
+
{!hideLogo && (
|
|
308
327
|
<BusinessLogo isChewLayout={isChewLayout}>
|
|
309
328
|
{!isBusinessInfoShow && (
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
style={styles.logoStyle}
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
329
|
+
<>
|
|
330
|
+
{loading ? (
|
|
331
|
+
<View style={styles.logoStyle}>
|
|
332
|
+
<Placeholder Animation={Fade}>
|
|
333
|
+
<PlaceholderLine height={72} style={{ borderRadius: 8 }} />
|
|
334
|
+
</Placeholder>
|
|
335
|
+
</View>
|
|
336
|
+
) : (
|
|
337
|
+
logo || businessState?.business?.logo || typeof theme.images.dummies.businessLogo === 'string' ?
|
|
338
|
+
<FastImage
|
|
339
|
+
style={styles.logoStyle}
|
|
340
|
+
source={{
|
|
341
|
+
uri: logo || optimizeImage(businessState?.business?.logo, 'h_70,c_limit') || theme.images.dummies.businessLogo,
|
|
342
|
+
priority: FastImage.priority.high,
|
|
343
|
+
cache: FastImage.cacheControl.web
|
|
344
|
+
}}
|
|
345
|
+
resizeMode={FastImage.resizeMode.contain}
|
|
346
|
+
/>
|
|
347
|
+
:
|
|
348
|
+
<OIcon
|
|
349
|
+
src={theme?.images?.dummies?.businessLogo}
|
|
350
|
+
style={styles.logoStyle}
|
|
351
|
+
/>
|
|
352
|
+
)}
|
|
353
|
+
</>
|
|
325
354
|
)}
|
|
326
355
|
</BusinessLogo>
|
|
327
356
|
)}
|
|
@@ -341,13 +370,15 @@ export const BusinessBasicInformation = (
|
|
|
341
370
|
{business?.ribbon?.enabled && (
|
|
342
371
|
<RibbonBox
|
|
343
372
|
bgColor={business?.ribbon?.color}
|
|
373
|
+
colorText={lightenDarkenColor(business?.ribbon?.color)}
|
|
374
|
+
borderRibbon={lightenDarkenColor(business?.ribbon?.color)}
|
|
344
375
|
isRoundRect={business?.ribbon?.shape === shape?.rectangleRound}
|
|
345
376
|
isCapsule={business?.ribbon?.shape === shape?.capsuleShape}
|
|
346
377
|
>
|
|
347
378
|
<OText
|
|
348
379
|
size={10}
|
|
349
380
|
weight={'400'}
|
|
350
|
-
color={theme.colors.white}
|
|
381
|
+
color={lightenDarkenColor(business?.ribbon?.color) ? theme.colors.black : theme.colors.white}
|
|
351
382
|
numberOfLines={2}
|
|
352
383
|
ellipsizeMode='tail'
|
|
353
384
|
lineHeight={13}
|
|
@@ -384,34 +415,43 @@ export const BusinessBasicInformation = (
|
|
|
384
415
|
</Placeholder>
|
|
385
416
|
)}
|
|
386
417
|
<View style={styles.bullet}>
|
|
387
|
-
|
|
388
|
-
{`${t('DELIVERY_FEE', 'Delivery fee')} ${business && parsePrice(business?.delivery_price || 0)} \u2022 `}
|
|
389
|
-
</OText>
|
|
390
|
-
{orderState?.options?.type === 1 ? (
|
|
418
|
+
{!hideDeliveryFee && (
|
|
391
419
|
<OText color={theme.colors.textSecondary} size={12} style={styles.metadata}>
|
|
392
|
-
{
|
|
420
|
+
{`${t('DELIVERY_FEE', 'Delivery fee')} ${business && parsePrice(business?.delivery_price || 0)} \u2022 `}
|
|
393
421
|
</OText>
|
|
394
|
-
)
|
|
422
|
+
)}
|
|
423
|
+
{!hideTime && (
|
|
424
|
+
<>
|
|
425
|
+
{orderState?.options?.type === 1 ? (
|
|
426
|
+
<OText color={theme.colors.textSecondary} size={12} style={styles.metadata}>
|
|
427
|
+
{convertHoursToMinutes(business?.delivery_time) + ` \u2022 `}
|
|
428
|
+
</OText>
|
|
429
|
+
) : (
|
|
430
|
+
<OText color={theme.colors.textSecondary} size={12} style={styles.metadata}>
|
|
431
|
+
{convertHoursToMinutes(business?.pickup_time) + ` \u2022 `}
|
|
432
|
+
</OText>
|
|
433
|
+
)}
|
|
434
|
+
</>
|
|
435
|
+
)}
|
|
436
|
+
{!hideDistance && (
|
|
395
437
|
<OText color={theme.colors.textSecondary} size={12} style={styles.metadata}>
|
|
396
|
-
{
|
|
438
|
+
{parseDistance(business?.distance || 0) + ` \u2022 `}
|
|
397
439
|
</OText>
|
|
398
440
|
)}
|
|
399
|
-
<OText color={theme.colors.textSecondary} size={12} style={styles.metadata}>
|
|
400
|
-
{parseDistance(business?.distance || 0) + ` \u2022 `}
|
|
401
|
-
</OText>
|
|
402
|
-
</View>
|
|
403
|
-
|
|
404
|
-
<View style={styles.reviewStyle}>
|
|
405
|
-
<OIcon
|
|
406
|
-
src={theme.images.general.star}
|
|
407
|
-
width={14}
|
|
408
|
-
color={theme.colors.textSecondary}
|
|
409
|
-
style={{ marginTop: -2, marginEnd: 2 }}
|
|
410
|
-
/>
|
|
411
|
-
<OText size={12} color={theme.colors.textSecondary}>
|
|
412
|
-
{business?.reviews?.total}
|
|
413
|
-
</OText>
|
|
414
441
|
</View>
|
|
442
|
+
{!hideReviews && (
|
|
443
|
+
<View style={styles.reviewStyle}>
|
|
444
|
+
<OIcon
|
|
445
|
+
src={theme.images.general.star}
|
|
446
|
+
width={14}
|
|
447
|
+
color={theme.colors.textSecondary}
|
|
448
|
+
style={{ marginTop: -2, marginEnd: 2 }}
|
|
449
|
+
/>
|
|
450
|
+
<OText size={12} color={theme.colors.textSecondary}>
|
|
451
|
+
{business?.reviews?.total}
|
|
452
|
+
</OText>
|
|
453
|
+
</View>
|
|
454
|
+
)}
|
|
415
455
|
</BusinessInfoItem>
|
|
416
456
|
</View>
|
|
417
457
|
<WrapReviews>
|
|
@@ -420,7 +460,7 @@ export const BusinessBasicInformation = (
|
|
|
420
460
|
{isPreOrder && (!business?.professionals || business?.professionals?.length === 0) && (
|
|
421
461
|
<>
|
|
422
462
|
<TouchableOpacity onPress={() => navigation.navigate('BusinessPreorder', { business: businessState?.business, handleBusinessClick: () => navigation?.goBack() })}>
|
|
423
|
-
<OText
|
|
463
|
+
<OText
|
|
424
464
|
color={theme.colors.primary}
|
|
425
465
|
style={{ textDecorationColor: theme.colors.primary, textDecorationLine: 'underline' }}
|
|
426
466
|
size={12}
|
|
@@ -431,15 +471,32 @@ export const BusinessBasicInformation = (
|
|
|
431
471
|
<OText size={12} color={theme.colors.textSecondary}>{' \u2022 '}</OText>
|
|
432
472
|
</>
|
|
433
473
|
)}
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
474
|
+
{!hideReviewsPopup && (
|
|
475
|
+
<>
|
|
476
|
+
<TouchableOpacity onPress={() => handleClickBusinessReviews()}>
|
|
477
|
+
<OText
|
|
478
|
+
color={theme.colors.primary}
|
|
479
|
+
style={{ textDecorationColor: theme.colors.primary, textDecorationLine: 'underline' }}
|
|
480
|
+
size={12}
|
|
481
|
+
>
|
|
482
|
+
{t('REVIEWS', 'Reviews')}
|
|
483
|
+
</OText>
|
|
484
|
+
</TouchableOpacity>
|
|
485
|
+
<OText size={12} color={theme.colors.textSecondary}>{' \u2022 '}</OText>
|
|
486
|
+
</>
|
|
487
|
+
)}
|
|
488
|
+
|
|
489
|
+
{!isBusinessInfoShow && !hideInfoIcon && !isChewLayout && (
|
|
490
|
+
<TouchableOpacity onPress={() => handleClickBusinessInformation()}>
|
|
491
|
+
<OText
|
|
492
|
+
color={theme.colors.primary}
|
|
493
|
+
style={{ textDecorationColor: theme.colors.primary, textDecorationLine: 'underline' }}
|
|
494
|
+
size={12}
|
|
495
|
+
>
|
|
496
|
+
{t('INFORMATION', 'Information')}
|
|
497
|
+
</OText>
|
|
498
|
+
</TouchableOpacity>
|
|
499
|
+
)}
|
|
443
500
|
</>
|
|
444
501
|
)}
|
|
445
502
|
</WrapReviews>
|
|
@@ -8,9 +8,6 @@ export const BusinessContainer = styled.View`
|
|
|
8
8
|
export const BusinessHeader = styled.ImageBackground`
|
|
9
9
|
width: 100%;
|
|
10
10
|
position: relative;
|
|
11
|
-
max-height: 258px;
|
|
12
|
-
height: 258px;
|
|
13
|
-
resize-mode: cover;
|
|
14
11
|
`;
|
|
15
12
|
export const BusinessLogo = styled.View`
|
|
16
13
|
position: absolute;
|
|
@@ -36,25 +33,18 @@ export const WrapReviews = styled.View`
|
|
|
36
33
|
align-items: center;
|
|
37
34
|
justify-content: flex-start;
|
|
38
35
|
`;
|
|
39
|
-
export const WrapBusinessInfo = styled.TouchableOpacity`
|
|
40
|
-
position: absolute;
|
|
41
|
-
top: 16px;
|
|
42
|
-
end: 39px;
|
|
43
|
-
`;
|
|
44
36
|
|
|
45
37
|
export const TitleWrapper = styled.View`
|
|
46
38
|
width: 100%;
|
|
47
|
-
flex-direction:
|
|
48
|
-
align-items: center;
|
|
49
|
-
justify-content: space-between;
|
|
39
|
+
flex-direction: column;
|
|
50
40
|
`
|
|
51
41
|
|
|
52
42
|
export const RibbonBox = styled.View`
|
|
53
|
-
margin-left: 5px;
|
|
54
43
|
background-color: ${(props: any) => props.theme.colors.primary};
|
|
55
44
|
padding: 2px 8px;
|
|
56
45
|
max-width: 180px;
|
|
57
46
|
align-self: flex-start;
|
|
47
|
+
margin-bottom: 5px;
|
|
58
48
|
|
|
59
49
|
${(props: any) => props.bgColor && css`
|
|
60
50
|
background-color: ${props.bgColor};
|
|
@@ -67,6 +57,14 @@ export const RibbonBox = styled.View`
|
|
|
67
57
|
${(props: any) => props.isCapsule && css`
|
|
68
58
|
border-radius: 50px;
|
|
69
59
|
`}
|
|
60
|
+
|
|
61
|
+
${(props: any) => props.colorText && css`
|
|
62
|
+
color: ${props.colorText ? 'black' : 'white'};
|
|
63
|
+
`}
|
|
64
|
+
|
|
65
|
+
${(props: any) => props.borderRibbon && css`
|
|
66
|
+
border: 1px solid ${props.borderRibbon ? 'black' : 'white'};
|
|
67
|
+
`}
|
|
70
68
|
`
|
|
71
69
|
|
|
72
70
|
export const SocialListWrapper = styled.ScrollView`
|
|
@@ -14,7 +14,8 @@ import { OIcon, OText } from '../shared';
|
|
|
14
14
|
import { Dimensions, StyleSheet, View } from 'react-native';
|
|
15
15
|
import { InView } from 'react-native-intersection-observer'
|
|
16
16
|
import { BusinessControllerParams } from '../../types';
|
|
17
|
-
import { convertHoursToMinutes, shape } from '../../utils';
|
|
17
|
+
import { convertHoursToMinutes, lightenDarkenColor, shape } from '../../utils';
|
|
18
|
+
import ReactNativeHapticFeedback from "react-native-haptic-feedback";
|
|
18
19
|
|
|
19
20
|
import {
|
|
20
21
|
BusinessHero,
|
|
@@ -41,7 +42,6 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
41
42
|
navigation,
|
|
42
43
|
isBusinessOpen,
|
|
43
44
|
style,
|
|
44
|
-
isCustomLayout,
|
|
45
45
|
businessHeader,
|
|
46
46
|
businessFeatured,
|
|
47
47
|
businessLogo,
|
|
@@ -65,7 +65,17 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
65
65
|
const windowHeight = Dimensions.get('window').height
|
|
66
66
|
const [isIntersectionObserver, setIsIntersectionObserver] = useState(!enableIntersection)
|
|
67
67
|
|
|
68
|
-
const
|
|
68
|
+
const hideBusinessLogo = theme?.business_listing_view?.components?.business?.components?.logo?.hidden
|
|
69
|
+
const hideBusinessFee = theme?.business_listing_view?.components?.business?.components?.fee?.hidden
|
|
70
|
+
const hideBusinessTime = theme?.business_listing_view?.components?.business?.components?.time?.hidden
|
|
71
|
+
const hideBusinessDistance = theme?.business_listing_view?.components?.business?.components?.distance?.hidden
|
|
72
|
+
const hideBusinessReviews = theme?.business_listing_view?.components?.business?.components?.reviews?.hidden
|
|
73
|
+
const hideBusinessFavorite = theme?.business_listing_view?.components?.business?.components?.favorite?.hidden
|
|
74
|
+
const hideBusinessOffer = theme?.business_listing_view?.components?.business?.components?.offer?.hidden
|
|
75
|
+
const hideBusinessHeader = theme?.business_listing_view?.components?.business?.components?.header?.hidden
|
|
76
|
+
const hideBusinessFavoriteBadge = theme?.business_listing_view?.components?.business?.components?.featured_badge?.hidden
|
|
77
|
+
|
|
78
|
+
const textSize = 12
|
|
69
79
|
const cardHeight = windowHeight * 0.3
|
|
70
80
|
|
|
71
81
|
const styles = StyleSheet.create({
|
|
@@ -141,7 +151,16 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
141
151
|
return _types.join(', ');
|
|
142
152
|
};
|
|
143
153
|
|
|
154
|
+
const vibrateApp = (impact?: string) => {
|
|
155
|
+
const options = {
|
|
156
|
+
enableVibrateFallback: true,
|
|
157
|
+
ignoreAndroidSystemSettings: false
|
|
158
|
+
};
|
|
159
|
+
ReactNativeHapticFeedback.trigger(impact || "impactLight", options);
|
|
160
|
+
}
|
|
161
|
+
|
|
144
162
|
const handleBusinessClick = (selectedBusiness: any) => {
|
|
163
|
+
vibrateApp()
|
|
145
164
|
if (business?.open) handleClick && handleClick(selectedBusiness)
|
|
146
165
|
else {
|
|
147
166
|
if (configState?.configs?.preorder_status_enabled?.value === '1') {
|
|
@@ -174,13 +193,15 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
174
193
|
{business?.ribbon?.enabled && (
|
|
175
194
|
<RibbonBox
|
|
176
195
|
bgColor={business?.ribbon?.color}
|
|
196
|
+
colorText={lightenDarkenColor(business?.ribbon?.color)}
|
|
197
|
+
borderRibbon={lightenDarkenColor(business?.ribbon?.color)}
|
|
177
198
|
isRoundRect={business?.ribbon?.shape === shape?.rectangleRound}
|
|
178
199
|
isCapsule={business?.ribbon?.shape === shape?.capsuleShape}
|
|
179
200
|
>
|
|
180
201
|
<OText
|
|
181
202
|
size={10}
|
|
182
203
|
weight={'400'}
|
|
183
|
-
color={theme.colors.white}
|
|
204
|
+
color={lightenDarkenColor(business?.ribbon?.color) ? theme.colors.black : theme.colors.white}
|
|
184
205
|
numberOfLines={2}
|
|
185
206
|
ellipsizeMode='tail'
|
|
186
207
|
lineHeight={13}
|
|
@@ -190,32 +211,38 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
190
211
|
</RibbonBox>
|
|
191
212
|
)}
|
|
192
213
|
<BusinessHero>
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
214
|
+
{!hideBusinessHeader && (
|
|
215
|
+
<FastImage
|
|
216
|
+
style={{ height: cardHeight * 0.66 }}
|
|
217
|
+
source={(businessHeader || business?.header || typeof theme.images.dummies.businessHeader === 'string') ? {
|
|
218
|
+
uri: optimizeImage(businessHeader || business?.header || theme.images.dummies.businessHeader, 'h_500,c_limit'),
|
|
219
|
+
priority: FastImage.priority.normal,
|
|
220
|
+
} : theme.images.dummies.businessHeader}
|
|
221
|
+
resizeMode={FastImage.resizeMode.cover}
|
|
222
|
+
/>
|
|
223
|
+
)}
|
|
224
|
+
{(businessFeatured ?? business?.featured) && !hideBusinessFavoriteBadge && (
|
|
202
225
|
<View style={styles.featured}>
|
|
203
226
|
<FontAwesomeIcon name="crown" size={26} color="gold" />
|
|
204
227
|
</View>
|
|
205
228
|
)}
|
|
206
|
-
{
|
|
229
|
+
{!hideBusinessOffer && (
|
|
207
230
|
getBusinessOffer((business?.offers)) &&
|
|
208
|
-
<OfferBox
|
|
231
|
+
<OfferBox
|
|
232
|
+
isClosed={!isBusinessOpen && (configState?.configs?.preorder_status_enabled?.value === '1')}
|
|
233
|
+
isRibbon={business?.ribbon?.enabled && !!business?.ribbon?.text}
|
|
234
|
+
>
|
|
209
235
|
<OText
|
|
210
236
|
size={10}
|
|
211
237
|
weight={'400'}
|
|
238
|
+
color={theme.colors.textThird}
|
|
212
239
|
numberOfLines={2}
|
|
213
240
|
ellipsizeMode='tail'
|
|
214
241
|
lineHeight={13}
|
|
215
242
|
>{getBusinessOffer((business?.offers)) || parsePrice(0)}</OText>
|
|
216
243
|
</OfferBox>
|
|
217
244
|
)}
|
|
218
|
-
<BusinessState>
|
|
245
|
+
<BusinessState isRibbon={business?.ribbon?.enabled && !!business?.ribbon?.text}>
|
|
219
246
|
{!isBusinessOpen && (configState?.configs?.preorder_status_enabled?.value === '1') && (
|
|
220
247
|
<View style={styles.businessStateView}>
|
|
221
248
|
<OText
|
|
@@ -229,49 +256,30 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
229
256
|
</BusinessState>
|
|
230
257
|
</BusinessHero>
|
|
231
258
|
<BusinessContent>
|
|
232
|
-
<BusinessInfo style={
|
|
233
|
-
|
|
234
|
-
<
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
</BusinessLogo>
|
|
243
|
-
{!isCustomLayout && (
|
|
244
|
-
<ReviewAndFavorite>
|
|
245
|
-
{(businessReviews?.reviews?.total > 0 ?? business?.reviews?.total > 0) && (
|
|
246
|
-
<Reviews>
|
|
247
|
-
<OIcon src={theme.images.general.star} width={12} style={styles.starIcon} />
|
|
248
|
-
<OText size={10} style={{ lineHeight: 15 }}>
|
|
249
|
-
{parseNumber(businessReviews?.reviews?.total ?? business?.reviews?.total, { separator: '.' })}
|
|
250
|
-
</OText>
|
|
251
|
-
</Reviews>
|
|
252
|
-
)}
|
|
253
|
-
<LottieAnimation
|
|
254
|
-
type='favorite'
|
|
255
|
-
onClick={handleChangeFavorite}
|
|
256
|
-
initialValue={business?.favorite ? 0.75 : 0}
|
|
257
|
-
toValue={business?.favorite ? 0 : 0.75}
|
|
258
|
-
disableAnimation={!auth}
|
|
259
|
-
iconProps={{ color: theme.colors.danger5, size: 18 }}
|
|
260
|
-
isActive={business?.favorite}
|
|
259
|
+
<BusinessInfo style={{ position: 'absolute', bottom: 85, left: 15 }}>
|
|
260
|
+
{!hideBusinessLogo && (
|
|
261
|
+
<BusinessLogo style={styles.businessLogo}>
|
|
262
|
+
<FastImage
|
|
263
|
+
style={{ width: 56, height: 56 }}
|
|
264
|
+
source={(businessLogo || business?.logo || typeof theme.images.dummies.businessLogo === 'string') ? {
|
|
265
|
+
uri: optimizeImage(businessLogo || business?.logo || theme.images.dummies.businessLogo, 'h_150,c_limit'),
|
|
266
|
+
priority: FastImage.priority.normal,
|
|
267
|
+
} : theme.images.dummies.businessLogo}
|
|
268
|
+
resizeMode={FastImage.resizeMode.cover}
|
|
261
269
|
/>
|
|
262
|
-
</
|
|
270
|
+
</BusinessLogo>
|
|
263
271
|
)}
|
|
264
272
|
</BusinessInfo>
|
|
265
|
-
<View style={
|
|
273
|
+
<View style={{ width: '100%', flexDirection: 'row', justifyContent: 'space-between', marginTop: 5 }}>
|
|
266
274
|
<OText
|
|
267
275
|
size={textSize + 2}
|
|
268
276
|
style={{ lineHeight: 18, marginBottom: 6 }}
|
|
269
277
|
weight={'500'}>
|
|
270
278
|
{business?.name}
|
|
271
279
|
</OText>
|
|
272
|
-
{
|
|
280
|
+
{(!hideBusinessFavorite || !hideBusinessReviews) && (
|
|
273
281
|
<ReviewAndFavorite>
|
|
274
|
-
{(businessReviews?.reviews?.total > 0 ?? business?.reviews?.total > 0) && (
|
|
282
|
+
{(businessReviews?.reviews?.total > 0 ?? business?.reviews?.total > 0) && !hideBusinessReviews && (
|
|
275
283
|
<Reviews>
|
|
276
284
|
<OIcon src={theme.images.general.star} width={12} style={styles.starIcon} />
|
|
277
285
|
<OText size={10} style={{ lineHeight: 15 }}>
|
|
@@ -279,19 +287,21 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
279
287
|
</OText>
|
|
280
288
|
</Reviews>
|
|
281
289
|
)}
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
290
|
+
{!hideBusinessFavorite && (
|
|
291
|
+
<LottieAnimation
|
|
292
|
+
type='favorite'
|
|
293
|
+
onClick={handleChangeFavorite}
|
|
294
|
+
initialValue={business?.favorite ? 0.5 : 0}
|
|
295
|
+
toValue={business?.favorite ? 0 : 0.5}
|
|
296
|
+
disableAnimation={!auth}
|
|
297
|
+
iconProps={{ color: theme.colors.danger5, size: 18 }}
|
|
298
|
+
isActive={business?.favorite}
|
|
299
|
+
/>
|
|
300
|
+
)}
|
|
291
301
|
</ReviewAndFavorite>
|
|
292
302
|
)}
|
|
293
303
|
</View>
|
|
294
|
-
<OText size={textSize} style={{ lineHeight: 15, marginBottom: 3 }} numberOfLines={
|
|
304
|
+
<OText size={textSize} style={{ lineHeight: 15, marginBottom: 3 }} numberOfLines={1}>
|
|
295
305
|
{business?.address}
|
|
296
306
|
</OText>
|
|
297
307
|
<Metadata>
|
|
@@ -303,17 +313,21 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
303
313
|
</View>
|
|
304
314
|
) : (
|
|
305
315
|
<View style={styles.bullet}>
|
|
306
|
-
{orderState?.options?.type === 1 && (
|
|
316
|
+
{orderState?.options?.type === 1 && !hideBusinessFee && (
|
|
307
317
|
<OText size={textSize} color={theme.colors.textSecondary}>
|
|
308
318
|
{`${t('DELIVERY_FEE', 'Delivery fee')} ${parsePrice(businessDeliveryPrice ?? business?.delivery_price) + ' \u2022 '}`}
|
|
309
319
|
</OText>
|
|
310
320
|
)}
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
321
|
+
{!hideBusinessTime && (
|
|
322
|
+
<OText size={textSize} color={theme.colors.textSecondary}>{`${convertHoursToMinutes(
|
|
323
|
+
orderState?.options?.type === 1
|
|
324
|
+
? (businessDeliveryTime ?? business?.delivery_time)
|
|
325
|
+
: (businessPickupTime ?? business?.pickup_time),
|
|
326
|
+
)} \u2022 `}</OText>
|
|
327
|
+
)}
|
|
328
|
+
{!hideBusinessDistance && (
|
|
329
|
+
<OText size={textSize} color={theme.colors.textSecondary}>{parseDistance(businessDistance ?? business?.distance)}</OText>
|
|
330
|
+
)}
|
|
317
331
|
</View>
|
|
318
332
|
)}
|
|
319
333
|
</Metadata>
|