@tripian/react 9.1.9 → 9.1.11
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
|
@@ -86394,12 +86394,12 @@ var ViatorProductCardImage_1 = __importDefault(__webpack_require__(963));
|
|
|
86394
86394
|
var ViatorProductCardText_1 = __importDefault(__webpack_require__(965));
|
|
86395
86395
|
var ViatorProductCard_scss_1 = __importDefault(__webpack_require__(967));
|
|
86396
86396
|
var ViatorProductCard = function (_a) {
|
|
86397
|
-
var product = _a.product, bodyClicked = _a.bodyClicked;
|
|
86397
|
+
var product = _a.product, bodyClicked = _a.bodyClicked, t = _a.t;
|
|
86398
86398
|
return (react_1.default.createElement("div", { className: ViatorProductCard_scss_1.default.viatorProductCard, onKeyDown: function () { }, role: "button", tabIndex: 0, onClick: function () {
|
|
86399
86399
|
bodyClicked(product);
|
|
86400
86400
|
} },
|
|
86401
86401
|
react_1.default.createElement(ViatorProductCardImage_1.default, { image: product.images[0] }),
|
|
86402
|
-
react_1.default.createElement(ViatorProductCardText_1.default, { product: product }),
|
|
86402
|
+
react_1.default.createElement(ViatorProductCardText_1.default, { product: product, t: t }),
|
|
86403
86403
|
react_1.default.createElement("div", { className: ViatorProductCard_scss_1.default.providerName },
|
|
86404
86404
|
react_1.default.createElement("div", { className: ViatorProductCard_scss_1.default.favicon }),
|
|
86405
86405
|
react_1.default.createElement("div", { className: ViatorProductCard_scss_1.default.companyName }, "Viator"))));
|
|
@@ -86475,15 +86475,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
86475
86475
|
/* eslint-disable react/no-array-index-key */
|
|
86476
86476
|
/* eslint-disable no-nested-ternary */
|
|
86477
86477
|
var react_1 = __importStar(__webpack_require__(0));
|
|
86478
|
-
var ViatorProductCardText_scss_1 = __importDefault(__webpack_require__(966));
|
|
86479
86478
|
var Icons_1 = __webpack_require__(20);
|
|
86479
|
+
var ViatorProductCardText_scss_1 = __importDefault(__webpack_require__(966));
|
|
86480
86480
|
var FLAG;
|
|
86481
86481
|
(function (FLAG) {
|
|
86482
86482
|
FLAG["FREE_CANCELLATION"] = "Free Cancellation";
|
|
86483
86483
|
FLAG["LIKELY_TO_SELL_OUT"] = "Likely To Sell Out";
|
|
86484
|
+
FLAG["NEW_ON_VIATOR"] = "New On Viator";
|
|
86485
|
+
FLAG["VIATOR_EXCLUSIVE"] = "Viator Exclusive";
|
|
86486
|
+
FLAG["SKIP_THE_LINE"] = "Skip The Line";
|
|
86487
|
+
FLAG["PRIVATE_TOUR"] = "Private Tour";
|
|
86488
|
+
FLAG["SPECIAL_OFFER"] = "Special Offer";
|
|
86484
86489
|
})(FLAG || (FLAG = {}));
|
|
86485
86490
|
var ViatorProductCardText = function (_a) {
|
|
86486
|
-
var product = _a.product;
|
|
86491
|
+
var product = _a.product, t = _a.t;
|
|
86487
86492
|
var amount = product.pricing.summary.fromPrice.toString();
|
|
86488
86493
|
var flags = product.flags.map(function (pr) {
|
|
86489
86494
|
return pr
|
|
@@ -86492,26 +86497,49 @@ var ViatorProductCardText = function (_a) {
|
|
|
86492
86497
|
.map(function (p) { return p && p[0].toUpperCase() + p.slice(1); })
|
|
86493
86498
|
.join(' ');
|
|
86494
86499
|
});
|
|
86500
|
+
var translateFlag = function (flag) {
|
|
86501
|
+
switch (flag) {
|
|
86502
|
+
case FLAG.FREE_CANCELLATION:
|
|
86503
|
+
return t('trips.myTrips.localExperiences.tourDetails.freeCancellation');
|
|
86504
|
+
case FLAG.LIKELY_TO_SELL_OUT:
|
|
86505
|
+
return t('trips.myTrips.localExperiences.tourDetails.likelyToSellOut');
|
|
86506
|
+
case FLAG.NEW_ON_VIATOR:
|
|
86507
|
+
return t('trips.myTrips.localExperiences.tourDetails.newOnViator');
|
|
86508
|
+
case FLAG.VIATOR_EXCLUSIVE:
|
|
86509
|
+
return t('trips.myTrips.localExperiences.tourDetails.viatorExclusive');
|
|
86510
|
+
case FLAG.SKIP_THE_LINE:
|
|
86511
|
+
return t('trips.myTrips.localExperiences.tourDetails.skipTheLine');
|
|
86512
|
+
case FLAG.PRIVATE_TOUR:
|
|
86513
|
+
return t('trips.myTrips.localExperiences.tourDetails.privateTour');
|
|
86514
|
+
case FLAG.SPECIAL_OFFER:
|
|
86515
|
+
return t('trips.myTrips.localExperiences.tourDetails.specialOffer');
|
|
86516
|
+
default:
|
|
86517
|
+
return '';
|
|
86518
|
+
}
|
|
86519
|
+
};
|
|
86495
86520
|
var duration = (0, react_1.useMemo)(function () {
|
|
86496
86521
|
if (product.duration.fixedDurationInMinutes) {
|
|
86497
|
-
return react_1.default.createElement("span", { className: ViatorProductCardText_scss_1.default.numberOfRatings },
|
|
86522
|
+
return (react_1.default.createElement("span", { className: ViatorProductCardText_scss_1.default.numberOfRatings },
|
|
86498
86523
|
product.duration.fixedDurationInMinutes,
|
|
86499
|
-
"
|
|
86524
|
+
" ",
|
|
86525
|
+
t('trips.myTrips.localExperiences.tourDetails.mins')));
|
|
86500
86526
|
}
|
|
86501
86527
|
if (product.duration.variableDurationFromMinutes && product.duration.variableDurationToMinutes) {
|
|
86502
86528
|
return (react_1.default.createElement("span", { className: ViatorProductCardText_scss_1.default.numberOfRatings },
|
|
86503
86529
|
product.duration.variableDurationFromMinutes,
|
|
86504
86530
|
" - ",
|
|
86505
86531
|
product.duration.variableDurationToMinutes,
|
|
86506
|
-
"
|
|
86532
|
+
" ",
|
|
86533
|
+
t('trips.myTrips.localExperiences.tourDetails.mins')));
|
|
86507
86534
|
}
|
|
86508
86535
|
return null;
|
|
86536
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
86509
86537
|
}, [product.duration]);
|
|
86510
86538
|
return (react_1.default.createElement("div", { className: ViatorProductCardText_scss_1.default.viatorProductCardText },
|
|
86511
86539
|
react_1.default.createElement("h4", { className: ViatorProductCardText_scss_1.default.viatorProductCardTitle }, product.title),
|
|
86512
86540
|
react_1.default.createElement("div", { className: ViatorProductCardText_scss_1.default.viatorProductCardContent },
|
|
86513
86541
|
react_1.default.createElement("h6", { className: ViatorProductCardText_scss_1.default.viatorProductCardTextBody }, flags.map(function (flag, i) { return (react_1.default.createElement("span", { key: i },
|
|
86514
|
-
react_1.default.createElement("span", { style: { color: flag === FLAG.FREE_CANCELLATION ? 'green' : flag === FLAG.LIKELY_TO_SELL_OUT ? 'red' : 'gray' } }, flag),
|
|
86542
|
+
react_1.default.createElement("span", { style: { color: flag === FLAG.FREE_CANCELLATION ? 'green' : flag === FLAG.LIKELY_TO_SELL_OUT ? 'red' : 'gray' } }, translateFlag(flag)),
|
|
86515
86543
|
"\u00A0")); }))),
|
|
86516
86544
|
react_1.default.createElement("div", { className: ViatorProductCardText_scss_1.default.viatorProductCardFooter },
|
|
86517
86545
|
react_1.default.createElement("div", { className: ViatorProductCardText_scss_1.default.viatorProductCardHour },
|