@tripian/react 9.3.25 → 9.3.28
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/index.js +17 -14
- package/index.js.map +1 -1
- package/min.css +1 -1
- package/package.json +2 -2
- package/providers/kiwi/KiwiHotelCard/KiwiHotelCard.d.ts +0 -1
package/index.js
CHANGED
|
@@ -61614,6 +61614,12 @@ const validatePayment = (f, t) => {
|
|
|
61614
61614
|
e.card_security = t('kiwi.booking.validation.invalidCvv');
|
|
61615
61615
|
return e;
|
|
61616
61616
|
};
|
|
61617
|
+
const Field = ({ label, required, error, children: fieldChildren }) => (react_1.default.createElement("div", { className: KiwiBookingModal_scss_1.default.field },
|
|
61618
|
+
react_1.default.createElement("label", { className: KiwiBookingModal_scss_1.default.label },
|
|
61619
|
+
label,
|
|
61620
|
+
required && react_1.default.createElement("span", { className: KiwiBookingModal_scss_1.default.required }, "*")),
|
|
61621
|
+
fieldChildren,
|
|
61622
|
+
error && react_1.default.createElement("span", { className: KiwiBookingModal_scss_1.default.fieldError }, error)));
|
|
61617
61623
|
const KiwiBookingModal = ({ hotelName, roomTitle, rate, currency, checkIn, checkOut, nightCount, adults, children, propertyCode, roomCode, generateExternalId, onClose, onCreateReservation, onReservationFailed, t, }) => {
|
|
61618
61624
|
var _a;
|
|
61619
61625
|
const [step, setStep] = (0, react_1.useState)(1);
|
|
@@ -61674,7 +61680,6 @@ const KiwiBookingModal = ({ hotelName, roomTitle, rate, currency, checkIn, check
|
|
|
61674
61680
|
}
|
|
61675
61681
|
};
|
|
61676
61682
|
const handleSubmit = async () => {
|
|
61677
|
-
var _a;
|
|
61678
61683
|
setSubmitting(true);
|
|
61679
61684
|
setApiError('');
|
|
61680
61685
|
const externalId = generateExternalId();
|
|
@@ -61718,8 +61723,8 @@ const KiwiBookingModal = ({ hotelName, roomTitle, rate, currency, checkIn, check
|
|
|
61718
61723
|
...(payment.message_to_hotel ? { message_to_hotel: payment.message_to_hotel } : {}),
|
|
61719
61724
|
};
|
|
61720
61725
|
const res = await onCreateReservation(req);
|
|
61721
|
-
if (
|
|
61722
|
-
setConfirmationId(res.data.confirmationId);
|
|
61726
|
+
if (res.data) {
|
|
61727
|
+
setConfirmationId(res.data.confirmationId || externalId);
|
|
61723
61728
|
setStep(3);
|
|
61724
61729
|
}
|
|
61725
61730
|
else {
|
|
@@ -61739,12 +61744,6 @@ const KiwiBookingModal = ({ hotelName, roomTitle, rate, currency, checkIn, check
|
|
|
61739
61744
|
setSubmitting(false);
|
|
61740
61745
|
}
|
|
61741
61746
|
};
|
|
61742
|
-
const Field = ({ label, required, error, children: fieldChildren }) => (react_1.default.createElement("div", { className: KiwiBookingModal_scss_1.default.field },
|
|
61743
|
-
react_1.default.createElement("label", { className: KiwiBookingModal_scss_1.default.label },
|
|
61744
|
-
label,
|
|
61745
|
-
required && react_1.default.createElement("span", { className: KiwiBookingModal_scss_1.default.required }, "*")),
|
|
61746
|
-
fieldChildren,
|
|
61747
|
-
error && react_1.default.createElement("span", { className: KiwiBookingModal_scss_1.default.fieldError }, error)));
|
|
61748
61747
|
const content = (
|
|
61749
61748
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
61750
61749
|
react_1.default.createElement("div", { className: KiwiBookingModal_scss_1.default.overlay, onClick: (e) => { e.stopPropagation(); if (e.target === e.currentTarget)
|
|
@@ -93685,7 +93684,7 @@ const KiwiHotelCard_scss_1 = __importDefault(__webpack_require__(1134));
|
|
|
93685
93684
|
const KiwiHotelCardImage_1 = __importDefault(__webpack_require__(1135));
|
|
93686
93685
|
const KiwiVisaBenefitsModal_1 = __importDefault(__webpack_require__(450));
|
|
93687
93686
|
const currencySymbol_1 = __webpack_require__(123);
|
|
93688
|
-
const KiwiHotelCard = ({ hotel, isFavorite, onFavoriteToggle, showVisaBadge, onHover, onSpecialOffersClick,
|
|
93687
|
+
const KiwiHotelCard = ({ hotel, isFavorite, onFavoriteToggle, showVisaBadge, onHover, onSpecialOffersClick, t }) => {
|
|
93689
93688
|
const [visaModalOpen, setVisaModalOpen] = (0, react_1.useState)(false);
|
|
93690
93689
|
const starCount = Math.min(5, Math.round(parseFloat(hotel.starRating) || 0));
|
|
93691
93690
|
const score = parseFloat(hotel.kiwiOverallScore) || 0;
|
|
@@ -93710,7 +93709,10 @@ const KiwiHotelCard = ({ hotel, isFavorite, onFavoriteToggle, showVisaBadge, onH
|
|
|
93710
93709
|
const hasInfoTable = perks.length > 0 || hasSpecialOffer || roomCount || settings || styles;
|
|
93711
93710
|
return (
|
|
93712
93711
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
93713
|
-
react_1.default.createElement("div", { className: KiwiHotelCard_scss_1.default.card, onMouseEnter: () => onHover === null || onHover === void 0 ? void 0 : onHover(hotel.code), onMouseLeave: () => onHover === null || onHover === void 0 ? void 0 : onHover(null), onClick: () =>
|
|
93712
|
+
react_1.default.createElement("div", { className: KiwiHotelCard_scss_1.default.card, onMouseEnter: () => onHover === null || onHover === void 0 ? void 0 : onHover(hotel.code), onMouseLeave: () => onHover === null || onHover === void 0 ? void 0 : onHover(null), onClick: () => {
|
|
93713
|
+
if (hotel.catalogUrl)
|
|
93714
|
+
window.open(hotel.catalogUrl, '_blank', 'noopener,noreferrer');
|
|
93715
|
+
}, role: hotel.websiteURL ? 'button' : undefined, tabIndex: hotel.websiteURL ? 0 : undefined },
|
|
93714
93716
|
react_1.default.createElement("div", { className: KiwiHotelCard_scss_1.default.imageArea },
|
|
93715
93717
|
react_1.default.createElement(KiwiHotelCardImage_1.default, { images: imageUrls, alt: hotel.title, isFavorite: isFavorite, onFavoriteToggle: onFavoriteToggle ? () => onFavoriteToggle(hotel) : undefined })),
|
|
93716
93718
|
react_1.default.createElement("div", { className: KiwiHotelCard_scss_1.default.content },
|
|
@@ -93724,10 +93726,11 @@ const KiwiHotelCard = ({ hotel, isFavorite, onFavoriteToggle, showVisaBadge, onH
|
|
|
93724
93726
|
(0, currencySymbol_1.getCurrencySymbol)(hotel.currencyCode),
|
|
93725
93727
|
price.toFixed(0),
|
|
93726
93728
|
react_1.default.createElement("span", { className: KiwiHotelCard_scss_1.default.priceUnit }, t('kiwi.common.perNight')))),
|
|
93727
|
-
|
|
93729
|
+
react_1.default.createElement("button", { type: "button", className: KiwiHotelCard_scss_1.default.bookBtn, onClick: (e) => {
|
|
93728
93730
|
e.stopPropagation();
|
|
93729
|
-
|
|
93730
|
-
|
|
93731
|
+
if (hotel.catalogUrl)
|
|
93732
|
+
window.open(hotel.catalogUrl, '_blank', 'noopener,noreferrer');
|
|
93733
|
+
} }, t('kiwi.card.book')))),
|
|
93731
93734
|
react_1.default.createElement("div", { className: KiwiHotelCard_scss_1.default.row2 },
|
|
93732
93735
|
react_1.default.createElement("span", { className: KiwiHotelCard_scss_1.default.name }, hotel.title),
|
|
93733
93736
|
starCount > 0 && (react_1.default.createElement("span", { className: KiwiHotelCard_scss_1.default.goldStars }, Array.from({ length: starCount }, (_, i) => (react_1.default.createElement("svg", { key: i, className: KiwiHotelCard_scss_1.default.goldStar, viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" },
|