@tripian/react 5.0.5 → 5.0.6
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.
|
@@ -2,7 +2,9 @@ import React from 'react';
|
|
|
2
2
|
import Model from '@tripian/model';
|
|
3
3
|
interface IOfferCard {
|
|
4
4
|
offer: Model.Offer;
|
|
5
|
-
|
|
5
|
+
optedIn: boolean;
|
|
6
|
+
isLoadingOffer: (offerId: number) => boolean;
|
|
7
|
+
clicked: (optIn: boolean, id: number) => void;
|
|
6
8
|
}
|
|
7
9
|
declare const OfferCard: React.FC<IOfferCard>;
|
|
8
10
|
export default OfferCard;
|
|
@@ -21,7 +21,9 @@ interface IPoiInfo {
|
|
|
21
21
|
getTourInfo?: (productId: string) => void;
|
|
22
22
|
TOUR_PROVIDER_ID?: Model.PROVIDER_ID;
|
|
23
23
|
TICKET_PROVIDER_ID?: Model.PROVIDER_ID;
|
|
24
|
-
|
|
24
|
+
myOffers: Model.Poi[];
|
|
25
|
+
isLoadingOffer: (offerId: number) => boolean;
|
|
26
|
+
offerButtonClick: (optIn: boolean, offerId: number, offerClaimDate: string) => void;
|
|
25
27
|
}
|
|
26
28
|
declare const PoiInfo: React.FC<IPoiInfo>;
|
|
27
29
|
export default PoiInfo;
|
|
@@ -17,6 +17,9 @@ interface IStepInfo {
|
|
|
17
17
|
getTourInfo?: (productId: string) => void;
|
|
18
18
|
TOUR_PROVIDER_ID?: Model.PROVIDER_ID;
|
|
19
19
|
TICKET_PROVIDER_ID?: Model.PROVIDER_ID;
|
|
20
|
+
myOffers: Model.Poi[];
|
|
21
|
+
isLoadingOffer: (offerId: number) => boolean;
|
|
22
|
+
offerButtonClick: (optIn: boolean, offerId: number, offerClaimDate: string) => void;
|
|
20
23
|
}
|
|
21
24
|
declare const StepInfo: React.FC<IStepInfo>;
|
|
22
25
|
export default StepInfo;
|
package/index.js
CHANGED
|
@@ -44654,7 +44654,7 @@ var POI_CARD_ACTION;
|
|
|
44654
44654
|
})(POI_CARD_ACTION || (POI_CARD_ACTION = {}));
|
|
44655
44655
|
var PoiInfo = function (_a) {
|
|
44656
44656
|
var _b, _c;
|
|
44657
|
-
var poi = _a.poi, favorite = _a.favorite, toggleFavorite = _a.toggleFavorite, close = _a.close, addRemoveReplacePoi = _a.addRemoveReplacePoi, dayNumbers = _a.dayNumbers, _d = _a.stepOrder, stepOrder = _d === void 0 ? -1 : _d, _e = _a.replace, replace = _e === void 0 ? false : _e, _f = _a.hideActionButtons, hideActionButtons = _f === void 0 ? false : _f, bookingButtonClick = _a.bookingButtonClick, planDate = _a.planDate, favoriteLoading = _a.favoriteLoading, reservationUrl = _a.reservationUrl, hideBookingButton = _a.hideBookingButton, _g = _a.square, square = _g === void 0 ? true : _g, hideTours = _a.hideTours, getTourInfo = _a.getTourInfo, TOUR_PROVIDER_ID = _a.TOUR_PROVIDER_ID, TICKET_PROVIDER_ID = _a.TICKET_PROVIDER_ID, offerButtonClick = _a.offerButtonClick;
|
|
44657
|
+
var poi = _a.poi, favorite = _a.favorite, toggleFavorite = _a.toggleFavorite, close = _a.close, addRemoveReplacePoi = _a.addRemoveReplacePoi, dayNumbers = _a.dayNumbers, _d = _a.stepOrder, stepOrder = _d === void 0 ? -1 : _d, _e = _a.replace, replace = _e === void 0 ? false : _e, _f = _a.hideActionButtons, hideActionButtons = _f === void 0 ? false : _f, bookingButtonClick = _a.bookingButtonClick, planDate = _a.planDate, favoriteLoading = _a.favoriteLoading, reservationUrl = _a.reservationUrl, hideBookingButton = _a.hideBookingButton, _g = _a.square, square = _g === void 0 ? true : _g, hideTours = _a.hideTours, getTourInfo = _a.getTourInfo, TOUR_PROVIDER_ID = _a.TOUR_PROVIDER_ID, TICKET_PROVIDER_ID = _a.TICKET_PROVIDER_ID, myOffers = _a.myOffers, isLoadingOffer = _a.isLoadingOffer, offerButtonClick = _a.offerButtonClick;
|
|
44658
44658
|
var _h = (0, react_1.useState)(false), openTours = _h[0], setOpenTours = _h[1];
|
|
44659
44659
|
var myRef = react_1.default.createRef();
|
|
44660
44660
|
(0, react_1.useEffect)(function () {
|
|
@@ -44716,9 +44716,8 @@ var PoiInfo = function (_a) {
|
|
|
44716
44716
|
if (planDateTimeNow.isBetween(offerStartDate, offerEndDate)) {
|
|
44717
44717
|
var offerClaimDate_1 = (0, moment_1.default)(planDate).format('YYYY-MM-DD');
|
|
44718
44718
|
return (react_1.default.createElement("div", { key: "offer-".concat(i), className: "py2" },
|
|
44719
|
-
react_1.default.createElement(OfferCard_1.default, { offer: offer, clicked: function (id) {
|
|
44720
|
-
|
|
44721
|
-
offerButtonClick(id, offerClaimDate_1);
|
|
44719
|
+
react_1.default.createElement(OfferCard_1.default, { offer: offer, optedIn: myOffers.some(function (p) { return p.offers.some(function (x) { return x.id === offer.id && x.optIn; }); }), isLoadingOffer: isLoadingOffer, clicked: function (optIn, id) {
|
|
44720
|
+
offerButtonClick(optIn, id, offerClaimDate_1);
|
|
44722
44721
|
} })));
|
|
44723
44722
|
}
|
|
44724
44723
|
return null;
|
|
@@ -65000,10 +64999,11 @@ var react_1 = __importDefault(__webpack_require__(0));
|
|
|
65000
64999
|
var moment_1 = __importDefault(__webpack_require__(1));
|
|
65001
65000
|
var OfferCard_scss_1 = __importDefault(__webpack_require__(675));
|
|
65002
65001
|
var Button_1 = __importDefault(__webpack_require__(5));
|
|
65002
|
+
var PreLoading_1 = __importDefault(__webpack_require__(12));
|
|
65003
65003
|
var OfferCard = function (_a) {
|
|
65004
65004
|
var _b, _c;
|
|
65005
|
-
var offer = _a.offer, clicked = _a.clicked;
|
|
65006
|
-
return (react_1.default.createElement("div", { className: OfferCard_scss_1.default.offerCard
|
|
65005
|
+
var offer = _a.offer, optedIn = _a.optedIn, isLoadingOffer = _a.isLoadingOffer, clicked = _a.clicked;
|
|
65006
|
+
return (react_1.default.createElement("div", { className: OfferCard_scss_1.default.offerCard },
|
|
65007
65007
|
react_1.default.createElement("div", { className: OfferCard_scss_1.default.offerCardImgDiv },
|
|
65008
65008
|
react_1.default.createElement("img", { className: OfferCard_scss_1.default.offerCardImg, src: offer.image.url, alt: "" })),
|
|
65009
65009
|
react_1.default.createElement("div", { className: OfferCard_scss_1.default.offerCardContent },
|
|
@@ -65016,8 +65016,12 @@ var OfferCard = function (_a) {
|
|
|
65016
65016
|
"To: ",
|
|
65017
65017
|
(0, moment_1.default)((_c = offer.timeframe) === null || _c === void 0 ? void 0 : _c.end).format('DD MMMM h:mm A'))),
|
|
65018
65018
|
react_1.default.createElement("div", { className: OfferCard_scss_1.default.offerCardCaption }, offer.caption),
|
|
65019
|
-
react_1.default.createElement("div", { className: OfferCard_scss_1.default.offerCardButton },
|
|
65020
|
-
|
|
65019
|
+
react_1.default.createElement("div", { className: OfferCard_scss_1.default.offerCardButton }, isLoadingOffer(offer.id) ? (react_1.default.createElement(PreLoading_1.default, null)) : (react_1.default.createElement(Button_1.default, { className: OfferCard_scss_1.default.offerButton, text: optedIn ? 'OPT-OUT' : 'OPT-IN', onClick: function () {
|
|
65020
|
+
if (optedIn)
|
|
65021
|
+
clicked(false, offer.id);
|
|
65022
|
+
else
|
|
65023
|
+
clicked(true, offer.id);
|
|
65024
|
+
}, color: "primary", size: "small" }))))));
|
|
65021
65025
|
};
|
|
65022
65026
|
exports.default = OfferCard;
|
|
65023
65027
|
|
|
@@ -65730,10 +65734,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
65730
65734
|
var react_1 = __importDefault(__webpack_require__(0));
|
|
65731
65735
|
var PoiInfo_1 = __importDefault(__webpack_require__(334));
|
|
65732
65736
|
var StepInfo = function (_a) {
|
|
65733
|
-
var step = _a.step, favorite = _a.favorite, toggleFavorite = _a.toggleFavorite, removeStep = _a.removeStep, close = _a.close, dayNumbers = _a.dayNumbers, hideRemoveStepButton = _a.hideRemoveStepButton, bookingButtonClick = _a.bookingButtonClick, planDate = _a.planDate, favoriteLoading = _a.favoriteLoading, reservationUrl = _a.reservationUrl, hideBookingButton = _a.hideBookingButton, hideTours = _a.hideTours, getTourInfo = _a.getTourInfo, TOUR_PROVIDER_ID = _a.TOUR_PROVIDER_ID, TICKET_PROVIDER_ID = _a.TICKET_PROVIDER_ID;
|
|
65737
|
+
var step = _a.step, favorite = _a.favorite, toggleFavorite = _a.toggleFavorite, removeStep = _a.removeStep, close = _a.close, dayNumbers = _a.dayNumbers, hideRemoveStepButton = _a.hideRemoveStepButton, bookingButtonClick = _a.bookingButtonClick, planDate = _a.planDate, favoriteLoading = _a.favoriteLoading, reservationUrl = _a.reservationUrl, hideBookingButton = _a.hideBookingButton, hideTours = _a.hideTours, getTourInfo = _a.getTourInfo, TOUR_PROVIDER_ID = _a.TOUR_PROVIDER_ID, TICKET_PROVIDER_ID = _a.TICKET_PROVIDER_ID, myOffers = _a.myOffers, isLoadingOffer = _a.isLoadingOffer, offerButtonClick = _a.offerButtonClick;
|
|
65734
65738
|
return (react_1.default.createElement(PoiInfo_1.default, { dayNumbers: dayNumbers, poi: step.poi, favorite: favorite, toggleFavorite: toggleFavorite, close: close, addRemoveReplacePoi: function () {
|
|
65735
65739
|
removeStep(step.id);
|
|
65736
|
-
}, stepOrder: step.order, hideActionButtons: hideRemoveStepButton, bookingButtonClick: bookingButtonClick, planDate: planDate, favoriteLoading: favoriteLoading, reservationUrl: reservationUrl, hideBookingButton: hideBookingButton, square: false, hideTours: hideTours, getTourInfo: getTourInfo, TOUR_PROVIDER_ID: TOUR_PROVIDER_ID, TICKET_PROVIDER_ID: TICKET_PROVIDER_ID }));
|
|
65740
|
+
}, stepOrder: step.order, hideActionButtons: hideRemoveStepButton, bookingButtonClick: bookingButtonClick, planDate: planDate, favoriteLoading: favoriteLoading, reservationUrl: reservationUrl, hideBookingButton: hideBookingButton, square: false, hideTours: hideTours, getTourInfo: getTourInfo, TOUR_PROVIDER_ID: TOUR_PROVIDER_ID, TICKET_PROVIDER_ID: TICKET_PROVIDER_ID, myOffers: myOffers, isLoadingOffer: isLoadingOffer, offerButtonClick: offerButtonClick }));
|
|
65737
65741
|
};
|
|
65738
65742
|
exports.default = StepInfo;
|
|
65739
65743
|
|