@tripian/react 9.3.26 → 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 CHANGED
@@ -61680,7 +61680,6 @@ const KiwiBookingModal = ({ hotelName, roomTitle, rate, currency, checkIn, check
61680
61680
  }
61681
61681
  };
61682
61682
  const handleSubmit = async () => {
61683
- var _a;
61684
61683
  setSubmitting(true);
61685
61684
  setApiError('');
61686
61685
  const externalId = generateExternalId();
@@ -61724,8 +61723,8 @@ const KiwiBookingModal = ({ hotelName, roomTitle, rate, currency, checkIn, check
61724
61723
  ...(payment.message_to_hotel ? { message_to_hotel: payment.message_to_hotel } : {}),
61725
61724
  };
61726
61725
  const res = await onCreateReservation(req);
61727
- if ((_a = res.data) === null || _a === void 0 ? void 0 : _a.confirmationId) {
61728
- setConfirmationId(res.data.confirmationId);
61726
+ if (res.data) {
61727
+ setConfirmationId(res.data.confirmationId || externalId);
61729
61728
  setStep(3);
61730
61729
  }
61731
61730
  else {
@@ -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, onCardClick, t }) => {
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: () => onCardClick === null || onCardClick === void 0 ? void 0 : onCardClick(hotel), role: onCardClick ? 'button' : undefined, tabIndex: onCardClick ? 0 : undefined },
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
- hotel.websiteURL && (react_1.default.createElement("button", { type: "button", className: KiwiHotelCard_scss_1.default.bookBtn, onClick: (e) => {
93729
+ react_1.default.createElement("button", { type: "button", className: KiwiHotelCard_scss_1.default.bookBtn, onClick: (e) => {
93728
93730
  e.stopPropagation();
93729
- window.open(hotel.websiteURL, '_blank', 'noopener,noreferrer');
93730
- } }, t('kiwi.card.book'))))),
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" },