ordering-ui-react-native 0.17.59 → 0.17.60-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/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 +4 -4
- 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 +125 -113
- package/themes/business/src/components/DriverMap/index.tsx +17 -6
- package/themes/business/src/components/DriverSchedule/index.tsx +42 -5
- 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 +130 -61
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +64 -63
- 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 +113 -121
- 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 +445 -243
- package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
- package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
- package/themes/business/src/components/ReviewCustomer/index.tsx +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 +4 -0
- package/themes/original/src/components/AddressDetails/index.tsx +28 -10
- package/themes/original/src/components/AddressForm/index.tsx +68 -40
- 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 +122 -68
- package/themes/original/src/components/BusinessController/styles.tsx +23 -4
- 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 +142 -109
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +15 -20
- package/themes/original/src/components/BusinessListingSearch/index.tsx +352 -326
- 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 +25 -15
- 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 -555
- 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 +97 -91
- 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 -50
- 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 +387 -172
- package/themes/original/src/components/Checkout/styles.tsx +4 -2
- package/themes/original/src/components/CitiesControl/index.tsx +89 -0
- package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
- package/themes/original/src/components/CouponControl/index.tsx +10 -3
- package/themes/original/src/components/DriverTips/index.tsx +52 -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 +51 -80
- package/themes/original/src/components/FloatingButton/index.tsx +1 -2
- package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
- package/themes/original/src/components/GPSButton/index.tsx +6 -4
- package/themes/original/src/components/GPSButton/styles.ts +3 -3
- package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +96 -0
- package/themes/original/src/components/GiftCard/GiftCardUI/styles.tsx +5 -0
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +100 -0
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +8 -0
- package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +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 +55 -13
- package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
- package/themes/original/src/components/LoginForm/index.tsx +59 -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 +32 -10
- 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 +50 -0
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +162 -51
- package/themes/original/src/components/MultiCheckout/index.tsx +308 -88
- 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 +68 -21
- package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
- package/themes/original/src/components/MyOrders/index.tsx +77 -52
- 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 +15 -3
- package/themes/original/src/components/OrderDetails/index.tsx +190 -358
- 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 +33 -59
- 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/PreviousBusinessOrdered/index.tsx +24 -19
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +14 -14
- package/themes/original/src/components/OrdersOption/index.tsx +78 -67
- package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
- package/themes/original/src/components/PageBanner/index.tsx +106 -31
- package/themes/original/src/components/PageBanner/styles.tsx +4 -4
- 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 +114 -35
- package/themes/original/src/components/ProductForm/styles.tsx +6 -8
- package/themes/original/src/components/ProductItemAccordion/index.tsx +22 -19
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +34 -24
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +5 -10
- 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 +234 -220
- package/themes/original/src/components/Promotions/styles.tsx +10 -3
- package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
- package/themes/original/src/components/ReviewOrder/index.tsx +26 -9
- package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
- package/themes/original/src/components/ReviewProducts/index.tsx +23 -11
- package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
- package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
- package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
- package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
- package/themes/original/src/components/ServiceForm/index.tsx +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 +130 -52
- package/themes/original/src/components/SingleOrderCard/styles.tsx +11 -2
- package/themes/original/src/components/SingleProductCard/index.tsx +71 -34
- package/themes/original/src/components/SingleProductCard/styles.tsx +21 -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 +8 -4
- 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/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/HeaderTitle.tsx +1 -1
- 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/layouts/Container.tsx +1 -1
- package/themes/original/src/types/index.tsx +40 -10
- package/themes/original/src/utils/index.tsx +273 -1
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -7,7 +7,7 @@ export const TopHeader = styled.View`
|
|
|
7
7
|
width: 100%;
|
|
8
8
|
flex-direction: row;
|
|
9
9
|
align-items: center;
|
|
10
|
-
justify-content: space-between;
|
|
10
|
+
justify-content: ${({ hideArrow }: any) => hideArrow ? 'flex-end' : 'space-between'};
|
|
11
11
|
z-index: 1;
|
|
12
12
|
height: 60px;
|
|
13
13
|
min-height: 60px;
|
|
@@ -24,7 +24,7 @@ export const WrapSearchBar = styled.View`
|
|
|
24
24
|
flex: 1;
|
|
25
25
|
`
|
|
26
26
|
export const WrapContent = styled.View`
|
|
27
|
-
padding: 10px
|
|
27
|
+
padding-vertical: 10px;
|
|
28
28
|
`
|
|
29
29
|
|
|
30
30
|
export const BusinessProductsListingContainer = styled.ScrollView`
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
BusinessReviews as BusinessReviewController,
|
|
4
4
|
useLanguage,
|
|
5
5
|
useOrder,
|
|
6
|
+
useUtils
|
|
6
7
|
} from 'ordering-components/native';
|
|
7
8
|
import { useTheme } from 'styled-components/native';
|
|
8
9
|
import IconAntDesign from 'react-native-vector-icons/AntDesign';
|
|
@@ -30,6 +31,7 @@ const BusinessReviewsUI = (props: BusinessReviewsParams) => {
|
|
|
30
31
|
const theme = useTheme();
|
|
31
32
|
const [searchReview, setSearchReview] = useState('')
|
|
32
33
|
const [orderState] = useOrder();
|
|
34
|
+
const [{ parseDate }] = useUtils()
|
|
33
35
|
|
|
34
36
|
const styles = StyleSheet.create({
|
|
35
37
|
starIcon: {
|
|
@@ -94,7 +96,7 @@ const BusinessReviewsUI = (props: BusinessReviewsParams) => {
|
|
|
94
96
|
const ReviewItem = ({ comment, created_at, total }: any) => (
|
|
95
97
|
<View style={{ marginBottom: 30 }}>
|
|
96
98
|
<OText size={12} color={theme.colors.textSecondary}>
|
|
97
|
-
{
|
|
99
|
+
{parseDate(created_at, { outputFormat: 'MMMM D, YYYY • hh:mm A' })}
|
|
98
100
|
</OText>
|
|
99
101
|
<OText size={12} color={theme.colors.textNormal}>{comment}</OText>
|
|
100
102
|
</View>
|
|
@@ -284,7 +284,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
284
284
|
style={{ paddingTop: top + 20 }}>
|
|
285
285
|
{!auth && (
|
|
286
286
|
<TouchableOpacity onPress={() => navigation?.canGoBack() && navigation.goBack()} style={{ position: 'absolute', marginStart: 40, paddingVertical: 20 }}>
|
|
287
|
-
<
|
|
287
|
+
<OIcon src={theme.images.general.arrow_left} color={theme.colors.textNormal} />
|
|
288
288
|
</TouchableOpacity>
|
|
289
289
|
)}
|
|
290
290
|
<Search>
|
|
@@ -18,8 +18,7 @@ import {
|
|
|
18
18
|
useSession,
|
|
19
19
|
useOrder,
|
|
20
20
|
useConfig,
|
|
21
|
-
useUtils
|
|
22
|
-
useOrderingTheme
|
|
21
|
+
useUtils
|
|
23
22
|
} from 'ordering-components/native';
|
|
24
23
|
import { useTheme } from 'styled-components/native';
|
|
25
24
|
import Ionicons from 'react-native-vector-icons/Ionicons'
|
|
@@ -39,8 +38,7 @@ import {
|
|
|
39
38
|
BusinessLogosContainer
|
|
40
39
|
} from './styles';
|
|
41
40
|
|
|
42
|
-
import {
|
|
43
|
-
import { OButton, OIcon, OText, OBottomPopup, OModal } from '../../../shared';
|
|
41
|
+
import { OIcon, OText, OModal } from '../../../shared';
|
|
44
42
|
import { BusinessesListingParams } from '../../../../types';
|
|
45
43
|
import { NotFoundSource } from '../../../NotFoundSource';
|
|
46
44
|
import { BusinessTypeFilter } from '../../../BusinessTypeFilter';
|
|
@@ -49,12 +47,13 @@ import { OrderTypeSelector } from '../../../OrderTypeSelector';
|
|
|
49
47
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
50
48
|
import { BusinessFeaturedController } from '../../../BusinessFeaturedController';
|
|
51
49
|
import { HighestRatedBusinesses } from '../../../HighestRatedBusinesses';
|
|
52
|
-
import { getTypesText
|
|
50
|
+
import { getTypesText } from '../../../../utils';
|
|
53
51
|
import { OrderProgress } from '../../../OrderProgress';
|
|
54
52
|
import { useFocusEffect, useIsFocused } from '@react-navigation/native';
|
|
55
53
|
import FastImage from 'react-native-fast-image';
|
|
56
54
|
import IconAntDesign from 'react-native-vector-icons/AntDesign';
|
|
57
55
|
import { PageBanner } from '../../../PageBanner'
|
|
56
|
+
import { CitiesControl } from '../../../CitiesControl'
|
|
58
57
|
|
|
59
58
|
const PIXELS_TO_SCROLL = 2000;
|
|
60
59
|
|
|
@@ -62,12 +61,10 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
62
61
|
const {
|
|
63
62
|
navigation,
|
|
64
63
|
businessesList,
|
|
65
|
-
searchValue,
|
|
66
64
|
getBusinesses,
|
|
67
65
|
handleChangeBusinessType,
|
|
68
66
|
handleBusinessClick,
|
|
69
67
|
paginationProps,
|
|
70
|
-
handleChangeSearch,
|
|
71
68
|
businessId,
|
|
72
69
|
isGuestUser,
|
|
73
70
|
handleUpdateBusinessList,
|
|
@@ -76,15 +73,26 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
76
73
|
logosLayout
|
|
77
74
|
} = props;
|
|
78
75
|
const theme = useTheme();
|
|
79
|
-
const [orderingTheme] = useOrderingTheme()
|
|
80
76
|
const isFocused = useIsFocused();
|
|
77
|
+
|
|
78
|
+
const [, t] = useLanguage();
|
|
79
|
+
const [{ user, auth }] = useSession();
|
|
80
|
+
const [orderState, { changeCityFilter }] = useOrder();
|
|
81
|
+
const [{ configs }] = useConfig();
|
|
82
|
+
const [{ parseDate }] = useUtils();
|
|
83
|
+
|
|
81
84
|
const appState = useRef(AppState.currentState)
|
|
82
|
-
const
|
|
83
|
-
const [appStateVisible, setAppStateVisible] = useState(appState.current);
|
|
84
|
-
const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
|
|
85
|
-
const hideCities = theme?.business_listing_view?.components?.cities?.hidden ?? true
|
|
85
|
+
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
86
86
|
const [refreshing] = useState(false);
|
|
87
|
-
const
|
|
87
|
+
const allCitiesDisabled = citiesState?.cities?.every((city: any) => !city.enabled)
|
|
88
|
+
const hideCities = (theme?.business_listing_view?.components?.cities?.hidden || orderState?.options?.type !== 2 || allCitiesDisabled) ?? true
|
|
89
|
+
const hideHero = theme?.business_listing_view?.components?.business_hero?.hidden
|
|
90
|
+
const hidePreviousOrders = theme?.business_listing_view?.components?.previous_orders_block?.hidden
|
|
91
|
+
const hideHighestBusiness = theme?.business_listing_view?.components?.highest_rated_business_block?.hidden
|
|
92
|
+
const isAllCategoriesHidden = theme?.business_listing_view?.components?.categories?.hidden
|
|
93
|
+
const bgHeader = theme?.business_listing_view?.components?.business_hero?.components?.image
|
|
94
|
+
const bgHeaderHeight = theme?.business_listing_view?.components?.business_hero?.components?.style?.height
|
|
95
|
+
|
|
88
96
|
const styles = StyleSheet.create({
|
|
89
97
|
container: {
|
|
90
98
|
marginBottom: 0,
|
|
@@ -148,19 +156,12 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
148
156
|
},
|
|
149
157
|
});
|
|
150
158
|
|
|
151
|
-
|
|
152
|
-
const [, t] = useLanguage();
|
|
153
|
-
const [{ user, auth }] = useSession();
|
|
154
|
-
const [orderState, { changeCityFilter }] = useOrder();
|
|
155
|
-
const [{ configs }] = useConfig();
|
|
156
|
-
const [{ parseDate }] = useUtils();
|
|
157
|
-
|
|
158
159
|
const { top } = useSafeAreaInsets();
|
|
159
160
|
|
|
160
161
|
const [featuredBusiness, setFeaturedBusinesses] = useState(Array);
|
|
161
162
|
const [isFarAway, setIsFarAway] = useState(false)
|
|
162
163
|
const [businessTypes, setBusinessTypes] = useState(null)
|
|
163
|
-
const [orderTypeValue, setOrderTypeValue] = useState(orderState?.options
|
|
164
|
+
const [orderTypeValue, setOrderTypeValue] = useState(orderState?.options?.value)
|
|
164
165
|
const [isOpenCities, setIsOpenCities] = useState(false)
|
|
165
166
|
const isPreorderEnabled = (configs?.preorder_status_enabled?.value === '1' || configs?.preorder_status_enabled?.value === 'true') &&
|
|
166
167
|
Number(configs?.max_days_preorder?.value) > 0
|
|
@@ -193,6 +194,10 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
193
194
|
}
|
|
194
195
|
};
|
|
195
196
|
|
|
197
|
+
const convertToRadian = (value: number) => {
|
|
198
|
+
return value * Math.PI / 180
|
|
199
|
+
}
|
|
200
|
+
|
|
196
201
|
const getDistance = (lat1: any, lon1: any, lat2: any, lon2: any) => {
|
|
197
202
|
const R = 6371 // km
|
|
198
203
|
const dLat = convertToRadian(lat2 - lat1)
|
|
@@ -220,7 +225,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
220
225
|
|
|
221
226
|
useEffect(() => {
|
|
222
227
|
if (!businessesList?.loading) {
|
|
223
|
-
const fb = businessesList.businesses.filter((b) => b
|
|
228
|
+
const fb = businessesList.businesses.filter((b) => b?.featured && b?.open);
|
|
224
229
|
const ary = [];
|
|
225
230
|
while (fb.length > 0) {
|
|
226
231
|
ary.push(fb.splice(0, 2));
|
|
@@ -289,6 +294,12 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
289
294
|
setIsOpenCities(false)
|
|
290
295
|
}, [orderState?.options?.city_id])
|
|
291
296
|
|
|
297
|
+
useEffect(() => {
|
|
298
|
+
if (!citiesState?.cities?.length || !orderState?.options?.city_id) return
|
|
299
|
+
const selectedCity = citiesState?.cities?.find((city: any) => city?.id === orderState?.options?.city_id)
|
|
300
|
+
if (!selectedCity || !selectedCity?.enabled) changeCityFilter(null)
|
|
301
|
+
}, [citiesState, orderState?.options?.city_id])
|
|
302
|
+
|
|
292
303
|
if (logosLayout) {
|
|
293
304
|
return (
|
|
294
305
|
<BusinessLogosContainer
|
|
@@ -314,10 +325,9 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
314
325
|
key={business?.id}
|
|
315
326
|
onPress={() => handleBusinessClick && handleBusinessClick(business)}
|
|
316
327
|
style={{
|
|
317
|
-
width:
|
|
318
|
-
height:
|
|
319
|
-
|
|
320
|
-
borderBottomWidth: business?.slug === actualSlug ? 2 : 0,
|
|
328
|
+
width: 60,
|
|
329
|
+
height: 60,
|
|
330
|
+
borderRadius: 8,
|
|
321
331
|
marginRight: 5
|
|
322
332
|
}}
|
|
323
333
|
>
|
|
@@ -326,8 +336,9 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
326
336
|
width: 56,
|
|
327
337
|
height: 56,
|
|
328
338
|
marginRight: 20,
|
|
329
|
-
|
|
330
|
-
|
|
339
|
+
borderRadius: 8,
|
|
340
|
+
borderColor: theme.colors.primary,
|
|
341
|
+
borderWidth: business?.slug === actualSlug ? 2 : 0
|
|
331
342
|
}}
|
|
332
343
|
source={{
|
|
333
344
|
uri: business?.logo,
|
|
@@ -370,8 +381,8 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
370
381
|
>
|
|
371
382
|
{isChewLayout && (
|
|
372
383
|
<View style={{ marginTop: 30, paddingHorizontal: 30, flexDirection: 'row', justifyContent: 'space-between' }}>
|
|
373
|
-
<OText size={
|
|
374
|
-
{t('WELCOME', 'Welcome')} {user?.name}
|
|
384
|
+
<OText size={24} weight={700} color={theme.colors?.white}>
|
|
385
|
+
{t('WELCOME', 'Welcome')} {user?.name}
|
|
375
386
|
</OText>
|
|
376
387
|
</View>
|
|
377
388
|
)}
|
|
@@ -466,18 +477,30 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
466
477
|
)}
|
|
467
478
|
</View>
|
|
468
479
|
{!isChewLayout ? (
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
480
|
+
<>
|
|
481
|
+
{!hideHero ? (
|
|
482
|
+
<HeaderWrapper
|
|
483
|
+
source={bgHeader ? { uri: bgHeader } : theme.images.backgrounds.business_list_header}
|
|
484
|
+
style={{ paddingTop: top + 20 }}
|
|
485
|
+
resizeMode='cover'
|
|
486
|
+
bgHeaderHeight={bgHeaderHeight}
|
|
487
|
+
>
|
|
488
|
+
{!auth && (
|
|
489
|
+
<TouchableOpacity onPress={() => navigation?.canGoBack() && navigation.goBack()} style={{ position: 'absolute', marginStart: 40, paddingVertical: 20 }}>
|
|
490
|
+
<OIcon src={theme.images.general.arrow_left} color={theme.colors.textNormal} />
|
|
491
|
+
</TouchableOpacity>
|
|
492
|
+
)}
|
|
493
|
+
</HeaderWrapper>
|
|
494
|
+
) : (
|
|
495
|
+
<>
|
|
496
|
+
{!auth && (
|
|
497
|
+
<TouchableOpacity onPress={() => navigation?.canGoBack() && navigation.goBack()} style={{ position: 'absolute', marginStart: 40, paddingVertical: 20 }}>
|
|
498
|
+
<OIcon src={theme.images.general.arrow_left} color={theme.colors.textNormal} />
|
|
499
|
+
</TouchableOpacity>
|
|
500
|
+
)}
|
|
501
|
+
</>
|
|
479
502
|
)}
|
|
480
|
-
|
|
503
|
+
</>
|
|
481
504
|
) : (
|
|
482
505
|
<OrderTypesContainer>
|
|
483
506
|
<OrderTypeSelector
|
|
@@ -494,6 +517,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
494
517
|
<TouchableOpacity
|
|
495
518
|
style={styles.buttonCityStyle}
|
|
496
519
|
onPress={() => setIsOpenCities(true)}
|
|
520
|
+
disabled={orderState?.loading}
|
|
497
521
|
>
|
|
498
522
|
<OText size={18} color={theme.colors.backgroundGray} weight='bold' style={{ textAlign: 'center' }}>
|
|
499
523
|
{citiesState?.cities?.find((city: any) => city?.id === orderState?.options?.city_id)?.name || t('FILTER_BY_CITY', 'Filter by city')}
|
|
@@ -501,10 +525,12 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
501
525
|
</TouchableOpacity>
|
|
502
526
|
</View>
|
|
503
527
|
)}
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
528
|
+
{!hidePreviousOrders && (
|
|
529
|
+
<OrderProgress
|
|
530
|
+
{...props}
|
|
531
|
+
isFocused={isFocused}
|
|
532
|
+
/>
|
|
533
|
+
)}
|
|
508
534
|
{
|
|
509
535
|
!businessId && !props.franchiseId && featuredBusiness && featuredBusiness.length > 0 && (
|
|
510
536
|
<FeaturedWrapper>
|
|
@@ -537,23 +563,28 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
537
563
|
</FeaturedWrapper>
|
|
538
564
|
)
|
|
539
565
|
}
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
566
|
+
{!isChewLayout && !hideHighestBusiness && (
|
|
567
|
+
<>
|
|
568
|
+
<View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100 }} />
|
|
569
|
+
{
|
|
570
|
+
!businessId && !props.franchiseId && (
|
|
571
|
+
<HighestRatedBusinesses
|
|
572
|
+
propsToFetch={props.propsToFetch}
|
|
573
|
+
onBusinessClick={handleBusinessClick}
|
|
574
|
+
navigation={navigation}
|
|
575
|
+
favoriteIds={favoriteIds}
|
|
576
|
+
setFavoriteIds={setFavoriteIds}
|
|
577
|
+
/>
|
|
578
|
+
)
|
|
579
|
+
}
|
|
580
|
+
</>
|
|
581
|
+
)}
|
|
551
582
|
|
|
552
|
-
<PageBanner position='app_business_listing' />
|
|
583
|
+
<PageBanner position='app_business_listing' navigation={navigation} />
|
|
553
584
|
|
|
554
585
|
<View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100 }} />
|
|
555
|
-
<ListWrapper>
|
|
556
|
-
{!businessId && (
|
|
586
|
+
<ListWrapper style={{ paddingHorizontal: isChewLayout ? 20 : 40 }}>
|
|
587
|
+
{!businessId && !isAllCategoriesHidden && (
|
|
557
588
|
<BusinessTypeFilter
|
|
558
589
|
images={props.images}
|
|
559
590
|
businessTypes={props.businessTypes}
|
|
@@ -562,7 +593,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
562
593
|
setBusinessTypes={setBusinessTypes}
|
|
563
594
|
/>
|
|
564
595
|
)}
|
|
565
|
-
{!businessesList.loading && businessesList.businesses.length === 0 && (
|
|
596
|
+
{!businessesList.loading && businessesList.businesses.length === 0 && businessesList?.fetched && (
|
|
566
597
|
<NotFoundSource
|
|
567
598
|
content={t(
|
|
568
599
|
'NOT_FOUND_BUSINESSES',
|
|
@@ -594,7 +625,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
594
625
|
/>
|
|
595
626
|
)
|
|
596
627
|
)}
|
|
597
|
-
{businessesList.loading && (
|
|
628
|
+
{(businessesList.loading || !businessesList?.fetched) && (
|
|
598
629
|
<>
|
|
599
630
|
{[
|
|
600
631
|
...Array(
|
|
@@ -651,36 +682,11 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
651
682
|
onClose={() => setIsOpenCities(false)}
|
|
652
683
|
title={t('SELECT_A_CITY', 'Select a city')}
|
|
653
684
|
>
|
|
654
|
-
<
|
|
655
|
-
{citiesState?.cities
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
padding: 10,
|
|
660
|
-
flexDirection: 'row'
|
|
661
|
-
}}
|
|
662
|
-
onPress={() => handleChangeCity(city?.id)}
|
|
663
|
-
disabled={orderState?.loading}
|
|
664
|
-
>
|
|
665
|
-
{orderState?.options?.city_id === city?.id ? (
|
|
666
|
-
<OIcon
|
|
667
|
-
src={theme.images.general.option_checked}
|
|
668
|
-
width={16}
|
|
669
|
-
style={{ marginEnd: 24 }}
|
|
670
|
-
/>
|
|
671
|
-
) : (
|
|
672
|
-
<OIcon
|
|
673
|
-
src={theme.images.general.option_normal}
|
|
674
|
-
width={16}
|
|
675
|
-
style={{ marginEnd: 24 }}
|
|
676
|
-
/>
|
|
677
|
-
)}
|
|
678
|
-
<OText color={theme.colors.black}>
|
|
679
|
-
{city?.name}
|
|
680
|
-
</OText>
|
|
681
|
-
</TouchableOpacity>
|
|
682
|
-
))}
|
|
683
|
-
</View>
|
|
685
|
+
<CitiesControl
|
|
686
|
+
cities={citiesState?.cities}
|
|
687
|
+
onClose={() => setIsOpenCities(false)}
|
|
688
|
+
handleChangeCity={handleChangeCity}
|
|
689
|
+
/>
|
|
684
690
|
</OModal>
|
|
685
691
|
</IOScrollView>
|
|
686
692
|
);
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
useValidationFields,
|
|
9
9
|
} from 'ordering-components/native';
|
|
10
10
|
import { useTheme } from 'styled-components/native';
|
|
11
|
-
import { CContainer, CheckoutAction,
|
|
11
|
+
import { CContainer, CheckoutAction, DriverTipsContainer } from './styles';
|
|
12
12
|
|
|
13
13
|
import { OSBill, OSTable, OSCoupon, OSTotal, OSRow } from '../OrderSummary/styles';
|
|
14
14
|
|
|
@@ -23,7 +23,7 @@ import { ActivityIndicator, TouchableOpacity, View } from 'react-native';
|
|
|
23
23
|
import AntIcon from 'react-native-vector-icons/AntDesign'
|
|
24
24
|
import { TaxInformation } from '../TaxInformation';
|
|
25
25
|
import { CartStoresListing } from '../CartStoresListing';
|
|
26
|
-
import { OAlert } from '
|
|
26
|
+
import { OAlert } from '../shared'
|
|
27
27
|
import { PlaceSpot } from '../PlaceSpot'
|
|
28
28
|
import { DriverTips } from '../DriverTips'
|
|
29
29
|
|
|
@@ -41,7 +41,17 @@ const CartUI = (props: any) => {
|
|
|
41
41
|
commentState,
|
|
42
42
|
onNavigationRedirect,
|
|
43
43
|
handleRemoveOfferClick,
|
|
44
|
-
isMultiCheckout
|
|
44
|
+
isMultiCheckout,
|
|
45
|
+
hideDeliveryFee,
|
|
46
|
+
hideDriverTip,
|
|
47
|
+
hideCouponInput,
|
|
48
|
+
preorderSlotInterval,
|
|
49
|
+
preorderLeadTime,
|
|
50
|
+
preorderTimeRange,
|
|
51
|
+
preorderMaximumDays,
|
|
52
|
+
preorderMinimumDays,
|
|
53
|
+
cateringTypes,
|
|
54
|
+
isFromUpselling
|
|
45
55
|
} = props
|
|
46
56
|
|
|
47
57
|
const theme = useTheme();
|
|
@@ -56,18 +66,15 @@ const CartUI = (props: any) => {
|
|
|
56
66
|
const [openChangeStore, setOpenChangeStore] = useState(false)
|
|
57
67
|
const [canOpenUpselling, setCanOpenUpselling] = useState(false)
|
|
58
68
|
const [openTaxModal, setOpenTaxModal] = useState<any>({ open: false, data: null, type: '' })
|
|
59
|
-
const [confirm, setConfirm] = useState<any>({ open: false, content: null, handleOnAccept: null, id: null, title: null })
|
|
60
69
|
const [openPlaceModal, setOpenPlaceModal] = useState(false)
|
|
61
70
|
|
|
62
71
|
const isCartPending = cart?.status === 2
|
|
63
72
|
const isCouponEnabled = validationFields?.fields?.checkout?.coupon?.enabled
|
|
64
|
-
const isCheckoutMultiBusinessEnabled: Boolean = configs?.checkout_multi_business_enabled?.value === '1'
|
|
65
|
-
const openCarts = (Object.values(orderState?.carts)?.filter((cart: any) => cart?.products && cart?.products?.length && cart?.status !== 2 && cart?.valid_schedule && cart?.valid_products && cart?.valid_address && cart?.valid_maximum && cart?.valid_minimum && !cart?.wallets) || null) || []
|
|
66
|
-
|
|
67
73
|
const business: any = (orderState?.carts && Object.values(orderState.carts).find((_cart: any) => _cart?.uuid === props.cartuuid)) ?? {}
|
|
68
74
|
const businessId = business?.business_id ?? null
|
|
69
75
|
const placeSpotTypes = [4]
|
|
70
|
-
|
|
76
|
+
const hideCartComments = theme?.business_view?.components?.cart?.components?.comments?.hidden
|
|
77
|
+
const hideCartDiscount = theme?.business_view?.components?.cart?.components?.discount?.hidden
|
|
71
78
|
const driverTipsOptions = typeof configs?.driver_tip_options?.value === 'string'
|
|
72
79
|
? JSON.parse(configs?.driver_tip_options?.value) || []
|
|
73
80
|
: configs?.driver_tip_options?.value || []
|
|
@@ -101,21 +108,45 @@ const CartUI = (props: any) => {
|
|
|
101
108
|
}
|
|
102
109
|
}
|
|
103
110
|
|
|
104
|
-
const handleUpsellingPage = () => {
|
|
111
|
+
const handleUpsellingPage = (individualCart : any) => {
|
|
112
|
+
const isProductCartParam = !!individualCart?.products?.length
|
|
105
113
|
setOpenUpselling(false)
|
|
106
114
|
setCanOpenUpselling(false)
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
115
|
+
|
|
116
|
+
const cartsAvailable: any = Object.values(orderState?.carts)
|
|
117
|
+
?.filter((_cart: any) => _cart?.valid && _cart?.status !== 2 && _cart?.products?.length)
|
|
118
|
+
?.filter((_c: any) => !isProductCartParam ? _c.uuid !== individualCart?.uuid : _c)
|
|
119
|
+
if (cartsAvailable.length === 1 || !isMultiCheckout) {
|
|
120
|
+
const cart = isMultiCheckout ? cartsAvailable[0] : individualCart
|
|
121
|
+
onNavigationRedirect('CheckoutNavigator', {
|
|
113
122
|
screen: 'CheckoutPage',
|
|
114
123
|
cartUuid: cart?.uuid,
|
|
115
124
|
businessLogo: cart?.business?.logo,
|
|
116
125
|
businessName: cart?.business?.name,
|
|
117
126
|
cartTotal: cart?.total
|
|
127
|
+
}, true)
|
|
128
|
+
} else {
|
|
129
|
+
const groupKeys: any = {}
|
|
130
|
+
cartsAvailable.forEach((_cart: any) => {
|
|
131
|
+
groupKeys[_cart?.group?.uuid]
|
|
132
|
+
? groupKeys[_cart?.group?.uuid] += 1
|
|
133
|
+
: groupKeys[_cart?.group?.uuid ?? 'null'] = 1
|
|
118
134
|
})
|
|
135
|
+
|
|
136
|
+
if (
|
|
137
|
+
(Object.keys(groupKeys).length === 1 && Object.keys(groupKeys)[0] === 'null') ||
|
|
138
|
+
Object.keys(groupKeys).length > 1
|
|
139
|
+
) {
|
|
140
|
+
onNavigationRedirect('CheckoutNavigator', {
|
|
141
|
+
screen: 'MultiCheckout',
|
|
142
|
+
checkCarts: true
|
|
143
|
+
}, true)
|
|
144
|
+
} else {
|
|
145
|
+
onNavigationRedirect('CheckoutNavigator', {
|
|
146
|
+
screen: 'MultiCheckout',
|
|
147
|
+
cartUuid: cartsAvailable[0]?.group?.uuid
|
|
148
|
+
}, true)
|
|
149
|
+
}
|
|
119
150
|
}
|
|
120
151
|
}
|
|
121
152
|
|
|
@@ -133,16 +164,16 @@ const CartUI = (props: any) => {
|
|
|
133
164
|
return cart?.taxes?.filter((tax: any) => tax?.type === 1)?.reduce((carry: number, tax: any) => carry + (tax?.summary?.tax_after_discount ?? tax?.summary?.tax), 0)
|
|
134
165
|
}
|
|
135
166
|
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
167
|
+
const OfferAlert = ({ offerId }: any) => {
|
|
168
|
+
return (
|
|
169
|
+
<OAlert
|
|
170
|
+
title={t('OFFER', 'Offer')}
|
|
171
|
+
message={t('QUESTION_DELETE_OFFER', 'Are you sure that you want to delete the offer?')}
|
|
172
|
+
onAccept={() => handleRemoveOfferClick(offerId)}
|
|
173
|
+
>
|
|
174
|
+
<AntIcon style={{ marginLeft: 3 }} name='closecircle' size={16} color={theme.colors.primary} />
|
|
175
|
+
</OAlert>
|
|
176
|
+
)
|
|
146
177
|
}
|
|
147
178
|
|
|
148
179
|
const walletName: any = {
|
|
@@ -186,12 +217,14 @@ const CartUI = (props: any) => {
|
|
|
186
217
|
handleClickCheckout={() => setOpenUpselling(true)}
|
|
187
218
|
checkoutButtonDisabled={(openUpselling && !canOpenUpselling) || subtotalWithTaxes < cart?.minimum || !cart?.valid_address}
|
|
188
219
|
isMultiCheckout={isMultiCheckout}
|
|
220
|
+
isFromUpselling={isFromUpselling}
|
|
189
221
|
>
|
|
190
222
|
{cart?.products?.length > 0 && cart?.products.map((product: any, i: number) => (
|
|
191
223
|
<ProductItemAccordion
|
|
192
224
|
key={`${product.code}_${i}`}
|
|
193
225
|
isCartPending={isCartPending}
|
|
194
226
|
isCartProduct
|
|
227
|
+
isDisabledEdit={!cart?.business_id}
|
|
195
228
|
product={product}
|
|
196
229
|
changeQuantity={changeQuantity}
|
|
197
230
|
getProductMax={getProductMax}
|
|
@@ -233,9 +266,9 @@ const CartUI = (props: any) => {
|
|
|
233
266
|
<TouchableOpacity style={{ marginLeft: 3 }} onPress={() => setOpenTaxModal({ open: true, data: offer, type: 'offer_target_1' })}>
|
|
234
267
|
<AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
|
|
235
268
|
</TouchableOpacity>
|
|
236
|
-
|
|
237
|
-
<
|
|
238
|
-
|
|
269
|
+
{!!offer?.id && (
|
|
270
|
+
<OfferAlert offerId={offer?.id} />
|
|
271
|
+
)}
|
|
239
272
|
</OSRow>
|
|
240
273
|
<OText size={12} lineHeight={18}>
|
|
241
274
|
- {parsePrice(offer?.summary?.discount)}
|
|
@@ -297,9 +330,9 @@ const CartUI = (props: any) => {
|
|
|
297
330
|
<TouchableOpacity style={{ marginLeft: 3 }} onPress={() => setOpenTaxModal({ open: true, data: offer, type: 'offer_target_3' })}>
|
|
298
331
|
<AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
|
|
299
332
|
</TouchableOpacity>
|
|
300
|
-
|
|
301
|
-
<
|
|
302
|
-
|
|
333
|
+
{!!offer?.id && (
|
|
334
|
+
<OfferAlert offerId={offer?.id} />
|
|
335
|
+
)}
|
|
303
336
|
</OSRow>
|
|
304
337
|
<OText size={12} lineHeight={18}>
|
|
305
338
|
- {parsePrice(offer?.summary?.discount)}
|
|
@@ -307,10 +340,10 @@ const CartUI = (props: any) => {
|
|
|
307
340
|
</OSTable>
|
|
308
341
|
))
|
|
309
342
|
}
|
|
310
|
-
{orderState?.options?.type === 1 && cart?.
|
|
343
|
+
{orderState?.options?.type === 1 && cart?.delivery_price_with_discount > 0 && !hideDeliveryFee && (
|
|
311
344
|
<OSTable>
|
|
312
345
|
<OText size={12} lineHeight={18}>{t('DELIVERY_FEE', 'Delivery Fee')}</OText>
|
|
313
|
-
<OText size={12} lineHeight={18}>{parsePrice(cart?.
|
|
346
|
+
<OText size={12} lineHeight={18}>{parsePrice(cart?.delivery_price_with_discount)}</OText>
|
|
314
347
|
</OSTable>
|
|
315
348
|
)}
|
|
316
349
|
{
|
|
@@ -324,9 +357,9 @@ const CartUI = (props: any) => {
|
|
|
324
357
|
<TouchableOpacity style={{ marginLeft: 3 }} onPress={() => setOpenTaxModal({ open: true, data: offer, type: 'offer_target_2' })}>
|
|
325
358
|
<AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
|
|
326
359
|
</TouchableOpacity>
|
|
327
|
-
|
|
328
|
-
<
|
|
329
|
-
|
|
360
|
+
{!!offer?.id && (
|
|
361
|
+
<OfferAlert offerId={offer?.id} />
|
|
362
|
+
)}
|
|
330
363
|
</OSRow>
|
|
331
364
|
<OText size={12} lineHeight={18}>
|
|
332
365
|
- {parsePrice(offer?.summary?.discount)}
|
|
@@ -334,7 +367,7 @@ const CartUI = (props: any) => {
|
|
|
334
367
|
</OSTable>
|
|
335
368
|
))
|
|
336
369
|
}
|
|
337
|
-
{cart?.driver_tip > 0 && (
|
|
370
|
+
{cart?.driver_tip > 0 && !hideDriverTip && (
|
|
338
371
|
<OSTable>
|
|
339
372
|
<OText size={12} lineHeight={18}>
|
|
340
373
|
{t('DRIVER_TIP', 'Driver tip')}
|
|
@@ -356,18 +389,19 @@ const CartUI = (props: any) => {
|
|
|
356
389
|
<OText size={12}>-{parsePrice(event.amount, { isTruncable: true })}</OText>
|
|
357
390
|
</OSTable>
|
|
358
391
|
))}
|
|
359
|
-
{isCouponEnabled && !isCartPending && (
|
|
392
|
+
{isCouponEnabled && !isCartPending && !hideCouponInput && (
|
|
360
393
|
<OSTable>
|
|
361
394
|
<OSCoupon>
|
|
362
395
|
<CouponControl
|
|
363
396
|
businessId={businessId}
|
|
364
397
|
price={cart.total}
|
|
398
|
+
cart={cart}
|
|
365
399
|
/>
|
|
366
400
|
</OSCoupon>
|
|
367
401
|
</OSTable>
|
|
368
402
|
)}
|
|
369
403
|
|
|
370
|
-
{isMultiCheckout &&
|
|
404
|
+
{!isMultiCheckout &&
|
|
371
405
|
cart &&
|
|
372
406
|
cart?.valid &&
|
|
373
407
|
orderState?.options?.type === 1 &&
|
|
@@ -382,13 +416,14 @@ const CartUI = (props: any) => {
|
|
|
382
416
|
<DriverTips
|
|
383
417
|
uuid={cart?.uuid}
|
|
384
418
|
businessId={cart?.business_id}
|
|
385
|
-
driverTipsOptions={driverTipsOptions}
|
|
386
|
-
isFixedPrice={parseInt(configs?.driver_tip_type?.value, 10) === 1
|
|
419
|
+
driverTipsOptions={!driverTipsOptions.includes(0) ? [0, ...driverTipsOptions] : driverTipsOptions}
|
|
420
|
+
isFixedPrice={parseInt(configs?.driver_tip_type?.value, 10) === 1}
|
|
387
421
|
isDriverTipUseCustom={!!parseInt(configs?.driver_tip_use_custom?.value, 10)}
|
|
388
|
-
driverTip={parseInt(configs?.driver_tip_type?.value, 10) === 1
|
|
422
|
+
driverTip={parseInt(configs?.driver_tip_type?.value, 10) === 1
|
|
389
423
|
? cart?.driver_tip
|
|
390
424
|
: cart?.driver_tip_rate}
|
|
391
425
|
useOrderContext
|
|
426
|
+
cart={cart}
|
|
392
427
|
/>
|
|
393
428
|
</DriverTipsContainer>
|
|
394
429
|
)}
|
|
@@ -522,14 +557,6 @@ const CartUI = (props: any) => {
|
|
|
522
557
|
setOpenPlaceModal={setOpenPlaceModal}
|
|
523
558
|
/>
|
|
524
559
|
</OModal>
|
|
525
|
-
<OAlert
|
|
526
|
-
open={confirm.open}
|
|
527
|
-
title={confirm.title}
|
|
528
|
-
content={confirm.content}
|
|
529
|
-
onAccept={confirm.handleOnAccept}
|
|
530
|
-
onCancel={() => setConfirm({ ...confirm, open: false, title: null })}
|
|
531
|
-
onClose={() => setConfirm({ ...confirm, open: false, title: null })}
|
|
532
|
-
/>
|
|
533
560
|
</CContainer>
|
|
534
561
|
)
|
|
535
562
|
}
|