@devtravelcode/widget-native 1.0.0
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/LICENSE +18 -0
- package/dist/App.d.ts +10 -0
- package/dist/App.js +192 -0
- package/dist/TravelHubWidget.d.ts +12 -0
- package/dist/TravelHubWidget.js +58 -0
- package/dist/components/ErrorBoundary.d.ts +18 -0
- package/dist/components/ErrorBoundary.js +63 -0
- package/dist/components/ui/Modal.d.ts +11 -0
- package/dist/components/ui/Modal.js +66 -0
- package/dist/components/ui/Skeleton.d.ts +8 -0
- package/dist/components/ui/Skeleton.js +33 -0
- package/dist/components/ui/badge.d.ts +11 -0
- package/dist/components/ui/badge.js +54 -0
- package/dist/components/ui/button.d.ts +14 -0
- package/dist/components/ui/button.js +101 -0
- package/dist/components/ui/card.d.ts +16 -0
- package/dist/components/ui/card.js +51 -0
- package/dist/components/ui/input.d.ts +8 -0
- package/dist/components/ui/input.js +61 -0
- package/dist/components/ui/label.d.ts +8 -0
- package/dist/components/ui/label.js +17 -0
- package/dist/context/WidgetContext.d.ts +29 -0
- package/dist/context/WidgetContext.js +64 -0
- package/dist/icons/CarIcon.d.ts +4 -0
- package/dist/icons/CarIcon.js +3 -0
- package/dist/icons/CloseIcon.d.ts +7 -0
- package/dist/icons/CloseIcon.js +3 -0
- package/dist/icons/FlightIcon.d.ts +4 -0
- package/dist/icons/FlightIcon.js +3 -0
- package/dist/icons/HotelIcon.d.ts +4 -0
- package/dist/icons/HotelIcon.js +3 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +3 -0
- package/dist/locales/widgetTranslations.d.ts +1 -0
- package/dist/locales/widgetTranslations.js +732 -0
- package/dist/modules/hooks/useAirportSearch.d.ts +21 -0
- package/dist/modules/hooks/useAirportSearch.js +48 -0
- package/dist/modules/hooks/useCarOffers.d.ts +7 -0
- package/dist/modules/hooks/useCarOffers.js +47 -0
- package/dist/modules/hooks/useCountriesByCodes.d.ts +4 -0
- package/dist/modules/hooks/useCountriesByCodes.js +60 -0
- package/dist/modules/hooks/useCountriesSearch.d.ts +11 -0
- package/dist/modules/hooks/useCountriesSearch.js +55 -0
- package/dist/modules/hooks/useDefaultHotelLocation.d.ts +7 -0
- package/dist/modules/hooks/useDefaultHotelLocation.js +44 -0
- package/dist/modules/hooks/useDetectNationality.d.ts +1 -0
- package/dist/modules/hooks/useDetectNationality.js +20 -0
- package/dist/modules/hooks/useFlightSearch.d.ts +20 -0
- package/dist/modules/hooks/useFlightSearch.js +243 -0
- package/dist/modules/hooks/useHotelDetails.d.ts +7 -0
- package/dist/modules/hooks/useHotelDetails.js +80 -0
- package/dist/modules/hooks/useHotelLocations.d.ts +5 -0
- package/dist/modules/hooks/useHotelLocations.js +42 -0
- package/dist/modules/hooks/useHotelMapData.d.ts +12 -0
- package/dist/modules/hooks/useHotelMapData.js +78 -0
- package/dist/modules/hooks/useHotelOffers.d.ts +11 -0
- package/dist/modules/hooks/useHotelOffers.js +122 -0
- package/dist/modules/hooks/useHotelSearchSSE.d.ts +18 -0
- package/dist/modules/hooks/useHotelSearchSSE.js +411 -0
- package/dist/modules/hooks/useSearchExpiration.d.ts +6 -0
- package/dist/modules/hooks/useSearchExpiration.js +35 -0
- package/dist/modules/hooks/useTranslationsHub.d.ts +5 -0
- package/dist/modules/hooks/useTranslationsHub.js +48 -0
- package/dist/modules/navbar/Navbar.d.ts +8 -0
- package/dist/modules/navbar/Navbar.js +69 -0
- package/dist/modules/search-form/AgeSelector.d.ts +9 -0
- package/dist/modules/search-form/AgeSelector.js +109 -0
- package/dist/modules/search-form/CustomSelect.d.ts +14 -0
- package/dist/modules/search-form/CustomSelect.js +94 -0
- package/dist/modules/search-form/FiltersSkeleton.d.ts +6 -0
- package/dist/modules/search-form/FiltersSkeleton.js +35 -0
- package/dist/modules/search-form/NationalityInput.d.ts +18 -0
- package/dist/modules/search-form/NationalityInput.js +172 -0
- package/dist/modules/search-form/Pagination.d.ts +8 -0
- package/dist/modules/search-form/Pagination.js +84 -0
- package/dist/modules/search-form/SearchExpiredPopup.d.ts +10 -0
- package/dist/modules/search-form/SearchExpiredPopup.js +91 -0
- package/dist/modules/search-form/SkeletonWidget.d.ts +2 -0
- package/dist/modules/search-form/SkeletonWidget.js +33 -0
- package/dist/modules/search-form/TimePicker.d.ts +9 -0
- package/dist/modules/search-form/TimePicker.js +182 -0
- package/dist/modules/search-form/cars/CarEmptyState.d.ts +6 -0
- package/dist/modules/search-form/cars/CarEmptyState.js +42 -0
- package/dist/modules/search-form/cars/CarFiltersSkeleton.d.ts +6 -0
- package/dist/modules/search-form/cars/CarFiltersSkeleton.js +35 -0
- package/dist/modules/search-form/cars/CarOffersList.d.ts +43 -0
- package/dist/modules/search-form/cars/CarOffersList.js +214 -0
- package/dist/modules/search-form/cars/CarResults.d.ts +25 -0
- package/dist/modules/search-form/cars/CarResults.js +116 -0
- package/dist/modules/search-form/cars/CarSearchForm.d.ts +19 -0
- package/dist/modules/search-form/cars/CarSearchForm.js +173 -0
- package/dist/modules/search-form/cars/CarSkeleton.d.ts +6 -0
- package/dist/modules/search-form/cars/CarSkeleton.js +46 -0
- package/dist/modules/search-form/cars/CarTopOffersSlider.d.ts +20 -0
- package/dist/modules/search-form/cars/CarTopOffersSlider.js +100 -0
- package/dist/modules/search-form/cars/car-filters/CarFilters.d.ts +8 -0
- package/dist/modules/search-form/cars/car-filters/CarFilters.js +318 -0
- package/dist/modules/search-form/cars/car-filters/FilterSection.d.ts +9 -0
- package/dist/modules/search-form/cars/car-filters/FilterSection.js +30 -0
- package/dist/modules/search-form/cars/car-filters/index.d.ts +6 -0
- package/dist/modules/search-form/cars/car-filters/index.js +3 -0
- package/dist/modules/search-form/cars/car-filters/useCarFilters.d.ts +24 -0
- package/dist/modules/search-form/cars/car-filters/useCarFilters.js +121 -0
- package/dist/modules/search-form/flight/AirlinesSelector.d.ts +8 -0
- package/dist/modules/search-form/flight/AirlinesSelector.js +235 -0
- package/dist/modules/search-form/flight/CabinClassSelector.d.ts +9 -0
- package/dist/modules/search-form/flight/CabinClassSelector.js +63 -0
- package/dist/modules/search-form/flight/DatePicker.d.ts +12 -0
- package/dist/modules/search-form/flight/DatePicker.js +536 -0
- package/dist/modules/search-form/flight/FlightSearchForm.d.ts +18 -0
- package/dist/modules/search-form/flight/FlightSearchForm.js +147 -0
- package/dist/modules/search-form/flight/LocationInput.d.ts +11 -0
- package/dist/modules/search-form/flight/LocationInput.js +294 -0
- package/dist/modules/search-form/flight/PassengersPicker.d.ts +16 -0
- package/dist/modules/search-form/flight/PassengersPicker.js +203 -0
- package/dist/modules/search-form/flight/SwitchLocationBtn.d.ts +9 -0
- package/dist/modules/search-form/flight/SwitchLocationBtn.js +48 -0
- package/dist/modules/search-form/flight/flight-filters/FiltersContent.d.ts +21 -0
- package/dist/modules/search-form/flight/flight-filters/FiltersContent.js +145 -0
- package/dist/modules/search-form/flight/flight-filters/FlightFiltersDynamic.d.ts +11 -0
- package/dist/modules/search-form/flight/flight-filters/FlightFiltersDynamic.js +213 -0
- package/dist/modules/search-form/flight/flight-filters/RangeBlock.d.ts +22 -0
- package/dist/modules/search-form/flight/flight-filters/RangeBlock.js +164 -0
- package/dist/modules/search-form/flight/flight-filters/index.d.ts +1 -0
- package/dist/modules/search-form/flight/flight-filters/index.js +1 -0
- package/dist/modules/search-form/flight/flight-results/FlightAdditionalInfo.d.ts +16 -0
- package/dist/modules/search-form/flight/flight-results/FlightAdditionalInfo.js +229 -0
- package/dist/modules/search-form/flight/flight-results/FlightBaggageToggle.d.ts +15 -0
- package/dist/modules/search-form/flight/flight-results/FlightBaggageToggle.js +110 -0
- package/dist/modules/search-form/flight/flight-results/FlightCard.d.ts +14 -0
- package/dist/modules/search-form/flight/flight-results/FlightCard.js +436 -0
- package/dist/modules/search-form/flight/flight-results/FlightInfo.d.ts +12 -0
- package/dist/modules/search-form/flight/flight-results/FlightInfo.js +48 -0
- package/dist/modules/search-form/flight/flight-results/FlightPriceBlock.d.ts +11 -0
- package/dist/modules/search-form/flight/flight-results/FlightPriceBlock.js +36 -0
- package/dist/modules/search-form/flight/flight-results/FlightResults.d.ts +22 -0
- package/dist/modules/search-form/flight/flight-results/FlightResults.js +109 -0
- package/dist/modules/search-form/flight/flight-results/FlightSegments.d.ts +40 -0
- package/dist/modules/search-form/flight/flight-results/FlightSegments.js +162 -0
- package/dist/modules/search-form/flight/flight-results/FlightsSkeleton.d.ts +6 -0
- package/dist/modules/search-form/flight/flight-results/FlightsSkeleton.js +52 -0
- package/dist/modules/search-form/flight/flight-results/ProvidersLoader.d.ts +9 -0
- package/dist/modules/search-form/flight/flight-results/ProvidersLoader.js +242 -0
- package/dist/modules/search-form/hotel/DatePicker.d.ts +1 -0
- package/dist/modules/search-form/hotel/DatePicker.js +1 -0
- package/dist/modules/search-form/hotel/GuestSelector.d.ts +13 -0
- package/dist/modules/search-form/hotel/GuestSelector.js +272 -0
- package/dist/modules/search-form/hotel/GuestSelectorMobilePopup.d.ts +2 -0
- package/dist/modules/search-form/hotel/GuestSelectorMobilePopup.js +1 -0
- package/dist/modules/search-form/hotel/HotelLocation.d.ts +17 -0
- package/dist/modules/search-form/hotel/HotelLocation.js +178 -0
- package/dist/modules/search-form/hotel/HotelLocationMobilePopup.d.ts +2 -0
- package/dist/modules/search-form/hotel/HotelLocationMobilePopup.js +1 -0
- package/dist/modules/search-form/hotel/HotelResults.d.ts +21 -0
- package/dist/modules/search-form/hotel/HotelResults.js +333 -0
- package/dist/modules/search-form/hotel/HotelSearchForm.d.ts +13 -0
- package/dist/modules/search-form/hotel/HotelSearchForm.js +130 -0
- package/dist/modules/search-form/hotel/HotelsSkeleton.d.ts +6 -0
- package/dist/modules/search-form/hotel/HotelsSkeleton.js +40 -0
- package/dist/modules/search-form/hotel/PassengersPicker.d.ts +2 -0
- package/dist/modules/search-form/hotel/PassengersPicker.js +1 -0
- package/dist/modules/search-form/hotel/components/HotelCard.d.ts +11 -0
- package/dist/modules/search-form/hotel/components/HotelCard.js +180 -0
- package/dist/modules/search-form/hotel/components/HotelEmptyState.d.ts +6 -0
- package/dist/modules/search-form/hotel/components/HotelEmptyState.js +34 -0
- package/dist/modules/search-form/hotel/components/HotelGallery.d.ts +6 -0
- package/dist/modules/search-form/hotel/components/HotelGallery.js +77 -0
- package/dist/modules/search-form/hotel/components/HotelList.d.ts +9 -0
- package/dist/modules/search-form/hotel/components/HotelList.js +12 -0
- package/dist/modules/search-form/hotel/components/HotelMap.d.ts +26 -0
- package/dist/modules/search-form/hotel/components/HotelMap.js +707 -0
- package/dist/modules/search-form/hotel/components/HotelPin.d.ts +7 -0
- package/dist/modules/search-form/hotel/components/HotelPin.js +1 -0
- package/dist/modules/search-form/hotel/hotel-filters/HotelFilters.d.ts +29 -0
- package/dist/modules/search-form/hotel/hotel-filters/HotelFilters.js +339 -0
- package/dist/modules/search-form/hotel/hotel-filters/HotelFiltersBar.d.ts +3 -0
- package/dist/modules/search-form/hotel/hotel-filters/HotelFiltersBar.js +2 -0
- package/dist/modules/search-form/hotel/hotel-filters/HotelFiltersContent.d.ts +2 -0
- package/dist/modules/search-form/hotel/hotel-filters/HotelFiltersContent.js +1 -0
- package/dist/modules/search-form/hotel/hotel-filters/HotelFiltersDynamic.d.ts +2 -0
- package/dist/modules/search-form/hotel/hotel-filters/HotelFiltersDynamic.js +1 -0
- package/dist/modules/search-form/hotel/hotel-filters/HotelFiltersMobilePopup.d.ts +2 -0
- package/dist/modules/search-form/hotel/hotel-filters/HotelFiltersMobilePopup.js +1 -0
- package/dist/modules/search-form/hotel/hotel-filters/RangeBlock.d.ts +1 -0
- package/dist/modules/search-form/hotel/hotel-filters/RangeBlock.js +1 -0
- package/dist/modules/search-form/hotel/hotel-filters/index.d.ts +1 -0
- package/dist/modules/search-form/hotel/hotel-filters/index.js +1 -0
- package/dist/modules/tabs/FlightsTab.d.ts +1 -0
- package/dist/modules/tabs/FlightsTab.js +1 -0
- package/dist/modules/tabs/HotelsTab.d.ts +1 -0
- package/dist/modules/tabs/HotelsTab.js +1 -0
- package/dist/store/index.d.ts +22 -0
- package/dist/store/index.js +19 -0
- package/dist/theme/colors.d.ts +56 -0
- package/dist/theme/colors.js +56 -0
- package/dist/theme/formStyles.d.ts +76 -0
- package/dist/theme/formStyles.js +78 -0
- package/dist/utils/applyWidgetColors.d.ts +1 -0
- package/dist/utils/applyWidgetColors.js +2 -0
- package/dist/utils/dateTime.d.ts +2 -0
- package/dist/utils/dateTime.js +23 -0
- package/dist/utils/fetchSSE.d.ts +23 -0
- package/dist/utils/fetchSSE.js +104 -0
- package/dist/utils/getToken.d.ts +3 -0
- package/dist/utils/getToken.js +12 -0
- package/package.json +64 -0
|
@@ -0,0 +1,707 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { useEffect, useState, useRef, useCallback, } from 'react';
|
|
3
|
+
import { View, Text, TouchableOpacity, StyleSheet, Dimensions, Modal, ActivityIndicator, Animated, PanResponder, Image, FlatList, Linking, } from 'react-native';
|
|
4
|
+
import ClusteredMapView from 'react-native-map-clustering';
|
|
5
|
+
import { Marker, PROVIDER_GOOGLE } from 'react-native-maps';
|
|
6
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
7
|
+
import { useHotelDetails } from '../../../hooks/useHotelDetails';
|
|
8
|
+
import { useWidget } from '../../../../context/WidgetContext';
|
|
9
|
+
import { useApiToken } from '../../../../utils/getToken';
|
|
10
|
+
import { Colors, Spacing, BorderRadius, FontSize } from '../../../../theme/colors';
|
|
11
|
+
export function pinsFromOffers(hotels, currency) {
|
|
12
|
+
return hotels
|
|
13
|
+
.filter((h) => {
|
|
14
|
+
const lat = parseFloat(h.latitude);
|
|
15
|
+
const lng = parseFloat(h.longitude);
|
|
16
|
+
return lat && lng && lat !== 0 && lng !== 0;
|
|
17
|
+
})
|
|
18
|
+
.map((h) => ({
|
|
19
|
+
id: h.id || h.propertyId,
|
|
20
|
+
hotelId: h.id || h.propertyId,
|
|
21
|
+
lat: parseFloat(h.latitude),
|
|
22
|
+
lng: parseFloat(h.longitude),
|
|
23
|
+
price: h.nightlyPrice || h.price || h.totalPrice || h.total || 0,
|
|
24
|
+
currency,
|
|
25
|
+
name: h.hotelNames?.mainName || h.name || h.hotelName || '',
|
|
26
|
+
soldOut: h.soldOut || false,
|
|
27
|
+
}));
|
|
28
|
+
}
|
|
29
|
+
const { width: SCREEN_WIDTH } = Dimensions.get('window');
|
|
30
|
+
const DEFAULT_REGION = {
|
|
31
|
+
latitude: 40.4168,
|
|
32
|
+
longitude: -3.7038,
|
|
33
|
+
latitudeDelta: 10,
|
|
34
|
+
longitudeDelta: 10,
|
|
35
|
+
};
|
|
36
|
+
const CURRENCY_SIGNS = {
|
|
37
|
+
USD: '$',
|
|
38
|
+
EUR: '\u20AC',
|
|
39
|
+
GBP: '\u00A3',
|
|
40
|
+
CHF: '\u20A3',
|
|
41
|
+
};
|
|
42
|
+
const BOTTOM_CARD_HEIGHT = 220;
|
|
43
|
+
const MIN_CLOSE_DRAG = 80;
|
|
44
|
+
function getCurrencySign(currency) {
|
|
45
|
+
return CURRENCY_SIGNS[currency] || currency;
|
|
46
|
+
}
|
|
47
|
+
function formatPrice(price) {
|
|
48
|
+
if (price >= 1000) {
|
|
49
|
+
return `${Math.round(price / 100) / 10}k`;
|
|
50
|
+
}
|
|
51
|
+
return String(Math.round(price));
|
|
52
|
+
}
|
|
53
|
+
const PriceBadge = React.memo(({ price, currency, selected, soldOut, loading, viewed, error }) => {
|
|
54
|
+
const sign = getCurrencySign(currency);
|
|
55
|
+
if (loading) {
|
|
56
|
+
return (_jsx(View, { style: [styles.priceBadge, styles.priceBadgeSelected], children: _jsx(ActivityIndicator, { size: 12, color: Colors.white }) }));
|
|
57
|
+
}
|
|
58
|
+
if (error) {
|
|
59
|
+
return (_jsx(View, { style: [styles.priceBadge, styles.priceBadgeError], children: _jsx(Text, { style: styles.priceBadgeErrorText, children: "Error" }) }));
|
|
60
|
+
}
|
|
61
|
+
if (soldOut) {
|
|
62
|
+
return (_jsx(View, { style: [styles.priceBadge, styles.priceBadgeSoldOut], children: _jsx(Text, { style: styles.priceBadgeSoldOutText, children: "Sold Out" }) }));
|
|
63
|
+
}
|
|
64
|
+
return (_jsx(View, { style: [
|
|
65
|
+
styles.priceBadge,
|
|
66
|
+
selected && styles.priceBadgeSelected,
|
|
67
|
+
!selected && viewed && styles.priceBadgeViewed,
|
|
68
|
+
], children: _jsxs(Text, { style: [
|
|
69
|
+
styles.priceBadgeText,
|
|
70
|
+
selected && styles.priceBadgeTextSelected,
|
|
71
|
+
!selected && viewed && styles.priceBadgeTextViewed,
|
|
72
|
+
], children: [sign, formatPrice(price)] }) }));
|
|
73
|
+
});
|
|
74
|
+
const GALLERY_WIDTH = SCREEN_WIDTH - Spacing.lg * 2;
|
|
75
|
+
const GALLERY_HEIGHT = 180;
|
|
76
|
+
const CardGallery = React.memo(({ images }) => {
|
|
77
|
+
const [activeIndex, setActiveIndex] = useState(0);
|
|
78
|
+
if (!images?.length) {
|
|
79
|
+
return (_jsx(View, { style: [styles.galleryImage, styles.bottomCardImagePlaceholder], children: _jsx(Text, { style: styles.placeholderText, children: "No Photo" }) }));
|
|
80
|
+
}
|
|
81
|
+
return (_jsxs(View, { children: [_jsx(FlatList, { data: images.slice(0, 5), horizontal: true, pagingEnabled: true, showsHorizontalScrollIndicator: false, keyExtractor: (_, i) => String(i), onMomentumScrollEnd: (e) => {
|
|
82
|
+
const idx = Math.round(e.nativeEvent.contentOffset.x / GALLERY_WIDTH);
|
|
83
|
+
setActiveIndex(idx);
|
|
84
|
+
}, renderItem: ({ item }) => (_jsx(Image, { source: { uri: item }, style: styles.galleryImage, resizeMode: "cover" })) }), images.length > 1 && (_jsx(View, { style: styles.galleryDots, children: images.slice(0, 5).map((_, i) => (_jsx(View, { style: [styles.galleryDot, i === activeIndex && styles.galleryDotActive] }, i))) }))] }));
|
|
85
|
+
});
|
|
86
|
+
const HotelDetailCard = React.memo(({ hotelData, pin, translations, lang, token, basketLink, onClose, slideAnim }) => {
|
|
87
|
+
const sign = getCurrencySign(pin.currency);
|
|
88
|
+
const nightlyPrice = hotelData?.nightlyPrice || hotelData?.price;
|
|
89
|
+
const totalPrice = hotelData?.totalPrice || hotelData?.total;
|
|
90
|
+
const handleViewDetails = useCallback(() => {
|
|
91
|
+
const HOST = basketLink || 'https://travel-code.com';
|
|
92
|
+
const url = `${HOST}${hotelData?.url || '#'}&accessToken=${token}&language=${lang}`;
|
|
93
|
+
Linking.openURL(url).catch(() => { });
|
|
94
|
+
}, [hotelData, token, lang, basketLink]);
|
|
95
|
+
const panResponder = useRef(PanResponder.create({
|
|
96
|
+
onStartShouldSetPanResponder: () => false,
|
|
97
|
+
onMoveShouldSetPanResponder: (_, g) => g.dy > 10,
|
|
98
|
+
onPanResponderMove: (_, g) => {
|
|
99
|
+
if (g.dy > 0)
|
|
100
|
+
slideAnim.setValue(g.dy);
|
|
101
|
+
},
|
|
102
|
+
onPanResponderRelease: (_, g) => {
|
|
103
|
+
if (g.dy > MIN_CLOSE_DRAG) {
|
|
104
|
+
onClose();
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
Animated.spring(slideAnim, {
|
|
108
|
+
toValue: 0,
|
|
109
|
+
useNativeDriver: true,
|
|
110
|
+
tension: 65,
|
|
111
|
+
friction: 11,
|
|
112
|
+
}).start();
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
})).current;
|
|
116
|
+
return (_jsxs(Animated.View, { style: [
|
|
117
|
+
styles.bottomCard,
|
|
118
|
+
{ transform: [{ translateY: slideAnim }] },
|
|
119
|
+
], ...panResponder.panHandlers, children: [_jsx(View, { style: styles.bottomCardHandle }), _jsx(CardGallery, { images: hotelData?.heroImages || [] }), _jsxs(View, { style: styles.bottomCardInfo, children: [_jsx(Text, { style: styles.bottomCardName, numberOfLines: 2, children: hotelData?.hotelNames?.mainName || hotelData?.propertyName || pin.name || 'Hotel' }), hotelData?.meal ? (_jsx(Text, { style: styles.bottomCardMeal, numberOfLines: 1, children: hotelData.meal })) : null, hotelData?.refundable != null && (_jsx(Text, { style: [
|
|
120
|
+
styles.bottomCardRefund,
|
|
121
|
+
!hotelData.refundable && styles.bottomCardRefundGray,
|
|
122
|
+
], numberOfLines: 1, children: hotelData.refundable
|
|
123
|
+
? translations['hotels_refundable'] || 'Free cancellation'
|
|
124
|
+
: translations['hotels_non_refundable'] || 'Non refundable' })), nightlyPrice ? (_jsxs(Text, { style: styles.bottomCardPriceInfo, children: [translations['hotels_price_per_night_label'] || 'Price per night', " ", sign, nightlyPrice.toFixed?.(2) || nightlyPrice] })) : null, totalPrice ? (_jsxs(Text, { style: styles.bottomCardPriceInfo, children: [translations['hotels_total_for_stay'] || 'Total for stay', " ", sign, totalPrice.toFixed?.(2) || totalPrice] })) : null, _jsxs(View, { style: styles.bottomCardPriceRow, children: [_jsxs(Text, { style: styles.bottomCardPrice, children: [translations['hotels_per_night'] || 'per night', " ", sign, nightlyPrice ? (nightlyPrice.toFixed?.(2) || nightlyPrice) : pin.price] }), _jsx(TouchableOpacity, { style: styles.viewDetailsBtn, onPress: handleViewDetails, children: _jsx(Text, { style: styles.viewDetailsArrow, children: '\u2192' }) })] })] })] }));
|
|
125
|
+
});
|
|
126
|
+
const ErrorCard = React.memo(({ translations, onClose, onRefresh, slideAnim }) => (_jsxs(Animated.View, { style: [
|
|
127
|
+
styles.bottomCard,
|
|
128
|
+
{ transform: [{ translateY: slideAnim }] },
|
|
129
|
+
], children: [_jsx(View, { style: styles.bottomCardHandle }), _jsx(TouchableOpacity, { style: styles.bottomCardClose, onPress: onClose, children: _jsx(Text, { style: styles.bottomCardCloseText, children: '\u00D7' }) }), _jsxs(View, { style: styles.errorCardContent, children: [_jsx(Text, { style: styles.errorCardText, children: translations['map_search_expired'] || 'Your search may have expired. Please refresh to see current prices.' }), onRefresh && (_jsx(TouchableOpacity, { style: styles.errorCardBtn, onPress: onRefresh, activeOpacity: 0.8, children: _jsx(Text, { style: styles.errorCardBtnText, children: translations['map_refresh'] || 'Refresh search' }) }))] })] })));
|
|
130
|
+
const HotelMap = ({ pins, allHotels = [], streamCompleted = false, loading = false, selectedHotelId: externalSelectedId, onHotelSelect, onRefreshSearch, translations, lang, searchParams, }) => {
|
|
131
|
+
const token = useApiToken();
|
|
132
|
+
const { config, currency } = useWidget();
|
|
133
|
+
const insets = useSafeAreaInsets();
|
|
134
|
+
const mapRef = useRef(null);
|
|
135
|
+
const [region, setRegion] = useState(DEFAULT_REGION);
|
|
136
|
+
const [selectedPin, setSelectedPin] = useState(null);
|
|
137
|
+
const [loadingPinId, setLoadingPinId] = useState(null);
|
|
138
|
+
const [errorPinId, setErrorPinId] = useState(null);
|
|
139
|
+
const [viewedPins, setViewedPins] = useState(new Set());
|
|
140
|
+
const [isFullscreen, setIsFullscreen] = useState(false);
|
|
141
|
+
const slideAnim = useRef(new Animated.Value(BOTTOM_CARD_HEIGHT + 40)).current;
|
|
142
|
+
const { hotelData: fetchedHotelData, loading: detailsLoading, fetchHotelDetails, } = useHotelDetails(searchParams || undefined);
|
|
143
|
+
const [localHotelData, setLocalHotelData] = useState(null);
|
|
144
|
+
const hotelData = localHotelData || fetchedHotelData;
|
|
145
|
+
const didFitRef = useRef(false);
|
|
146
|
+
useEffect(() => {
|
|
147
|
+
if (!pins.length || !mapRef.current)
|
|
148
|
+
return;
|
|
149
|
+
const coords = pins.map((p) => ({
|
|
150
|
+
latitude: p.lat,
|
|
151
|
+
longitude: p.lng,
|
|
152
|
+
}));
|
|
153
|
+
const timer = setTimeout(() => {
|
|
154
|
+
mapRef.current?.fitToCoordinates(coords, {
|
|
155
|
+
edgePadding: { top: 60, right: 60, bottom: 80, left: 60 },
|
|
156
|
+
animated: didFitRef.current,
|
|
157
|
+
});
|
|
158
|
+
didFitRef.current = true;
|
|
159
|
+
}, 300);
|
|
160
|
+
return () => clearTimeout(timer);
|
|
161
|
+
}, [pins]);
|
|
162
|
+
useEffect(() => {
|
|
163
|
+
if (externalSelectedId == null) {
|
|
164
|
+
closeBottomCard();
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
const pin = pins.find((p) => p.hotelId === externalSelectedId);
|
|
168
|
+
if (pin) {
|
|
169
|
+
handlePinPress(pin);
|
|
170
|
+
}
|
|
171
|
+
}, [externalSelectedId]);
|
|
172
|
+
const animateCardIn = useCallback(() => {
|
|
173
|
+
Animated.spring(slideAnim, {
|
|
174
|
+
toValue: 0,
|
|
175
|
+
useNativeDriver: true,
|
|
176
|
+
tension: 65,
|
|
177
|
+
friction: 11,
|
|
178
|
+
}).start();
|
|
179
|
+
}, [slideAnim]);
|
|
180
|
+
const closeBottomCard = useCallback(() => {
|
|
181
|
+
console.log('[HotelMap] closeBottomCard called, selectedPin:', selectedPin?.id);
|
|
182
|
+
Animated.timing(slideAnim, {
|
|
183
|
+
toValue: BOTTOM_CARD_HEIGHT + 40,
|
|
184
|
+
duration: 200,
|
|
185
|
+
useNativeDriver: true,
|
|
186
|
+
}).start(() => {
|
|
187
|
+
console.log('[HotelMap] closeBottomCard animation done, clearing selectedPin');
|
|
188
|
+
setSelectedPin(null);
|
|
189
|
+
setLoadingPinId(null);
|
|
190
|
+
setErrorPinId(null);
|
|
191
|
+
setLocalHotelData(null);
|
|
192
|
+
});
|
|
193
|
+
}, [slideAnim, selectedPin]);
|
|
194
|
+
const handlePinPress = useCallback(async (pin) => {
|
|
195
|
+
pinPressedRef.current = true;
|
|
196
|
+
console.log('[HotelMap] handlePinPress pin:', pin.id, 'hotelId:', pin.hotelId, 'currentSelected:', selectedPin?.id);
|
|
197
|
+
if (pin.soldOut)
|
|
198
|
+
return;
|
|
199
|
+
if (selectedPin?.id === pin.id) {
|
|
200
|
+
console.log('[HotelMap] same pin tapped, closing');
|
|
201
|
+
closeBottomCard();
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
mapRef.current?.animateToRegion({
|
|
205
|
+
latitude: pin.lat - region.latitudeDelta * 0.1,
|
|
206
|
+
longitude: pin.lng,
|
|
207
|
+
latitudeDelta: Math.min(region.latitudeDelta, 0.5),
|
|
208
|
+
longitudeDelta: Math.min(region.longitudeDelta, 0.5),
|
|
209
|
+
}, 400);
|
|
210
|
+
setErrorPinId(null);
|
|
211
|
+
setLoadingPinId(pin.id);
|
|
212
|
+
setSelectedPin(pin);
|
|
213
|
+
setLocalHotelData(null);
|
|
214
|
+
animateCardIn();
|
|
215
|
+
const streamHotel = allHotels.find((h) => (h.id || h.propertyId) === pin.hotelId);
|
|
216
|
+
if (streamHotel) {
|
|
217
|
+
console.log('[HotelMap] using stream data for', pin.hotelId);
|
|
218
|
+
setLocalHotelData(streamHotel);
|
|
219
|
+
setLoadingPinId(null);
|
|
220
|
+
setViewedPins((prev) => new Set(prev).add(pin.id));
|
|
221
|
+
onHotelSelect?.(pin.hotelId);
|
|
222
|
+
if (streamCompleted) {
|
|
223
|
+
fetchHotelDetails(pin.hotelId).then((result) => {
|
|
224
|
+
if (result)
|
|
225
|
+
setLocalHotelData(result);
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
else if (streamCompleted) {
|
|
230
|
+
console.log('[HotelMap] stream complete, fetching /list for', pin.hotelId);
|
|
231
|
+
const result = await fetchHotelDetails(pin.hotelId);
|
|
232
|
+
setLoadingPinId(null);
|
|
233
|
+
if (!result) {
|
|
234
|
+
setErrorPinId(pin.id);
|
|
235
|
+
}
|
|
236
|
+
else {
|
|
237
|
+
setLocalHotelData(result);
|
|
238
|
+
setViewedPins((prev) => new Set(prev).add(pin.id));
|
|
239
|
+
onHotelSelect?.(pin.hotelId);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
else {
|
|
243
|
+
console.log('[HotelMap] stream in progress, no data yet for', pin.hotelId);
|
|
244
|
+
setLoadingPinId(null);
|
|
245
|
+
setViewedPins((prev) => new Set(prev).add(pin.id));
|
|
246
|
+
}
|
|
247
|
+
}, [
|
|
248
|
+
selectedPin,
|
|
249
|
+
region,
|
|
250
|
+
allHotels,
|
|
251
|
+
streamCompleted,
|
|
252
|
+
fetchHotelDetails,
|
|
253
|
+
onHotelSelect,
|
|
254
|
+
animateCardIn,
|
|
255
|
+
closeBottomCard,
|
|
256
|
+
]);
|
|
257
|
+
const pinPressedRef = useRef(false);
|
|
258
|
+
const handleMapPress = useCallback(() => {
|
|
259
|
+
console.log('[HotelMap] handleMapPress, pinPressedRef:', pinPressedRef.current, 'selectedPin:', selectedPin?.id);
|
|
260
|
+
if (pinPressedRef.current) {
|
|
261
|
+
pinPressedRef.current = false;
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
if (selectedPin) {
|
|
265
|
+
closeBottomCard();
|
|
266
|
+
}
|
|
267
|
+
}, [selectedPin, closeBottomCard]);
|
|
268
|
+
const handleRegionChange = useCallback((newRegion) => {
|
|
269
|
+
console.log(`[HotelMap] regionChange: latDelta=${newRegion.latitudeDelta.toFixed(4)} lat=${newRegion.latitude.toFixed(4)} lng=${newRegion.longitude.toFixed(4)}`);
|
|
270
|
+
setRegion(newRegion);
|
|
271
|
+
}, []);
|
|
272
|
+
const handleZoomIn = useCallback(() => {
|
|
273
|
+
if (!mapRef.current)
|
|
274
|
+
return;
|
|
275
|
+
const newRegion = {
|
|
276
|
+
...region,
|
|
277
|
+
latitudeDelta: region.latitudeDelta / 2,
|
|
278
|
+
longitudeDelta: region.longitudeDelta / 2,
|
|
279
|
+
};
|
|
280
|
+
mapRef.current.animateToRegion(newRegion, 300);
|
|
281
|
+
}, [region]);
|
|
282
|
+
const handleZoomOut = useCallback(() => {
|
|
283
|
+
if (!mapRef.current)
|
|
284
|
+
return;
|
|
285
|
+
const newRegion = {
|
|
286
|
+
...region,
|
|
287
|
+
latitudeDelta: Math.min(region.latitudeDelta * 2, 120),
|
|
288
|
+
longitudeDelta: Math.min(region.longitudeDelta * 2, 120),
|
|
289
|
+
};
|
|
290
|
+
mapRef.current.animateToRegion(newRegion, 300);
|
|
291
|
+
}, [region]);
|
|
292
|
+
const hotelsLabel = translations['map_hotels'] || 'hotels';
|
|
293
|
+
const renderCluster = useCallback((cluster) => {
|
|
294
|
+
const { id, geometry, onPress, properties } = cluster;
|
|
295
|
+
const count = properties?.point_count || 0;
|
|
296
|
+
return (_jsx(Marker, { coordinate: {
|
|
297
|
+
latitude: geometry.coordinates[1],
|
|
298
|
+
longitude: geometry.coordinates[0],
|
|
299
|
+
}, onPress: onPress, tracksViewChanges: true, children: _jsx(View, { style: styles.clusterBubble, children: _jsxs(Text, { style: styles.clusterBubbleText, children: [count, " ", hotelsLabel] }) }) }, `cluster-${id}`));
|
|
300
|
+
}, [hotelsLabel]);
|
|
301
|
+
const renderMarkers = useCallback(() => pins.map((pin) => {
|
|
302
|
+
const isSelected = selectedPin?.id === pin.id;
|
|
303
|
+
const isLoading = loadingPinId === pin.id;
|
|
304
|
+
const isError = errorPinId === pin.id;
|
|
305
|
+
const isViewed = viewedPins.has(pin.id);
|
|
306
|
+
return (_jsx(Marker, { coordinate: { latitude: pin.lat, longitude: pin.lng }, onPress: () => handlePinPress(pin), tracksViewChanges: true, zIndex: isSelected ? 1000 : 1, children: _jsx(PriceBadge, { price: pin.price, currency: pin.currency, selected: isSelected, soldOut: pin.soldOut, loading: isLoading, viewed: isViewed, error: isError }) }, `pin-${pin.id}`));
|
|
307
|
+
}), [pins, selectedPin, loadingPinId, errorPinId, viewedPins, handlePinPress]);
|
|
308
|
+
if (loading && pins.length === 0) {
|
|
309
|
+
return (_jsxs(View, { style: styles.loaderContainer, children: [_jsx(ActivityIndicator, { size: "large", color: Colors.primary }), _jsx(Text, { style: styles.loaderText, children: translations['map_loader'] || 'Loading map...' })] }));
|
|
310
|
+
}
|
|
311
|
+
return (_jsxs(View, { style: styles.container, children: [_jsx(ClusteredMapView, { provider: PROVIDER_GOOGLE, ref: mapRef, style: styles.map, initialRegion: DEFAULT_REGION, onRegionChangeComplete: handleRegionChange, onPress: handleMapPress, showsUserLocation: false, showsPointsOfInterest: false, showsBuildings: false, mapPadding: { top: 0, right: 0, bottom: 0, left: 0 }, clusterColor: Colors.primary, clusterTextColor: Colors.white, clusterFontFamily: undefined, renderCluster: renderCluster, radius: 60, maxZoom: 16, minPoints: 2, animationEnabled: false, children: renderMarkers() }), loading && pins.length > 0 && (_jsx(View, { style: styles.loadingOverlay, children: _jsx(ActivityIndicator, { size: "small", color: Colors.primary }) })), _jsxs(View, { style: styles.zoomControls, children: [_jsx(TouchableOpacity, { style: styles.zoomBtn, onPress: handleZoomIn, activeOpacity: 0.7, children: _jsx(Text, { style: styles.zoomBtnText, children: "+" }) }), _jsx(View, { style: styles.zoomDivider }), _jsx(TouchableOpacity, { style: styles.zoomBtn, onPress: handleZoomOut, activeOpacity: 0.7, children: _jsx(Text, { style: styles.zoomBtnText, children: '\u2212' }) })] }), selectedPin && errorPinId && (_jsx(ErrorCard, { translations: translations, onClose: closeBottomCard, onRefresh: onRefreshSearch, slideAnim: slideAnim })), selectedPin && !errorPinId && (detailsLoading || hotelData) && (_jsx(HotelDetailCard, { hotelData: hotelData, pin: selectedPin, translations: translations, lang: lang, token: token, basketLink: config?.additional?.basket_link?.trim() || '', onClose: closeBottomCard, slideAnim: slideAnim })), _jsx(Modal, { visible: isFullscreen, animationType: "slide", presentationStyle: "fullScreen", onRequestClose: () => setIsFullscreen(false), children: _jsxs(View, { style: styles.fullscreenContainer, children: [_jsx(TouchableOpacity, { style: [styles.fullscreenCloseBtn, { top: insets.top + Spacing.sm }], onPress: () => setIsFullscreen(false), activeOpacity: 0.7, children: _jsx(Text, { style: styles.fullscreenCloseBtnText, children: '\u00D7' }) }), _jsx(ClusteredMapView, { provider: PROVIDER_GOOGLE, ref: mapRef, style: styles.map, initialRegion: region, onRegionChangeComplete: handleRegionChange, onPress: handleMapPress, showsUserLocation: false, showsPointsOfInterest: false, showsBuildings: false, clusterColor: Colors.primary, clusterTextColor: Colors.white, renderCluster: renderCluster, radius: 60, maxZoom: 16, minPoints: 2, animationEnabled: false, children: renderMarkers() }), _jsxs(View, { style: [styles.zoomControls, styles.zoomControlsFullscreen], children: [_jsx(TouchableOpacity, { style: styles.zoomBtn, onPress: handleZoomIn, activeOpacity: 0.7, children: _jsx(Text, { style: styles.zoomBtnText, children: "+" }) }), _jsx(View, { style: styles.zoomDivider }), _jsx(TouchableOpacity, { style: styles.zoomBtn, onPress: handleZoomOut, activeOpacity: 0.7, children: _jsx(Text, { style: styles.zoomBtnText, children: '\u2212' }) })] }), selectedPin && errorPinId && (_jsx(ErrorCard, { translations: translations, onClose: closeBottomCard, onRefresh: onRefreshSearch, slideAnim: slideAnim })), selectedPin && !errorPinId && (detailsLoading || hotelData) && (_jsx(HotelDetailCard, { hotelData: hotelData, pin: selectedPin, translations: translations, lang: lang, token: token, basketLink: config?.additional?.basket_link?.trim() || '', onClose: closeBottomCard, slideAnim: slideAnim }))] }) })] }));
|
|
312
|
+
};
|
|
313
|
+
const styles = StyleSheet.create({
|
|
314
|
+
container: {
|
|
315
|
+
flex: 1,
|
|
316
|
+
borderRadius: BorderRadius.lg,
|
|
317
|
+
overflow: 'hidden',
|
|
318
|
+
},
|
|
319
|
+
map: {
|
|
320
|
+
flex: 1,
|
|
321
|
+
},
|
|
322
|
+
loaderContainer: {
|
|
323
|
+
flex: 1,
|
|
324
|
+
justifyContent: 'center',
|
|
325
|
+
alignItems: 'center',
|
|
326
|
+
backgroundColor: Colors.background,
|
|
327
|
+
borderRadius: BorderRadius.lg,
|
|
328
|
+
},
|
|
329
|
+
loaderText: {
|
|
330
|
+
marginTop: Spacing.md,
|
|
331
|
+
fontSize: FontSize.md,
|
|
332
|
+
color: Colors.textSecondary,
|
|
333
|
+
},
|
|
334
|
+
loadingOverlay: {
|
|
335
|
+
position: 'absolute',
|
|
336
|
+
top: Spacing.md,
|
|
337
|
+
alignSelf: 'center',
|
|
338
|
+
backgroundColor: Colors.surface,
|
|
339
|
+
borderRadius: BorderRadius.full,
|
|
340
|
+
padding: Spacing.sm,
|
|
341
|
+
elevation: 4,
|
|
342
|
+
shadowColor: Colors.black,
|
|
343
|
+
shadowOffset: { width: 0, height: 2 },
|
|
344
|
+
shadowOpacity: 0.15,
|
|
345
|
+
shadowRadius: 4,
|
|
346
|
+
},
|
|
347
|
+
priceBadge: {
|
|
348
|
+
backgroundColor: Colors.surface,
|
|
349
|
+
paddingHorizontal: Spacing.sm,
|
|
350
|
+
paddingVertical: Spacing.xs + 1,
|
|
351
|
+
borderRadius: BorderRadius.lg,
|
|
352
|
+
borderWidth: 1.5,
|
|
353
|
+
borderColor: Colors.border,
|
|
354
|
+
elevation: 3,
|
|
355
|
+
shadowColor: Colors.black,
|
|
356
|
+
shadowOffset: { width: 0, height: 1 },
|
|
357
|
+
shadowOpacity: 0.15,
|
|
358
|
+
shadowRadius: 3,
|
|
359
|
+
minWidth: 40,
|
|
360
|
+
minHeight: 30,
|
|
361
|
+
alignItems: 'center',
|
|
362
|
+
justifyContent: 'center',
|
|
363
|
+
},
|
|
364
|
+
priceBadgeSelected: {
|
|
365
|
+
backgroundColor: Colors.primary,
|
|
366
|
+
borderColor: Colors.primaryDark,
|
|
367
|
+
elevation: 6,
|
|
368
|
+
shadowOpacity: 0.25,
|
|
369
|
+
shadowRadius: 5,
|
|
370
|
+
},
|
|
371
|
+
priceBadgeText: {
|
|
372
|
+
fontSize: FontSize.xs,
|
|
373
|
+
fontWeight: '700',
|
|
374
|
+
color: Colors.text,
|
|
375
|
+
},
|
|
376
|
+
priceBadgeTextSelected: {
|
|
377
|
+
color: Colors.white,
|
|
378
|
+
},
|
|
379
|
+
priceBadgeSoldOut: {
|
|
380
|
+
backgroundColor: Colors.textTertiary,
|
|
381
|
+
borderColor: Colors.textSecondary,
|
|
382
|
+
opacity: 0.7,
|
|
383
|
+
},
|
|
384
|
+
priceBadgeSoldOutText: {
|
|
385
|
+
fontSize: FontSize.xs - 1,
|
|
386
|
+
fontWeight: '600',
|
|
387
|
+
color: Colors.white,
|
|
388
|
+
},
|
|
389
|
+
priceBadgeError: {
|
|
390
|
+
backgroundColor: Colors.error,
|
|
391
|
+
borderColor: Colors.error,
|
|
392
|
+
},
|
|
393
|
+
priceBadgeErrorText: {
|
|
394
|
+
fontSize: FontSize.xs - 1,
|
|
395
|
+
fontWeight: '600',
|
|
396
|
+
color: Colors.white,
|
|
397
|
+
},
|
|
398
|
+
priceBadgeViewed: {
|
|
399
|
+
backgroundColor: Colors.primaryLight,
|
|
400
|
+
borderColor: Colors.primaryLight,
|
|
401
|
+
opacity: 1,
|
|
402
|
+
},
|
|
403
|
+
priceBadgeTextViewed: {
|
|
404
|
+
color: Colors.primary,
|
|
405
|
+
},
|
|
406
|
+
clusterBubble: {
|
|
407
|
+
backgroundColor: Colors.primary,
|
|
408
|
+
paddingHorizontal: Spacing.md,
|
|
409
|
+
paddingVertical: Spacing.sm,
|
|
410
|
+
minHeight: 34,
|
|
411
|
+
justifyContent: 'center',
|
|
412
|
+
borderRadius: BorderRadius.full,
|
|
413
|
+
borderWidth: 1,
|
|
414
|
+
borderColor: Colors.white,
|
|
415
|
+
elevation: 4,
|
|
416
|
+
shadowColor: Colors.black,
|
|
417
|
+
shadowOffset: { width: 0, height: 2 },
|
|
418
|
+
shadowOpacity: 0.2,
|
|
419
|
+
shadowRadius: 4,
|
|
420
|
+
},
|
|
421
|
+
clusterBubbleText: {
|
|
422
|
+
fontSize: FontSize.xs,
|
|
423
|
+
fontWeight: '700',
|
|
424
|
+
color: Colors.white,
|
|
425
|
+
},
|
|
426
|
+
zoomControls: {
|
|
427
|
+
position: 'absolute',
|
|
428
|
+
right: Spacing.md,
|
|
429
|
+
bottom: Spacing.xxxl + BOTTOM_CARD_HEIGHT / 2,
|
|
430
|
+
backgroundColor: Colors.surface,
|
|
431
|
+
borderRadius: BorderRadius.md,
|
|
432
|
+
elevation: 4,
|
|
433
|
+
shadowColor: Colors.black,
|
|
434
|
+
shadowOffset: { width: 0, height: 2 },
|
|
435
|
+
shadowOpacity: 0.15,
|
|
436
|
+
shadowRadius: 4,
|
|
437
|
+
},
|
|
438
|
+
zoomControlsFullscreen: {
|
|
439
|
+
bottom: Spacing.xxxl + BOTTOM_CARD_HEIGHT / 2 + 20,
|
|
440
|
+
},
|
|
441
|
+
zoomBtn: {
|
|
442
|
+
width: 40,
|
|
443
|
+
height: 40,
|
|
444
|
+
justifyContent: 'center',
|
|
445
|
+
alignItems: 'center',
|
|
446
|
+
},
|
|
447
|
+
zoomBtnText: {
|
|
448
|
+
fontSize: FontSize.xl,
|
|
449
|
+
fontWeight: '500',
|
|
450
|
+
color: Colors.text,
|
|
451
|
+
},
|
|
452
|
+
zoomDivider: {
|
|
453
|
+
height: StyleSheet.hairlineWidth,
|
|
454
|
+
backgroundColor: Colors.border,
|
|
455
|
+
},
|
|
456
|
+
fullscreenBtn: {
|
|
457
|
+
position: 'absolute',
|
|
458
|
+
top: Spacing.md,
|
|
459
|
+
right: Spacing.md,
|
|
460
|
+
backgroundColor: Colors.surface,
|
|
461
|
+
width: 40,
|
|
462
|
+
height: 40,
|
|
463
|
+
borderRadius: BorderRadius.md,
|
|
464
|
+
justifyContent: 'center',
|
|
465
|
+
alignItems: 'center',
|
|
466
|
+
elevation: 4,
|
|
467
|
+
shadowColor: Colors.black,
|
|
468
|
+
shadowOffset: { width: 0, height: 2 },
|
|
469
|
+
shadowOpacity: 0.15,
|
|
470
|
+
shadowRadius: 4,
|
|
471
|
+
},
|
|
472
|
+
fullscreenBtnText: {
|
|
473
|
+
fontSize: FontSize.lg,
|
|
474
|
+
color: Colors.text,
|
|
475
|
+
},
|
|
476
|
+
bottomCard: {
|
|
477
|
+
position: 'absolute',
|
|
478
|
+
bottom: 0,
|
|
479
|
+
left: 0,
|
|
480
|
+
right: 0,
|
|
481
|
+
backgroundColor: Colors.surface,
|
|
482
|
+
borderTopLeftRadius: BorderRadius.xl,
|
|
483
|
+
borderTopRightRadius: BorderRadius.xl,
|
|
484
|
+
paddingHorizontal: Spacing.lg,
|
|
485
|
+
paddingBottom: Spacing.xl,
|
|
486
|
+
paddingTop: Spacing.sm,
|
|
487
|
+
elevation: 8,
|
|
488
|
+
shadowColor: Colors.black,
|
|
489
|
+
shadowOffset: { width: 0, height: -3 },
|
|
490
|
+
shadowOpacity: 0.15,
|
|
491
|
+
shadowRadius: 8,
|
|
492
|
+
minHeight: BOTTOM_CARD_HEIGHT,
|
|
493
|
+
},
|
|
494
|
+
bottomCardHandle: {
|
|
495
|
+
width: 36,
|
|
496
|
+
height: 4,
|
|
497
|
+
borderRadius: 2,
|
|
498
|
+
backgroundColor: Colors.border,
|
|
499
|
+
alignSelf: 'center',
|
|
500
|
+
marginBottom: Spacing.sm,
|
|
501
|
+
},
|
|
502
|
+
bottomCardClose: {
|
|
503
|
+
position: 'absolute',
|
|
504
|
+
top: Spacing.sm,
|
|
505
|
+
right: Spacing.md,
|
|
506
|
+
zIndex: 10,
|
|
507
|
+
width: 28,
|
|
508
|
+
height: 28,
|
|
509
|
+
borderRadius: 14,
|
|
510
|
+
backgroundColor: Colors.background,
|
|
511
|
+
justifyContent: 'center',
|
|
512
|
+
alignItems: 'center',
|
|
513
|
+
},
|
|
514
|
+
bottomCardCloseText: {
|
|
515
|
+
fontSize: FontSize.xl,
|
|
516
|
+
color: Colors.textSecondary,
|
|
517
|
+
lineHeight: FontSize.xl + 2,
|
|
518
|
+
},
|
|
519
|
+
galleryImage: {
|
|
520
|
+
width: GALLERY_WIDTH,
|
|
521
|
+
height: GALLERY_HEIGHT,
|
|
522
|
+
},
|
|
523
|
+
galleryDots: {
|
|
524
|
+
flexDirection: 'row',
|
|
525
|
+
justifyContent: 'center',
|
|
526
|
+
alignItems: 'center',
|
|
527
|
+
gap: 6,
|
|
528
|
+
paddingVertical: Spacing.sm,
|
|
529
|
+
},
|
|
530
|
+
galleryDot: {
|
|
531
|
+
width: 6,
|
|
532
|
+
height: 6,
|
|
533
|
+
borderRadius: 3,
|
|
534
|
+
backgroundColor: Colors.border,
|
|
535
|
+
},
|
|
536
|
+
galleryDotActive: {
|
|
537
|
+
backgroundColor: Colors.primary,
|
|
538
|
+
width: 8,
|
|
539
|
+
height: 8,
|
|
540
|
+
borderRadius: 4,
|
|
541
|
+
},
|
|
542
|
+
bottomCardImagePlaceholder: {
|
|
543
|
+
backgroundColor: Colors.skeleton,
|
|
544
|
+
justifyContent: 'center',
|
|
545
|
+
alignItems: 'center',
|
|
546
|
+
},
|
|
547
|
+
placeholderText: {
|
|
548
|
+
fontSize: FontSize.xs,
|
|
549
|
+
color: Colors.textTertiary,
|
|
550
|
+
},
|
|
551
|
+
bottomCardInfo: {
|
|
552
|
+
paddingHorizontal: Spacing.sm,
|
|
553
|
+
paddingBottom: Spacing.sm,
|
|
554
|
+
},
|
|
555
|
+
bottomCardName: {
|
|
556
|
+
fontSize: FontSize.md,
|
|
557
|
+
fontWeight: '700',
|
|
558
|
+
color: Colors.text,
|
|
559
|
+
marginBottom: Spacing.xs,
|
|
560
|
+
},
|
|
561
|
+
starsRow: {
|
|
562
|
+
flexDirection: 'row',
|
|
563
|
+
marginBottom: Spacing.xs,
|
|
564
|
+
},
|
|
565
|
+
starIcon: {
|
|
566
|
+
fontSize: FontSize.sm,
|
|
567
|
+
color: Colors.warning,
|
|
568
|
+
marginRight: 1,
|
|
569
|
+
},
|
|
570
|
+
bottomCardMeal: {
|
|
571
|
+
fontSize: FontSize.xs,
|
|
572
|
+
color: Colors.textSecondary,
|
|
573
|
+
marginBottom: Spacing.xs,
|
|
574
|
+
},
|
|
575
|
+
bottomCardRefund: {
|
|
576
|
+
fontSize: FontSize.xs,
|
|
577
|
+
color: Colors.success,
|
|
578
|
+
fontWeight: '600',
|
|
579
|
+
marginBottom: Spacing.sm,
|
|
580
|
+
},
|
|
581
|
+
bottomCardRefundGray: {
|
|
582
|
+
color: Colors.textTertiary,
|
|
583
|
+
},
|
|
584
|
+
bottomCardPriceInfo: {
|
|
585
|
+
fontSize: FontSize.xs,
|
|
586
|
+
color: Colors.textSecondary,
|
|
587
|
+
marginBottom: 2,
|
|
588
|
+
},
|
|
589
|
+
bottomCardPriceRow: {
|
|
590
|
+
flexDirection: 'row',
|
|
591
|
+
justifyContent: 'space-between',
|
|
592
|
+
alignItems: 'flex-end',
|
|
593
|
+
},
|
|
594
|
+
bottomCardPrice: {
|
|
595
|
+
fontSize: FontSize.lg,
|
|
596
|
+
fontWeight: '700',
|
|
597
|
+
color: Colors.text,
|
|
598
|
+
},
|
|
599
|
+
bottomCardPriceLabel: {
|
|
600
|
+
fontSize: FontSize.xs,
|
|
601
|
+
fontWeight: '400',
|
|
602
|
+
color: Colors.textSecondary,
|
|
603
|
+
},
|
|
604
|
+
bottomCardTotal: {
|
|
605
|
+
fontSize: FontSize.xs,
|
|
606
|
+
color: Colors.textSecondary,
|
|
607
|
+
marginTop: 2,
|
|
608
|
+
},
|
|
609
|
+
viewDetailsBtn: {
|
|
610
|
+
flexDirection: 'row',
|
|
611
|
+
alignItems: 'center',
|
|
612
|
+
backgroundColor: Colors.primary,
|
|
613
|
+
paddingHorizontal: Spacing.md,
|
|
614
|
+
paddingVertical: Spacing.sm,
|
|
615
|
+
borderRadius: BorderRadius.md,
|
|
616
|
+
gap: Spacing.xs,
|
|
617
|
+
},
|
|
618
|
+
viewDetailsBtnText: {
|
|
619
|
+
fontSize: FontSize.sm,
|
|
620
|
+
fontWeight: '600',
|
|
621
|
+
color: Colors.white,
|
|
622
|
+
},
|
|
623
|
+
viewDetailsArrow: {
|
|
624
|
+
fontSize: FontSize.md,
|
|
625
|
+
color: Colors.white,
|
|
626
|
+
},
|
|
627
|
+
bottomCardAddress: {
|
|
628
|
+
fontSize: FontSize.xs,
|
|
629
|
+
color: Colors.textSecondary,
|
|
630
|
+
marginBottom: Spacing.xs,
|
|
631
|
+
},
|
|
632
|
+
ratingBlock: {
|
|
633
|
+
flexDirection: 'row',
|
|
634
|
+
alignItems: 'center',
|
|
635
|
+
gap: Spacing.xs,
|
|
636
|
+
marginBottom: Spacing.xs,
|
|
637
|
+
},
|
|
638
|
+
ratingScoreBadge: {
|
|
639
|
+
backgroundColor: Colors.primary,
|
|
640
|
+
borderRadius: BorderRadius.sm,
|
|
641
|
+
paddingHorizontal: Spacing.xs + 2,
|
|
642
|
+
paddingVertical: 2,
|
|
643
|
+
},
|
|
644
|
+
ratingScoreText: {
|
|
645
|
+
fontSize: FontSize.xs,
|
|
646
|
+
fontWeight: '700',
|
|
647
|
+
color: Colors.white,
|
|
648
|
+
},
|
|
649
|
+
ratingLabel: {
|
|
650
|
+
fontSize: FontSize.xs,
|
|
651
|
+
fontWeight: '600',
|
|
652
|
+
color: Colors.text,
|
|
653
|
+
},
|
|
654
|
+
ratingCount: {
|
|
655
|
+
fontSize: FontSize.xs - 1,
|
|
656
|
+
color: Colors.textSecondary,
|
|
657
|
+
},
|
|
658
|
+
errorCardContent: {
|
|
659
|
+
paddingHorizontal: Spacing.lg,
|
|
660
|
+
paddingVertical: Spacing.md,
|
|
661
|
+
alignItems: 'center',
|
|
662
|
+
},
|
|
663
|
+
errorCardText: {
|
|
664
|
+
fontSize: FontSize.sm,
|
|
665
|
+
color: Colors.textSecondary,
|
|
666
|
+
textAlign: 'center',
|
|
667
|
+
marginBottom: Spacing.md,
|
|
668
|
+
},
|
|
669
|
+
errorCardBtn: {
|
|
670
|
+
backgroundColor: Colors.primary,
|
|
671
|
+
paddingHorizontal: Spacing.xl,
|
|
672
|
+
paddingVertical: Spacing.sm,
|
|
673
|
+
borderRadius: BorderRadius.md,
|
|
674
|
+
},
|
|
675
|
+
errorCardBtnText: {
|
|
676
|
+
fontSize: FontSize.sm,
|
|
677
|
+
fontWeight: '600',
|
|
678
|
+
color: Colors.white,
|
|
679
|
+
},
|
|
680
|
+
fullscreenContainer: {
|
|
681
|
+
flex: 1,
|
|
682
|
+
backgroundColor: Colors.black,
|
|
683
|
+
top: 0,
|
|
684
|
+
},
|
|
685
|
+
fullscreenCloseBtn: {
|
|
686
|
+
position: 'absolute',
|
|
687
|
+
left: Spacing.md,
|
|
688
|
+
zIndex: 100,
|
|
689
|
+
backgroundColor: Colors.surface,
|
|
690
|
+
width: 40,
|
|
691
|
+
height: 40,
|
|
692
|
+
borderRadius: 20,
|
|
693
|
+
justifyContent: 'center',
|
|
694
|
+
alignItems: 'center',
|
|
695
|
+
elevation: 6,
|
|
696
|
+
shadowColor: Colors.black,
|
|
697
|
+
shadowOffset: { width: 0, height: 2 },
|
|
698
|
+
shadowOpacity: 0.2,
|
|
699
|
+
shadowRadius: 4,
|
|
700
|
+
},
|
|
701
|
+
fullscreenCloseBtnText: {
|
|
702
|
+
fontSize: FontSize.xxl,
|
|
703
|
+
color: Colors.text,
|
|
704
|
+
lineHeight: FontSize.xxl + 2,
|
|
705
|
+
},
|
|
706
|
+
});
|
|
707
|
+
export default HotelMap;
|