ordering-ui-react-native 0.17.67 → 0.17.68-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 +2 -1
- 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 +270 -245
- 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 +123 -111
- 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/NewOrderNotification/index.tsx +35 -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 +111 -43
- 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 +32 -75
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +249 -0
- package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
- package/themes/business/src/components/PreviousOrders/index.tsx +444 -242
- 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 +30 -15
- package/themes/business/src/components/StoresList/index.tsx +3 -4
- package/themes/business/src/components/UserProfileForm/index.tsx +11 -13
- 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 +28 -12
- 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 +2 -0
- 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 +27 -22
- 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 -556
- 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/Appointment/index.tsx +1 -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 +356 -124
- 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 +8 -9
- package/themes/original/src/components/Favorite/styles.tsx +1 -1
- package/themes/original/src/components/FavoriteList/index.tsx +1 -35
- package/themes/original/src/components/FloatingButton/index.tsx +11 -14
- package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
- 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 +8 -8
- 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 -31
- package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
- package/themes/original/src/components/LoginForm/index.tsx +64 -34
- package/themes/original/src/components/LottieAnimation/index.tsx +89 -55
- 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 +195 -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 +46 -50
- 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 +68 -87
- 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 +3 -3
- package/themes/original/src/components/ProductForm/index.tsx +105 -30
- package/themes/original/src/components/ProductForm/styles.tsx +5 -5
- package/themes/original/src/components/ProductItemAccordion/index.tsx +14 -11
- 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 +5 -4
- 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 +66 -17
- 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 +101 -62
- 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 +27 -29
- package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
- package/themes/original/src/components/UserVerification/index.tsx +52 -49
- 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 +41 -11
- package/themes/original/src/utils/index.tsx +273 -1
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -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>
|
|
@@ -34,8 +34,8 @@ export const Metadata = styled.View`
|
|
|
34
34
|
|
|
35
35
|
export const BusinessState = styled.View`
|
|
36
36
|
position: absolute;
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
top: ${(props: any) => props.isRibbon ? '32px' : '15px'};
|
|
38
|
+
right: 15px;
|
|
39
39
|
`
|
|
40
40
|
|
|
41
41
|
export const BusinessLogo = styled.View`
|
|
@@ -72,15 +72,22 @@ export const RibbonBox = styled.View`
|
|
|
72
72
|
${(props: any) => props.isCapsule && css`
|
|
73
73
|
border-radius: 50px;
|
|
74
74
|
`}
|
|
75
|
+
|
|
76
|
+
${(props: any) => props.colorText && css`
|
|
77
|
+
color: ${props.colorText ? 'black' : 'white'};
|
|
78
|
+
`}
|
|
79
|
+
|
|
80
|
+
${(props: any) => props.borderRibbon && css`
|
|
81
|
+
border: 1px solid ${props.borderRibbon ? 'black' : 'white'};
|
|
82
|
+
`}
|
|
75
83
|
`
|
|
76
84
|
|
|
77
85
|
export const OfferBox = styled.View`
|
|
78
86
|
position: absolute;
|
|
79
87
|
z-index: 1;
|
|
80
|
-
top: 20px;
|
|
81
|
-
right: 10px;
|
|
82
88
|
border-radius: 50px;
|
|
83
|
-
|
|
89
|
+
top: ${(props: any) => props.isRibbon ? '32px' : '15px'};
|
|
90
|
+
right: ${(props: any) => props.isClosed ? '110px' : '15px'};
|
|
84
91
|
background: ${(props: any) => props.theme.colors.inputBorderColor};
|
|
85
92
|
padding: 3px 8px;
|
|
86
93
|
max-width: 180px;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { StyleSheet, useWindowDimensions, View } from 'react-native';
|
|
2
3
|
import {
|
|
3
4
|
BusinessController as BusinessSingleCard,
|
|
4
5
|
useUtils,
|
|
@@ -6,33 +7,29 @@ import {
|
|
|
6
7
|
useLanguage,
|
|
7
8
|
} from 'ordering-components/native';
|
|
8
9
|
import { useTheme } from 'styled-components/native';
|
|
9
|
-
import
|
|
10
|
-
|
|
10
|
+
import FastImage from 'react-native-fast-image'
|
|
11
|
+
|
|
12
|
+
import { OText } from '../shared';
|
|
11
13
|
import { BusinessControllerParams } from '../../types';
|
|
12
|
-
import { convertHoursToMinutes, shape } from '../../utils';
|
|
14
|
+
import { convertHoursToMinutes, lightenDarkenColor, shape } from '../../utils';
|
|
13
15
|
import {
|
|
14
16
|
Card,
|
|
15
17
|
BusinessHero,
|
|
16
18
|
BusinessContent,
|
|
17
|
-
BusinessCategory,
|
|
18
19
|
BusinessInfo,
|
|
19
20
|
Metadata,
|
|
20
|
-
BusinessState,
|
|
21
21
|
BusinessLogo,
|
|
22
|
-
Reviews,
|
|
23
22
|
RibbonBox
|
|
24
23
|
} from './styles';
|
|
25
24
|
|
|
26
25
|
export const BusinessFeaturedCtrlUI = (props: BusinessControllerParams) => {
|
|
27
26
|
const { business, handleClick, isBusinessOpen } = props;
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
|
|
28
|
+
const [{ parsePrice, parseDistance, optimizeImage }] = useUtils();
|
|
30
29
|
const [orderState] = useOrder();
|
|
31
30
|
const [, t] = useLanguage();
|
|
32
|
-
|
|
33
31
|
const theme = useTheme();
|
|
34
32
|
|
|
35
|
-
|
|
36
33
|
const styles = StyleSheet.create({
|
|
37
34
|
headerStyle: {
|
|
38
35
|
borderTopLeftRadius: 25,
|
|
@@ -79,35 +76,28 @@ export const BusinessFeaturedCtrlUI = (props: BusinessControllerParams) => {
|
|
|
79
76
|
justifyContent: 'flex-start',
|
|
80
77
|
width: '100%',
|
|
81
78
|
},
|
|
79
|
+
productStyle: {
|
|
80
|
+
height: 40,
|
|
81
|
+
width: 40
|
|
82
|
+
}
|
|
82
83
|
});
|
|
83
84
|
|
|
84
|
-
const types = ['food', 'laundry', 'alcohol', 'groceries'];
|
|
85
|
-
|
|
86
85
|
const { width } = useWindowDimensions();
|
|
87
86
|
|
|
88
|
-
const getBusinessType = () => {
|
|
89
|
-
if (Object.keys(business).length <= 0) return t('GENERAL', 'General');
|
|
90
|
-
const _types: any = [];
|
|
91
|
-
types.forEach((type) => {
|
|
92
|
-
if (business[type]) {
|
|
93
|
-
_types.push(t(type.toUpperCase(), type));
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
return _types.join(', ');
|
|
97
|
-
};
|
|
98
|
-
|
|
99
87
|
return (
|
|
100
88
|
<Card activeOpacity={1} onPress={() => handleClick(business)}>
|
|
101
89
|
{business?.ribbon?.enabled && (
|
|
102
90
|
<RibbonBox
|
|
103
91
|
bgColor={business?.ribbon?.color}
|
|
92
|
+
colorText={lightenDarkenColor(business?.ribbon?.color)}
|
|
93
|
+
borderRibbon={lightenDarkenColor(business?.ribbon?.color)}
|
|
104
94
|
isRoundRect={business?.ribbon?.shape === shape?.rectangleRound}
|
|
105
95
|
isCapsule={business?.ribbon?.shape === shape?.capsuleShape}
|
|
106
96
|
>
|
|
107
97
|
<OText
|
|
108
98
|
size={10}
|
|
109
99
|
weight={'400'}
|
|
110
|
-
color={theme.colors.white}
|
|
100
|
+
color={lightenDarkenColor(business?.ribbon?.color) ? theme.colors.black : theme.colors.white}
|
|
111
101
|
numberOfLines={2}
|
|
112
102
|
ellipsizeMode='tail'
|
|
113
103
|
lineHeight={13}
|
|
@@ -118,10 +108,13 @@ export const BusinessFeaturedCtrlUI = (props: BusinessControllerParams) => {
|
|
|
118
108
|
)}
|
|
119
109
|
<BusinessHero>
|
|
120
110
|
<BusinessLogo>
|
|
121
|
-
<
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
111
|
+
<FastImage
|
|
112
|
+
style={styles.productStyle}
|
|
113
|
+
source={{
|
|
114
|
+
uri: optimizeImage(business?.logo, 'h_100,c_limit'),
|
|
115
|
+
priority: FastImage.priority.normal,
|
|
116
|
+
}}
|
|
117
|
+
resizeMode={FastImage.resizeMode.cover}
|
|
125
118
|
/>
|
|
126
119
|
</BusinessLogo>
|
|
127
120
|
<BusinessContent style={{ width: width * 0.6 }}>
|
|
@@ -129,23 +122,7 @@ export const BusinessFeaturedCtrlUI = (props: BusinessControllerParams) => {
|
|
|
129
122
|
<OText size={12} ellipsizeMode={'tail'} numberOfLines={2}>
|
|
130
123
|
{business?.name}
|
|
131
124
|
</OText>
|
|
132
|
-
{/* {business?.reviews?.total > 0 && (
|
|
133
|
-
<Reviews>
|
|
134
|
-
<IconAntDesign
|
|
135
|
-
name="star"
|
|
136
|
-
color={theme.colors.primary}
|
|
137
|
-
size={16}
|
|
138
|
-
style={styles.starIcon}
|
|
139
|
-
/>
|
|
140
|
-
<OText>
|
|
141
|
-
{parseNumber(business?.reviews?.total, { separator: '.' })}
|
|
142
|
-
</OText>
|
|
143
|
-
</Reviews>
|
|
144
|
-
)} */}
|
|
145
125
|
</BusinessInfo>
|
|
146
|
-
{/* <BusinessCategory>
|
|
147
|
-
<OText>{getBusinessType()}</OText>
|
|
148
|
-
</BusinessCategory> */}
|
|
149
126
|
<Metadata>
|
|
150
127
|
{!isBusinessOpen ? (
|
|
151
128
|
<View style={styles.closed}>
|
|
@@ -155,7 +132,6 @@ export const BusinessFeaturedCtrlUI = (props: BusinessControllerParams) => {
|
|
|
155
132
|
</View>
|
|
156
133
|
) : (
|
|
157
134
|
<View style={styles.bullet}>
|
|
158
|
-
{/* <MaterialComIcon name="alarm" size={16} /> */}
|
|
159
135
|
<OText size={10} color={theme.colors.textSecondary}>
|
|
160
136
|
{t('DELIVERY_FEE', 'Delivery Fee')}
|
|
161
137
|
</OText>
|
|
@@ -184,15 +160,6 @@ export const BusinessFeaturedCtrlUI = (props: BusinessControllerParams) => {
|
|
|
184
160
|
)}
|
|
185
161
|
</Metadata>
|
|
186
162
|
</BusinessContent>
|
|
187
|
-
{/* <BusinessState>
|
|
188
|
-
{!business?.open && (
|
|
189
|
-
<View style={styles.businessStateView}>
|
|
190
|
-
<OText color={theme.colors.white} size={20} style={styles.businessStateText}>
|
|
191
|
-
{t('PREORDER', 'PREORDER')}
|
|
192
|
-
</OText>
|
|
193
|
-
</View>
|
|
194
|
-
)}
|
|
195
|
-
</BusinessState> */}
|
|
196
163
|
</BusinessHero>
|
|
197
164
|
</Card>
|
|
198
165
|
);
|
|
@@ -70,4 +70,12 @@ export const RibbonBox = styled.View`
|
|
|
70
70
|
${(props: any) => props.isCapsule && css`
|
|
71
71
|
border-radius: 50px;
|
|
72
72
|
`}
|
|
73
|
+
|
|
74
|
+
${(props: any) => props.colorText && css`
|
|
75
|
+
color: ${props.colorText ? 'black' : 'white'};
|
|
76
|
+
`}
|
|
77
|
+
|
|
78
|
+
${(props: any) => props.borderRibbon && css`
|
|
79
|
+
border: 1px solid ${props.borderRibbon ? 'black' : 'white'};
|
|
80
|
+
`}
|
|
73
81
|
`
|