ordering-ui-react-native 0.18.55 → 0.18.56-crash-driver-1
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 +6 -4
- package/src/components/BusinessInformation/index.tsx +10 -9
- package/src/components/PaymentOptionsWebView/index.tsx +30 -8
- package/src/components/PhoneInputNumber/index.tsx +6 -2
- package/src/components/StripeMethodForm/index.tsx +60 -55
- package/src/components/shared/OToast.tsx +3 -2
- package/src/types/index.tsx +3 -1
- package/src/utils/index.tsx +2 -2
- package/themes/business/index.tsx +6 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +15 -8
- package/themes/business/src/components/BusinessController/index.tsx +19 -17
- package/themes/business/src/components/BusinessProductList/AccordionDropdown.tsx +63 -0
- package/themes/business/src/components/BusinessProductList/IterateCategories.tsx +108 -0
- package/themes/business/src/components/BusinessProductList/ProductList.tsx +196 -0
- package/themes/business/src/components/BusinessProductList/index.tsx +196 -0
- package/themes/business/src/components/BusinessProductList/styles.tsx +10 -0
- package/themes/business/src/components/Chat/index.tsx +48 -19
- package/themes/business/src/components/DriverMap/index.tsx +36 -23
- package/themes/business/src/components/DriverSchedule/index.tsx +45 -8
- package/themes/business/src/components/FloatingButton/index.tsx +34 -31
- package/themes/business/src/components/GoogleMap/index.tsx +15 -8
- package/themes/business/src/components/Home/index.tsx +5 -1
- package/themes/business/src/components/LanguageSelector/index.tsx +1 -2
- package/themes/business/src/components/LanguageSelector/lang_country.json +515 -70
- package/themes/business/src/components/LoginForm/index.tsx +2 -2
- package/themes/business/src/components/LogoutButton/index.tsx +1 -1
- package/themes/business/src/components/MapView/index.tsx +28 -17
- package/themes/business/src/components/MessagesOption/index.tsx +22 -94
- package/themes/business/src/components/NewOrderNotification/index.tsx +162 -106
- package/themes/business/src/components/NotFoundSource/index.tsx +2 -2
- package/themes/business/src/components/OrderDetails/Business.tsx +53 -3
- package/themes/business/src/components/OrderDetails/Delivery.tsx +209 -13
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +107 -75
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +79 -41
- package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +220 -0
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +7 -2
- package/themes/business/src/components/OrderMessage/index.tsx +1 -1
- package/themes/business/src/components/OrderSummary/index.tsx +245 -82
- package/themes/business/src/components/OrdersListManager/index.tsx +7 -2
- package/themes/business/src/components/OrdersListManager/utils.tsx +1 -1
- package/themes/business/src/components/OrdersOption/index.tsx +125 -48
- package/themes/business/src/components/PhoneInputNumber/index.tsx +8 -5
- 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 +43 -41
- package/themes/business/src/components/PreviousOrders/OrderList.tsx +93 -0
- package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +1 -1
- package/themes/business/src/components/PreviousOrders/index.tsx +195 -221
- package/themes/business/src/components/PreviousOrders/styles.tsx +10 -0
- package/themes/business/src/components/PrinterEdition/index.tsx +363 -0
- package/themes/business/src/components/PrinterEdition/styles.tsx +61 -0
- package/themes/business/src/components/PrinterSettings/index.tsx +267 -0
- package/themes/business/src/components/PrinterSettings/styles.tsx +30 -0
- package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
- package/themes/business/src/components/ReviewCustomer/index.tsx +1 -1
- package/themes/business/src/components/SearchBar/index.tsx +2 -1
- package/themes/business/src/components/Sessions/index.tsx +187 -0
- package/themes/business/src/components/Sessions/styles.tsx +20 -0
- package/themes/business/src/components/StoresList/index.tsx +4 -3
- package/themes/business/src/components/UserFormDetails/index.tsx +111 -107
- package/themes/business/src/components/UserProfileForm/index.tsx +103 -53
- package/themes/business/src/components/WebsocketStatus/index.tsx +171 -0
- package/themes/business/src/components/WebsocketStatus/styles.tsx +28 -0
- package/themes/business/src/components/shared/OInput.tsx +2 -0
- package/themes/business/src/hooks/useLocation.tsx +5 -4
- package/themes/business/src/types/index.tsx +21 -1
- package/themes/business/src/utils/index.tsx +5 -0
- package/themes/kiosk/src/components/Checkout/index.tsx +5 -3
- package/themes/kiosk/src/components/CustomerName/index.tsx +1 -1
- package/themes/kiosk/src/components/Intro/index.tsx +16 -1
- package/themes/kiosk/src/components/LoginForm/index.tsx +131 -101
- package/themes/kiosk/src/components/PaymentOptions/index.tsx +57 -121
- package/themes/original/index.tsx +11 -3
- package/themes/original/src/components/AddressDetails/index.tsx +20 -10
- package/themes/original/src/components/AddressForm/index.tsx +41 -20
- package/themes/original/src/components/AddressForm/styles.tsx +1 -1
- package/themes/original/src/components/AddressList/index.tsx +22 -11
- package/themes/original/src/components/AddressList/styles.tsx +4 -4
- package/themes/original/src/components/AnalyticsSegment/index.tsx +10 -7
- package/themes/original/src/components/AppleLogin/styles.tsx +3 -1
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +8 -11
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -1
- package/themes/original/src/components/BusinessController/index.tsx +40 -43
- package/themes/original/src/components/BusinessController/styles.tsx +12 -12
- package/themes/original/src/components/BusinessInformation/index.tsx +45 -17
- package/themes/original/src/components/BusinessInformation/styles.tsx +2 -2
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +11 -7
- package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +317 -0
- package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +96 -0
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +1 -1
- package/themes/original/src/components/BusinessListingSearch/index.tsx +57 -361
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +1 -1
- package/themes/original/src/components/BusinessPreorder/index.tsx +9 -7
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +2 -3
- package/themes/original/src/components/BusinessProductsList/index.tsx +5 -4
- package/themes/original/src/components/BusinessProductsListing/index.tsx +67 -28
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +3 -4
- package/themes/original/src/components/BusinessReviews/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -5
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +69 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +406 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListing.tsx +76 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +30 -404
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +2 -2
- package/themes/original/src/components/Cart/index.tsx +51 -40
- package/themes/original/src/components/CartContent/index.tsx +98 -54
- package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
- package/themes/original/src/components/Checkout/index.tsx +308 -75
- package/themes/original/src/components/Checkout/styles.tsx +17 -0
- package/themes/original/src/components/CitiesControl/styles.tsx +1 -1
- package/themes/original/src/components/DatePicker/index.tsx +33 -0
- package/themes/original/src/components/DatePicker/styles.tsx +20 -0
- package/themes/original/src/components/DriverTips/index.tsx +6 -3
- package/themes/original/src/components/FacebookLogin/styles.tsx +3 -1
- package/themes/original/src/components/Favorite/index.tsx +8 -4
- package/themes/original/src/components/Favorite/styles.tsx +0 -2
- package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
- package/themes/original/src/components/ForgotPasswordForm/index.tsx +5 -0
- package/themes/original/src/components/GPSButton/index.tsx +7 -5
- package/themes/original/src/components/GiftCard/GiftCardOrdersList/index.tsx +64 -0
- package/themes/original/src/components/GiftCard/GiftCardOrdersList/styles.tsx +8 -0
- package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +36 -3
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +84 -8
- package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +2 -2
- package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +1 -1
- package/themes/original/src/components/GiftCard/SingleGiftCard/index.tsx +101 -0
- package/themes/original/src/components/GiftCard/SingleGiftCard/styles.tsx +4 -0
- package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +83 -0
- package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/styles.tsx +9 -0
- package/themes/original/src/components/GoogleLogin/styles.tsx +1 -1
- package/themes/original/src/components/GoogleMap/index.tsx +52 -5
- package/themes/original/src/components/Help/index.tsx +7 -0
- package/themes/original/src/components/HelpAccountAndPayment/index.tsx +5 -0
- package/themes/original/src/components/HelpGuide/index.tsx +5 -0
- package/themes/original/src/components/HelpOrder/index.tsx +5 -0
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +1 -1
- package/themes/original/src/components/HighestRatedBusinesses/styles.tsx +1 -1
- package/themes/original/src/components/Home/index.tsx +3 -2
- package/themes/original/src/components/LastOrder/index.tsx +2 -1
- package/themes/original/src/components/LastOrders/index.tsx +2 -1
- package/themes/original/src/components/LoginForm/Otp/index.tsx +79 -25
- package/themes/original/src/components/LoginForm/index.tsx +38 -14
- package/themes/original/src/components/MessageListing/index.tsx +6 -0
- package/themes/original/src/components/Messages/index.tsx +9 -3
- package/themes/original/src/components/Messages/styles.tsx +1 -1
- package/themes/original/src/components/MomentOption/index.tsx +20 -5
- package/themes/original/src/components/MomentSelector/index.tsx +1 -1
- package/themes/original/src/components/MultiCart/index.tsx +1 -1
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +48 -15
- package/themes/original/src/components/MultiCheckout/index.tsx +295 -56
- package/themes/original/src/components/MultiCheckout/styles.tsx +20 -1
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +21 -16
- package/themes/original/src/components/MyOrders/index.tsx +37 -39
- package/themes/original/src/components/NavBar/index.tsx +15 -14
- package/themes/original/src/components/NetworkError/index.tsx +2 -3
- package/themes/original/src/components/NetworkError/styles.tsx +2 -2
- package/themes/original/src/components/Notifications/index.tsx +9 -8
- package/themes/original/src/components/Notifications/styles.tsx +0 -1
- package/themes/original/src/components/OrderDetails/OrderEta.tsx +21 -6
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +14 -5
- package/themes/original/src/components/OrderDetails/index.tsx +718 -667
- package/themes/original/src/components/OrderDetails/styles.tsx +24 -7
- package/themes/original/src/components/OrderProgress/index.tsx +50 -14
- package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
- package/themes/original/src/components/OrderSummary/index.tsx +26 -34
- package/themes/original/src/components/OrderTypeSelector/index.tsx +5 -0
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +1 -1
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +1 -1
- package/themes/original/src/components/OrdersOption/index.tsx +14 -6
- package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
- package/themes/original/src/components/PageBanner/index.tsx +3 -0
- package/themes/original/src/components/PaymentOptionCard/index.tsx +182 -0
- package/themes/original/src/components/PaymentOptionStripe/styles.tsx +3 -0
- package/themes/original/src/components/PaymentOptions/index.tsx +118 -37
- package/themes/original/src/components/PhoneInputNumber/index.tsx +15 -1
- package/themes/original/src/components/PreviousOrders/index.tsx +2 -0
- package/themes/original/src/components/ProductForm/ActionButton.tsx +122 -0
- package/themes/original/src/components/ProductForm/ExtraOptions.tsx +56 -0
- package/themes/original/src/components/ProductForm/index.tsx +193 -267
- package/themes/original/src/components/ProductForm/styles.tsx +1 -1
- package/themes/original/src/components/ProductItemAccordion/index.tsx +55 -42
- package/themes/original/src/components/ProductItemAccordion/styles.tsx +3 -4
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +120 -79
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +10 -9
- package/themes/original/src/components/ProfessionalProfile/styles.tsx +3 -3
- package/themes/original/src/components/Promotions/index.tsx +13 -11
- package/themes/original/src/components/Promotions/styles.tsx +0 -2
- package/themes/original/src/components/ReviewDriver/index.tsx +5 -0
- package/themes/original/src/components/ReviewDriver/styles.tsx +1 -1
- package/themes/original/src/components/ReviewOrder/index.tsx +5 -0
- package/themes/original/src/components/ReviewOrder/styles.tsx +1 -1
- package/themes/original/src/components/ReviewProducts/index.tsx +5 -0
- package/themes/original/src/components/ReviewProducts/styles.tsx +1 -1
- package/themes/original/src/components/ScheduleAccordion/index.tsx +3 -3
- package/themes/original/src/components/ServiceForm/index.tsx +2 -2
- package/themes/original/src/components/ServiceForm/styles.tsx +4 -4
- package/themes/original/src/components/Sessions/index.tsx +5 -0
- package/themes/original/src/components/SignupForm/index.tsx +76 -60
- package/themes/original/src/components/SingleOrderCard/index.tsx +6 -5
- package/themes/original/src/components/SingleProductCard/index.tsx +5 -4
- package/themes/original/src/components/SingleProductCard/styles.tsx +0 -5
- package/themes/original/src/components/StripeCardsList/index.tsx +26 -8
- package/themes/original/src/components/StripeElementsForm/index.tsx +80 -62
- package/themes/original/src/components/StripeElementsForm/naked.tsx +59 -1
- package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +170 -0
- package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +91 -0
- package/themes/original/src/components/UpsellingProducts/index.tsx +15 -199
- package/themes/original/src/components/UpsellingProducts/styles.tsx +19 -0
- package/themes/original/src/components/UserFormDetails/index.tsx +128 -79
- package/themes/original/src/components/UserFormDetails/styles.tsx +8 -1
- package/themes/original/src/components/UserProfile/index.tsx +5 -4
- package/themes/original/src/components/UserProfileForm/index.tsx +35 -36
- 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/styles.tsx +1 -0
- package/themes/original/src/components/Wallets/index.tsx +35 -49
- package/themes/original/src/components/Wallets/styles.tsx +3 -4
- package/themes/original/src/components/WebsocketStatus/index.tsx +172 -0
- package/themes/original/src/components/WebsocketStatus/styles.tsx +28 -0
- package/themes/original/src/components/shared/HeaderTitle.tsx +1 -1
- package/themes/original/src/components/shared/OButton.tsx +5 -5
- package/themes/original/src/components/shared/OInput.tsx +7 -4
- package/themes/original/src/components/shared/OModal.tsx +12 -14
- package/themes/original/src/layouts/Container.tsx +5 -3
- package/themes/original/src/types/index.tsx +13 -2
- package/themes/original/src/utils/index.tsx +124 -22
- package/src/navigators/BottomNavigator.tsx +0 -117
- package/src/navigators/CheckoutNavigator.tsx +0 -66
- package/src/navigators/HomeNavigator.tsx +0 -202
- package/src/navigators/NavigationRef.tsx +0 -7
- package/src/navigators/RootNavigator.tsx +0 -269
- package/src/pages/Account.tsx +0 -34
- package/src/pages/AddressForm.tsx +0 -62
- package/src/pages/AddressList.tsx +0 -24
- package/src/pages/BusinessProductsList.tsx +0 -81
- package/src/pages/BusinessesListing.tsx +0 -43
- package/src/pages/CartList.tsx +0 -49
- package/src/pages/Checkout.tsx +0 -101
- package/src/pages/ForgotPassword.tsx +0 -24
- package/src/pages/Help.tsx +0 -23
- package/src/pages/HelpAccountAndPayment.tsx +0 -23
- package/src/pages/HelpGuide.tsx +0 -23
- package/src/pages/HelpOrder.tsx +0 -23
- package/src/pages/Home.tsx +0 -36
- package/src/pages/IntroductoryTutorial.tsx +0 -170
- package/src/pages/Login.tsx +0 -47
- package/src/pages/MomentOption.tsx +0 -30
- package/src/pages/MultiCheckout.tsx +0 -31
- package/src/pages/MultiOrdersDetails.tsx +0 -27
- package/src/pages/MyOrders.tsx +0 -40
- package/src/pages/NetworkError.tsx +0 -24
- package/src/pages/NotFound.tsx +0 -22
- package/src/pages/OrderDetails.tsx +0 -25
- package/src/pages/ProductDetails.tsx +0 -55
- package/src/pages/Profile.tsx +0 -36
- package/src/pages/ReviewDriver.tsx +0 -30
- package/src/pages/ReviewOrder.tsx +0 -32
- package/src/pages/ReviewProducts.tsx +0 -30
- package/src/pages/Sessions.tsx +0 -22
- package/src/pages/Signup.tsx +0 -53
- package/src/pages/SpinnerLoader.tsx +0 -10
- package/src/pages/Splash.tsx +0 -21
|
@@ -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, lightenDarkenColor, shape
|
|
17
|
+
import { convertHoursToMinutes, lightenDarkenColor, shape } from '../../utils';
|
|
18
|
+
import ReactNativeHapticFeedback from "react-native-haptic-feedback";
|
|
18
19
|
|
|
19
20
|
import {
|
|
20
21
|
BusinessHero,
|
|
@@ -34,14 +35,18 @@ import FastImage from 'react-native-fast-image'
|
|
|
34
35
|
import { LottieAnimation } from '../LottieAnimation';
|
|
35
36
|
import { CardAnimation } from '../shared/CardAnimation';
|
|
36
37
|
|
|
37
|
-
|
|
38
|
+
function BusinessControllerPropsAreEqual(prevProps: any, nextProps: any) {
|
|
39
|
+
return JSON.stringify(prevProps.business) === JSON.stringify(nextProps.business) &&
|
|
40
|
+
prevProps.isBusinessOpen === nextProps.isBusinessOpen
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export const BusinessControllerUI = React.memo((props: BusinessControllerParams) => {
|
|
38
44
|
const {
|
|
39
45
|
business,
|
|
40
46
|
handleClick,
|
|
41
47
|
navigation,
|
|
42
48
|
isBusinessOpen,
|
|
43
49
|
style,
|
|
44
|
-
isCustomLayout,
|
|
45
50
|
businessHeader,
|
|
46
51
|
businessFeatured,
|
|
47
52
|
businessLogo,
|
|
@@ -75,8 +80,8 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
75
80
|
const hideBusinessHeader = theme?.business_listing_view?.components?.business?.components?.header?.hidden
|
|
76
81
|
const hideBusinessFavoriteBadge = theme?.business_listing_view?.components?.business?.components?.featured_badge?.hidden
|
|
77
82
|
|
|
78
|
-
const textSize =
|
|
79
|
-
const cardHeight = windowHeight * 0.
|
|
83
|
+
const textSize = 12
|
|
84
|
+
const cardHeight = windowHeight * 0.34
|
|
80
85
|
|
|
81
86
|
const styles = StyleSheet.create({
|
|
82
87
|
container: {
|
|
@@ -151,6 +156,14 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
151
156
|
return _types.join(', ');
|
|
152
157
|
};
|
|
153
158
|
|
|
159
|
+
const vibrateApp = (impact?: string) => {
|
|
160
|
+
const options = {
|
|
161
|
+
enableVibrateFallback: true,
|
|
162
|
+
ignoreAndroidSystemSettings: false
|
|
163
|
+
};
|
|
164
|
+
ReactNativeHapticFeedback.trigger(impact || "impactLight", options);
|
|
165
|
+
}
|
|
166
|
+
|
|
154
167
|
const handleBusinessClick = (selectedBusiness: any) => {
|
|
155
168
|
vibrateApp()
|
|
156
169
|
if (business?.open) handleClick && handleClick(selectedBusiness)
|
|
@@ -176,7 +189,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
176
189
|
}
|
|
177
190
|
|
|
178
191
|
return (
|
|
179
|
-
<
|
|
192
|
+
<View style={{ minHeight: 200 }}>
|
|
180
193
|
{isIntersectionObserver ? (
|
|
181
194
|
<CardAnimation
|
|
182
195
|
style={[style, styles.container]}
|
|
@@ -205,7 +218,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
205
218
|
<BusinessHero>
|
|
206
219
|
{!hideBusinessHeader && (
|
|
207
220
|
<FastImage
|
|
208
|
-
style={{ height:
|
|
221
|
+
style={{ height: cardHeight * 0.66 }}
|
|
209
222
|
source={(businessHeader || business?.header || typeof theme.images.dummies.businessHeader === 'string') ? {
|
|
210
223
|
uri: optimizeImage(businessHeader || business?.header || theme.images.dummies.businessHeader, 'h_500,c_limit'),
|
|
211
224
|
priority: FastImage.priority.normal,
|
|
@@ -218,19 +231,23 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
218
231
|
<FontAwesomeIcon name="crown" size={26} color="gold" />
|
|
219
232
|
</View>
|
|
220
233
|
)}
|
|
221
|
-
{
|
|
222
|
-
getBusinessOffer((business?.offers)) &&
|
|
223
|
-
<OfferBox
|
|
234
|
+
{!hideBusinessOffer && (
|
|
235
|
+
!!getBusinessOffer((business?.offers)) &&
|
|
236
|
+
<OfferBox
|
|
237
|
+
isClosed={!isBusinessOpen && (configState?.configs?.preorder_status_enabled?.value === '1')}
|
|
238
|
+
isRibbon={business?.ribbon?.enabled && !!business?.ribbon?.text}
|
|
239
|
+
>
|
|
224
240
|
<OText
|
|
225
241
|
size={10}
|
|
226
242
|
weight={'400'}
|
|
243
|
+
color={theme.colors.textThird}
|
|
227
244
|
numberOfLines={2}
|
|
228
245
|
ellipsizeMode='tail'
|
|
229
246
|
lineHeight={13}
|
|
230
|
-
>{getBusinessOffer((business?.offers))
|
|
247
|
+
>{t('DISCOUNT', 'Discount')}{' '}{getBusinessOffer((business?.offers))}</OText>
|
|
231
248
|
</OfferBox>
|
|
232
249
|
)}
|
|
233
|
-
<BusinessState>
|
|
250
|
+
<BusinessState isRibbon={business?.ribbon?.enabled && !!business?.ribbon?.text}>
|
|
234
251
|
{!isBusinessOpen && (configState?.configs?.preorder_status_enabled?.value === '1') && (
|
|
235
252
|
<View style={styles.businessStateView}>
|
|
236
253
|
<OText
|
|
@@ -244,7 +261,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
244
261
|
</BusinessState>
|
|
245
262
|
</BusinessHero>
|
|
246
263
|
<BusinessContent>
|
|
247
|
-
<BusinessInfo style={
|
|
264
|
+
<BusinessInfo style={{ position: 'absolute', top: -26, left: 15 }}>
|
|
248
265
|
{!hideBusinessLogo && (
|
|
249
266
|
<BusinessLogo style={styles.businessLogo}>
|
|
250
267
|
<FastImage
|
|
@@ -257,38 +274,18 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
257
274
|
/>
|
|
258
275
|
</BusinessLogo>
|
|
259
276
|
)}
|
|
260
|
-
{!isCustomLayout && (!hideBusinessFavorite || !hideBusinessReviews) && (
|
|
261
|
-
<ReviewAndFavorite>
|
|
262
|
-
{(businessReviews?.reviews?.total > 0 ?? business?.reviews?.total > 0) && !hideBusinessReviews && (
|
|
263
|
-
<Reviews>
|
|
264
|
-
<OIcon src={theme.images.general.star} width={12} style={styles.starIcon} />
|
|
265
|
-
<OText size={10} style={{ lineHeight: 15 }}>
|
|
266
|
-
{parseNumber(businessReviews?.reviews?.total ?? business?.reviews?.total, { separator: '.' })}
|
|
267
|
-
</OText>
|
|
268
|
-
</Reviews>
|
|
269
|
-
)}
|
|
270
|
-
{!hideBusinessFavorite && (
|
|
271
|
-
<LottieAnimation
|
|
272
|
-
type='favorite'
|
|
273
|
-
onClick={handleChangeFavorite}
|
|
274
|
-
initialValue={business?.favorite ? 0.5 : 0}
|
|
275
|
-
toValue={business?.favorite ? 0 : 0.5}
|
|
276
|
-
disableAnimation={!auth}
|
|
277
|
-
iconProps={{ color: theme.colors.danger5, size: 18 }}
|
|
278
|
-
isActive={business?.favorite}
|
|
279
|
-
/>
|
|
280
|
-
)}
|
|
281
|
-
</ReviewAndFavorite>
|
|
282
|
-
)}
|
|
283
277
|
</BusinessInfo>
|
|
284
|
-
<View style={
|
|
278
|
+
<View style={{ width: '100%', flexDirection: 'row', justifyContent: 'space-between', marginTop: 5, alignItems: 'flex-start' }}>
|
|
285
279
|
<OText
|
|
286
280
|
size={textSize + 2}
|
|
287
|
-
style={{ lineHeight: 18, marginBottom: 6 }}
|
|
288
|
-
weight={'500'}
|
|
281
|
+
style={{ lineHeight: 18, marginBottom: 6, width: '90%' }}
|
|
282
|
+
weight={'500'}
|
|
283
|
+
numberOfLines={1}
|
|
284
|
+
ellipsizeMode='tail'
|
|
285
|
+
>
|
|
289
286
|
{business?.name}
|
|
290
287
|
</OText>
|
|
291
|
-
{
|
|
288
|
+
{(!hideBusinessFavorite || !hideBusinessReviews) && (
|
|
292
289
|
<ReviewAndFavorite>
|
|
293
290
|
{(businessReviews?.reviews?.total > 0 ?? business?.reviews?.total > 0) && !hideBusinessReviews && (
|
|
294
291
|
<Reviews>
|
|
@@ -312,7 +309,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
312
309
|
</ReviewAndFavorite>
|
|
313
310
|
)}
|
|
314
311
|
</View>
|
|
315
|
-
<OText size={textSize} style={{ lineHeight: 15, marginBottom: 3 }} numberOfLines={
|
|
312
|
+
<OText size={textSize} style={{ lineHeight: 15, marginBottom: 3, fontFamily: undefined }} numberOfLines={1}>
|
|
316
313
|
{business?.address}
|
|
317
314
|
</OText>
|
|
318
315
|
<Metadata>
|
|
@@ -384,9 +381,9 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
384
381
|
</View>
|
|
385
382
|
</Placeholder>
|
|
386
383
|
)}
|
|
387
|
-
</
|
|
384
|
+
</View>
|
|
388
385
|
);
|
|
389
|
-
};
|
|
386
|
+
}, BusinessControllerPropsAreEqual);
|
|
390
387
|
|
|
391
388
|
export const BusinessController = (props: BusinessControllerParams) => {
|
|
392
389
|
const BusinessControllerProps = {
|
|
@@ -8,13 +8,14 @@ export const BusinessHero = styled.View`
|
|
|
8
8
|
`
|
|
9
9
|
|
|
10
10
|
export const BusinessContent = styled.View`
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
position: relative;
|
|
12
|
+
padding-horizontal: 18px;
|
|
13
|
+
padding-bottom: 10px;
|
|
14
|
+
border-bottom-left-radius: 7.6px;
|
|
15
|
+
border-bottom-right-radius: 7.6px;
|
|
16
|
+
border-width: 1px;
|
|
17
|
+
border-color: ${(props: any) => props.theme.colors.border};
|
|
18
|
+
overflow: visible;
|
|
18
19
|
`;
|
|
19
20
|
|
|
20
21
|
export const BusinessInfo = styled.View`
|
|
@@ -34,8 +35,8 @@ export const Metadata = styled.View`
|
|
|
34
35
|
|
|
35
36
|
export const BusinessState = styled.View`
|
|
36
37
|
position: absolute;
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
top: ${(props: any) => props.isRibbon ? '32px' : '15px'};
|
|
39
|
+
right: 15px;
|
|
39
40
|
`
|
|
40
41
|
|
|
41
42
|
export const BusinessLogo = styled.View`
|
|
@@ -85,10 +86,9 @@ export const RibbonBox = styled.View`
|
|
|
85
86
|
export const OfferBox = styled.View`
|
|
86
87
|
position: absolute;
|
|
87
88
|
z-index: 1;
|
|
88
|
-
top: 20px;
|
|
89
|
-
right: 10px;
|
|
90
89
|
border-radius: 50px;
|
|
91
|
-
|
|
90
|
+
top: ${(props: any) => props.isRibbon ? '32px' : '15px'};
|
|
91
|
+
right: ${(props: any) => props.isClosed ? '110px' : '15px'};
|
|
92
92
|
background: ${(props: any) => props.theme.colors.inputBorderColor};
|
|
93
93
|
padding: 3px 8px;
|
|
94
94
|
max-width: 180px;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useState, useCallback } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
BusinessInformation as BusinessInformationController,
|
|
4
|
-
useLanguage, useUtils
|
|
4
|
+
useLanguage, useUtils, useConfig,
|
|
5
5
|
} from 'ordering-components/native';
|
|
6
6
|
import { useTheme } from 'styled-components/native';
|
|
7
7
|
import { OIcon, OText } from '../shared';
|
|
@@ -16,37 +16,41 @@ import {
|
|
|
16
16
|
DivideView,
|
|
17
17
|
MediaWrapper,
|
|
18
18
|
} from './styles';
|
|
19
|
-
import { StyleSheet, View } from 'react-native';
|
|
19
|
+
import { StyleSheet, View, TouchableOpacity } from 'react-native';
|
|
20
20
|
import { BusinessInformationParams } from '../../types';
|
|
21
21
|
import { GoogleMap } from '../GoogleMap';
|
|
22
22
|
import { WebView } from 'react-native-webview';
|
|
23
23
|
import { formatUrlVideo } from '../../utils'
|
|
24
24
|
import { ScheduleAccordion } from '../ScheduleAccordion';
|
|
25
|
+
import moment from 'moment';
|
|
26
|
+
import { DeviceOrientationMethods } from '../../../../../src/hooks/DeviceOrientation'
|
|
27
|
+
const { useDeviceOrientation } = DeviceOrientationMethods
|
|
28
|
+
|
|
25
29
|
const BusinessInformationUI = (props: BusinessInformationParams) => {
|
|
26
30
|
const { businessState, businessSchedule, businessLocation } = props;
|
|
27
31
|
|
|
28
32
|
const theme = useTheme();
|
|
29
33
|
const [, t] = useLanguage();
|
|
30
34
|
const [{ optimizeImage }] = useUtils();
|
|
35
|
+
const [{ configs }] = useConfig()
|
|
36
|
+
const [orientationState] = useDeviceOrientation();
|
|
37
|
+
|
|
38
|
+
const [isReadMore, setIsReadMore] = useState(false)
|
|
39
|
+
const [lengthMore, setLengthMore] = useState(false)
|
|
40
|
+
const WIDTH_SCREEN = orientationState?.dimensions?.width
|
|
31
41
|
|
|
32
42
|
const hideLocation = theme?.business_view?.components?.information?.components?.location?.hidden
|
|
33
43
|
const hideSchedule = theme?.business_view?.components?.information?.components?.schedule?.hidden
|
|
34
44
|
const hideVideos = theme?.business_view?.components?.information?.components?.videos?.hidden
|
|
35
45
|
const hideImages = theme?.business_view?.components?.information?.components?.images?.hidden
|
|
36
46
|
const hideAddress = theme?.business_view?.components?.information?.components?.address?.hidden
|
|
47
|
+
const formatTime = configs?.general_hour_format?.value
|
|
48
|
+
|
|
49
|
+
const checkTime = (val: number) => (val < 10 ? `0${val}` : val);
|
|
50
|
+
const timeFormated = (time: any) => {
|
|
51
|
+
return moment(`1900-01-01 ${checkTime(time.hour)}:${checkTime(time.minute)}`).format(formatTime)
|
|
52
|
+
}
|
|
37
53
|
|
|
38
|
-
const scheduleFormatted = ({
|
|
39
|
-
hour,
|
|
40
|
-
minute,
|
|
41
|
-
}: {
|
|
42
|
-
hour: number | string;
|
|
43
|
-
minute: number | string;
|
|
44
|
-
}) => {
|
|
45
|
-
const checkTime = (val: number | string) => (val < 10 ? `0${val}` : val);
|
|
46
|
-
const zz = hour > 12 ? 'PM' : 'AM';
|
|
47
|
-
const h = parseInt(`${hour}`);
|
|
48
|
-
return `${h > 12 ? h - 12 : h}:${checkTime(minute)} ${zz}`;
|
|
49
|
-
};
|
|
50
54
|
const businessCoordinate = {
|
|
51
55
|
lat: businessState?.business?.location?.lat,
|
|
52
56
|
lng: businessState?.business?.location?.lng,
|
|
@@ -77,6 +81,10 @@ const BusinessInformationUI = (props: BusinessInformationParams) => {
|
|
|
77
81
|
return iAry;
|
|
78
82
|
};
|
|
79
83
|
|
|
84
|
+
const onTextLayout = useCallback((e: any) => {
|
|
85
|
+
setLengthMore((e.nativeEvent.lines.length == 3 && e.nativeEvent.lines[2].width > WIDTH_SCREEN * .76) || e.nativeEvent.lines.length > 3)
|
|
86
|
+
}, [])
|
|
87
|
+
|
|
80
88
|
return (
|
|
81
89
|
<BusinessInformationContainer>
|
|
82
90
|
<WrapMainContent contentContainerStyle={{}}>
|
|
@@ -97,16 +105,36 @@ const BusinessInformationUI = (props: BusinessInformationParams) => {
|
|
|
97
105
|
readOnly
|
|
98
106
|
location={businessLocation.location}
|
|
99
107
|
markerTitle={businessState?.business?.name}
|
|
108
|
+
businessZones={businessState?.business?.zones}
|
|
100
109
|
/>
|
|
101
110
|
</WrapBusinessMap>
|
|
102
111
|
)}
|
|
103
112
|
</>
|
|
104
113
|
)}
|
|
105
114
|
{!hideAddress && (
|
|
106
|
-
<OText size={12} mBottom={
|
|
115
|
+
<OText size={12} mBottom={10}>
|
|
107
116
|
{businessState?.business?.address}
|
|
108
117
|
</OText>
|
|
109
118
|
)}
|
|
119
|
+
{businessState?.business?.address_notes && (
|
|
120
|
+
<>
|
|
121
|
+
<OText
|
|
122
|
+
size={12}
|
|
123
|
+
mBottom={10}
|
|
124
|
+
numberOfLines={isReadMore ? 20 : 3}
|
|
125
|
+
onTextLayout={onTextLayout}
|
|
126
|
+
>
|
|
127
|
+
{businessState?.business?.address_notes}
|
|
128
|
+
</OText>
|
|
129
|
+
{lengthMore && (
|
|
130
|
+
<TouchableOpacity
|
|
131
|
+
onPress={() => setIsReadMore(!isReadMore)}
|
|
132
|
+
>
|
|
133
|
+
<OText size={12} mBottom={20} color={theme.colors.primary}>{isReadMore ? t('SHOW_LESS', 'Show less') : t('READ_MORE', 'Read more')}</OText>
|
|
134
|
+
</TouchableOpacity>
|
|
135
|
+
)}
|
|
136
|
+
</>
|
|
137
|
+
)}
|
|
110
138
|
<DivideView />
|
|
111
139
|
{!hideSchedule && (
|
|
112
140
|
<>
|
|
@@ -121,7 +149,7 @@ const BusinessInformationUI = (props: BusinessInformationParams) => {
|
|
|
121
149
|
<ScheduleBlock key={i}>
|
|
122
150
|
<ScheduleAccordion
|
|
123
151
|
weekIndex={i}
|
|
124
|
-
|
|
152
|
+
timeFormated={timeFormated}
|
|
125
153
|
schedule={schedule}
|
|
126
154
|
/>
|
|
127
155
|
</ScheduleBlock>
|
|
@@ -17,7 +17,7 @@ export const MediaWrapper = styled.ScrollView`
|
|
|
17
17
|
height: 127px;
|
|
18
18
|
`
|
|
19
19
|
export const InnerContent = styled.View`
|
|
20
|
-
padding: 20px
|
|
20
|
+
padding: 20px;
|
|
21
21
|
`
|
|
22
22
|
export const WrapScheduleBlock = styled.View`
|
|
23
23
|
margin: 20px 0;
|
|
@@ -36,4 +36,4 @@ export const DivideView = styled.View`
|
|
|
36
36
|
height: 8px;
|
|
37
37
|
background-color: ${(props: any) => props.theme.colors.backgroundGray100};
|
|
38
38
|
margin-horizontal: -40px;
|
|
39
|
-
`;
|
|
39
|
+
`;
|
|
@@ -23,7 +23,10 @@ export const BusinessItemAccordion = (props: any) => {
|
|
|
23
23
|
handleClickCheckout,
|
|
24
24
|
checkoutButtonDisabled,
|
|
25
25
|
isMultiCheckout,
|
|
26
|
-
isFromUpselling
|
|
26
|
+
isFromUpselling,
|
|
27
|
+
changeActiveState,
|
|
28
|
+
isActive,
|
|
29
|
+
isGiftCart
|
|
27
30
|
} = props
|
|
28
31
|
|
|
29
32
|
const [orderState] = useOrder();
|
|
@@ -38,14 +41,13 @@ export const BusinessItemAccordion = (props: any) => {
|
|
|
38
41
|
const isProducts = cart?.products?.length
|
|
39
42
|
const isBusinessChangeEnabled = configs?.cart_change_business_validation?.value === '1'
|
|
40
43
|
|
|
41
|
-
const [isActive, setActiveState] = useState(!!singleBusiness)
|
|
42
44
|
const [viewedCart, setViewedCart] = useState<any>(null)
|
|
43
45
|
|
|
44
46
|
useEffect(() => {
|
|
45
47
|
const cartsArray = Object.values(orderState?.carts)
|
|
46
48
|
const cartsLength = cartsArray.filter((cart: any) => cart.products.length > 0).length ?? 0
|
|
47
49
|
if (cartsLength === 1) {
|
|
48
|
-
|
|
50
|
+
changeActiveState && changeActiveState(!isClosed, cart?.uuid)
|
|
49
51
|
}
|
|
50
52
|
}, [orderState?.carts, isClosed])
|
|
51
53
|
|
|
@@ -68,14 +70,14 @@ export const BusinessItemAccordion = (props: any) => {
|
|
|
68
70
|
<BIContainer isClosed={isClosed} isMultiCheckout={isMultiCheckout} checkoutVisible={!isActive && !isClosed && !!isProducts && !checkoutButtonDisabled}>
|
|
69
71
|
<BIHeader
|
|
70
72
|
isClosed={isClosed}
|
|
71
|
-
onPress={() => !isClosed ?
|
|
73
|
+
onPress={() => !isClosed ? changeActiveState && changeActiveState(!isClosed, cart?.uuid) : isClosed}
|
|
72
74
|
activeOpacity={1}
|
|
73
75
|
>
|
|
74
76
|
<BIInfo>
|
|
75
77
|
<BIContentInfo>
|
|
76
78
|
<OText size={16} lineHeight={24} weight={'600'}>{cart?.business?.name}</OText>
|
|
77
79
|
<View style={{ flexDirection: 'row' }}>
|
|
78
|
-
{props.onNavigationRedirect && !isClosed && (
|
|
80
|
+
{props.onNavigationRedirect && !isClosed && !isGiftCart && (
|
|
79
81
|
<>
|
|
80
82
|
<TouchableOpacity onPress={() => props.onNavigationRedirect('Business', { store: cart?.business?.slug })}>
|
|
81
83
|
<OText color={theme.colors.primary} size={12} lineHeight={18} style={{ textDecorationLine: 'underline' }}>{t('GO_TO_STORE', 'Go to store')}</OText>
|
|
@@ -84,7 +86,9 @@ export const BusinessItemAccordion = (props: any) => {
|
|
|
84
86
|
)}
|
|
85
87
|
{!isCartPending && (
|
|
86
88
|
<>
|
|
87
|
-
|
|
89
|
+
{!isGiftCart && (
|
|
90
|
+
<OText color={theme.colors.textSecondary}>{' \u2022 '}</OText>
|
|
91
|
+
)}
|
|
88
92
|
<OAlert
|
|
89
93
|
title={t('DELETE_CART', 'Delete Cart')}
|
|
90
94
|
message={t('QUESTION_DELETE_CART', 'Are you sure to you wants delete the selected cart')}
|
|
@@ -94,7 +98,7 @@ export const BusinessItemAccordion = (props: any) => {
|
|
|
94
98
|
</OAlert>
|
|
95
99
|
</>
|
|
96
100
|
)}
|
|
97
|
-
{isBusinessChangeEnabled && props.handleChangeStore && (
|
|
101
|
+
{isBusinessChangeEnabled && props.handleChangeStore && !isGiftCart && (
|
|
98
102
|
<>
|
|
99
103
|
<OText color={theme.colors.textSecondary}>{' \u2022 '}</OText>
|
|
100
104
|
<TouchableOpacity
|