@roomstay/frontend 2.0.1 → 2.0.3
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/dist/218.bundle.js +1 -1
- package/dist/882.bundle.js +1 -1
- package/dist/main.bundle.js +1 -1
- package/dist/src/api/ReservationAPI.d.ts +1 -1
- package/dist/src/api/ReservationAPI.js +2 -2
- package/dist/src/api/ReservationAPI.js.map +1 -1
- package/dist/src/components/generic/Select/Select.js +8 -5
- package/dist/src/components/generic/Select/Select.js.map +1 -1
- package/dist/src/components/steps/confirmation/StepConfirmationForm.js +8 -14
- package/dist/src/components/steps/confirmation/StepConfirmationForm.js.map +1 -1
- package/dist/src/components/steps/room/InactivityWindow.js +16 -8
- package/dist/src/components/steps/room/InactivityWindow.js.map +1 -1
- package/dist/src/components/steps/room/roomDetails/roomRates/BookNowButton.js +3 -1
- package/dist/src/components/steps/room/roomDetails/roomRates/BookNowButton.js.map +1 -1
- package/dist/src/components/steps/room/roomFilter/RoomFilterPriceSlider.js +5 -4
- package/dist/src/components/steps/room/roomFilter/RoomFilterPriceSlider.js.map +1 -1
- package/dist/src/contexts/ConfirmationStepContext/ConfirmationStepContextTypes.d.ts +3 -4
- package/dist/src/contexts/ConfirmationStepContext/ConfirmationStepContextTypes.js.map +1 -1
- package/dist/src/contexts/ConfirmationStepContext/ConfirmationStepContextWrapper.js +10 -8
- package/dist/src/contexts/ConfirmationStepContext/ConfirmationStepContextWrapper.js.map +1 -1
- package/dist/src/contexts/FullPageEngineContext/FullPageEngineContextWrapper.js +11 -1
- package/dist/src/contexts/FullPageEngineContext/FullPageEngineContextWrapper.js.map +1 -1
- package/dist/src/models/Confirmation.d.ts +2 -1
- package/dist/src/models/Confirmation.js.map +1 -1
- package/dist/src/routes/NaturallyProgressedStepRoute.js +4 -1
- package/dist/src/routes/NaturallyProgressedStepRoute.js.map +1 -1
- package/dist/test.bundle.js +1 -1
- package/dist/vendors.bundle.js +1 -1
- package/package.json +1 -1
|
@@ -17,7 +17,7 @@ export interface IPayment {
|
|
|
17
17
|
export default class ReservationAPI extends BaseAPI {
|
|
18
18
|
private storedReservations;
|
|
19
19
|
bookNow: (basketRows: BasketRow[], userProfiles: UserProfile[], payment: IBookingPayment, addonRows: BasketAddonRow[], comments: string, hotelId: string, specialReq?: string) => Promise<ReservationsDTO>;
|
|
20
|
-
commit: (reservations: string[], itineraryId: string, hotelId: string,
|
|
20
|
+
commit: (reservations: string[], itineraryId: string, hotelId: string, planpayCheckoutId?: string) => Promise<ReservationsDTO>;
|
|
21
21
|
rollback: (reservations: string[], itineraryId: string, hotelId: string) => Promise<boolean>;
|
|
22
22
|
cancelReservation: (id: string, email: string, hotelId: string) => Promise<boolean>;
|
|
23
23
|
findReservation: (id: string, email: string, hotelId: string) => Promise<ReservationsDTO>;
|
|
@@ -70,11 +70,11 @@ class ReservationAPI extends BaseAPI_1.default {
|
|
|
70
70
|
Payment: payment,
|
|
71
71
|
}, hotelId);
|
|
72
72
|
});
|
|
73
|
-
this.commit = (reservations, itineraryId, hotelId,
|
|
73
|
+
this.commit = (reservations, itineraryId, hotelId, planpayCheckoutId) => __awaiter(this, void 0, void 0, function* () {
|
|
74
74
|
return this.post(BaseAPI_1.APIEndpoint.Reservations, {
|
|
75
75
|
itineraryId: itineraryId,
|
|
76
76
|
reservationIds: reservations,
|
|
77
|
-
|
|
77
|
+
planpayCheckoutId,
|
|
78
78
|
}, hotelId, {}, 'commit');
|
|
79
79
|
});
|
|
80
80
|
this.rollback = (reservations, itineraryId, hotelId) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReservationAPI.js","sourceRoot":"/","sources":["src/api/ReservationAPI.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAAmD;AAQnD,IAAY,cAGX;AAHD,WAAY,cAAc;IACtB,qCAAmB,CAAA;IACnB,+BAAa,CAAA;AACjB,CAAC,EAHW,cAAc,GAAd,sBAAc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AAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,qBAAW,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;gBAElF,IAAI,CAAC,kBAAkB,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC;gBAEvC,OAAO,CAAC,QAAQ,CAAC,CAAC;aACrB;YAAC,OAAO,EAAE,EAAE;gBACT,MAAM,CAAC,EAAE,CAAC,CAAC;aACd;QACL,CAAC,CAAA,CAAC,CAAC;IACX,CAAC;CAAA;AA3ID,iCA2IC","sourcesContent":["import BaseAPI, { APIEndpoint } from 'api/BaseAPI';\nimport BasketRow from 'models/BasketRow';\nimport UserProfile from 'models/UserProfile';\nimport PaymentCard from 'models/PaymentCard';\nimport ReservationsDTO, { ReservationDTO } from 'models/Api/ReservationsDTO';\nimport BasketAddonRow from 'models/BasketAddonRow';\nimport { IBookingPayment } from '@roomstay/core';\n\nexport enum EPaymentMethod {\n PLANPAY = 'Planpay',\n CARD = 'Card',\n}\nexport interface IPayment {\n Type: EPaymentMethod;\n PlanpayCheckoutId?: string;\n PaymentCard?: PaymentCard;\n}\n\nexport default class ReservationAPI extends BaseAPI {\n private storedReservations: { [ref: string]: any } = {};\n\n public bookNow = async (\n basketRows: BasketRow[],\n userProfiles: UserProfile[],\n payment: IBookingPayment,\n addonRows: BasketAddonRow[],\n comments: string,\n hotelId: string,\n specialReq: string = undefined\n ): Promise<ReservationsDTO> => {\n const rooms: any[] = [];\n\n basketRows.forEach((row) => {\n const room = {\n RoomType: row.getRoom().code,\n RatePlan: row.getRate().code,\n PromoCode: row.getPromoCode(),\n Adults: row.getAdults(),\n Children: row.getChildren(),\n CheckInDate: row.getStartDate().format('YYYY-MM-DD'),\n CheckOutDate: row.getEndDate().format('YYYY-MM-DD'),\n };\n\n rooms.push(room);\n });\n\n const addons = addonRows.map((row) => {\n const addon = row.getAddon();\n const priceInfo = addon.availability[row.getSelectedDate()];\n\n const response: any = {\n Code: addon.code,\n StartDate: row.getSelectedDate(),\n };\n if (addon?.ratePlanCode) {\n response.RatePlanCode = row.getAddon().ratePlanCode;\n }\n if (row.getSelectedTime()) {\n response.StartTime = row.getSelectedTime();\n }\n\n if (priceInfo.price) {\n response.Quantity = row.getQuantity();\n }\n if (priceInfo.adultPrice) {\n response.Adults = row.getAdultQuantity();\n }\n if (priceInfo.childPrice) {\n response.Children = row.getChildQuantity();\n }\n\n if (addon.pricingType) {\n response.PricingType = addon.pricingType;\n }\n\n return response;\n });\n\n return this.post(\n APIEndpoint.Reservations,\n {\n Rooms: rooms,\n Services: addons,\n SpecialRequest: specialReq,\n Comments: comments,\n Profiles: userProfiles,\n Payment: payment,\n },\n hotelId\n );\n };\n\n public commit = async (reservations: string[], itineraryId: string, hotelId: string, planpayCheckoutId?: string): Promise<ReservationsDTO> => {\n return this.post(\n APIEndpoint.Reservations,\n {\n itineraryId: itineraryId,\n reservationIds: reservations,\n planpayCheckoutId,\n },\n hotelId,\n {},\n 'commit'\n );\n };\n\n public rollback = async (reservations: string[], itineraryId: string, hotelId: string): Promise<boolean> => {\n await this.post(\n APIEndpoint.Reservations,\n {\n itineraryId: itineraryId,\n reservationIds: reservations,\n },\n hotelId,\n {},\n 'rollback'\n );\n\n return true;\n };\n\n public cancelReservation = (id: string, email: string, hotelId: string): Promise<boolean> =>\n new Promise(async (resolve, reject) => {\n try {\n const response = await this.delete(APIEndpoint.Reservations, {}, hotelId, { email }, id);\n\n this.storedReservations[id]?.reservations?.forEach((reservation: ReservationDTO) => {\n if (reservation.reservationNumber === id) {\n reservation.status = 'Cancelled';\n }\n });\n\n resolve(response);\n } catch (ex) {\n reject(ex);\n }\n });\n\n public findReservation = (id: string, email: string, hotelId: string): Promise<ReservationsDTO> =>\n new Promise(async (resolve, reject) => {\n /*\n resolve with locally cached data, so we don't have to re-query this again\n */\n if (this.storedReservations[id]) {\n return resolve(this.storedReservations[id]);\n }\n\n try {\n const response = await this.get(APIEndpoint.Reservations, { email }, id, hotelId);\n\n this.storedReservations[id] = response;\n\n resolve(response);\n } catch (ex) {\n reject(ex);\n }\n });\n}\n"]}
|
|
@@ -7,15 +7,18 @@ const Icon_1 = require("../Icon/Icon");
|
|
|
7
7
|
const classNames = require("classnames");
|
|
8
8
|
require("./Select.global.scss");
|
|
9
9
|
const Overlay_1 = require("components/generic/Overlay/Overlay");
|
|
10
|
-
const KeyboardControlOnSelect_1 = require("
|
|
11
|
-
const Color_1 = require("
|
|
12
|
-
const CombineState_1 = require("
|
|
13
|
-
const WindowSize_1 = require("
|
|
10
|
+
const KeyboardControlOnSelect_1 = require("hooks/KeyboardControlOnSelect");
|
|
11
|
+
const Color_1 = require("util/Color");
|
|
12
|
+
const CombineState_1 = require("hooks/CombineState");
|
|
13
|
+
const WindowSize_1 = require("hooks/WindowSize");
|
|
14
|
+
const Text_1 = require("components/generic/Text");
|
|
14
15
|
const MOBILE_BREAKPOINT = 992;
|
|
15
16
|
const InnerSelect = ({ target, open, onClose, options = [], value, onChange, keyName, labelName, className, offset, renderOption, nativeOnMobile = false }, ref) => {
|
|
16
17
|
const { width } = (0, WindowSize_1.useWindowSize)();
|
|
17
18
|
const targetRef = (0, react_1.useRef)(null);
|
|
18
19
|
const [_open, _setIsOpen] = (0, CombineState_1.useCombinedState)(open, false);
|
|
20
|
+
// Force to fix later
|
|
21
|
+
nativeOnMobile = false;
|
|
19
22
|
const _onClose = (e) => {
|
|
20
23
|
_setIsOpen(false);
|
|
21
24
|
onClose === null || onClose === void 0 ? void 0 : onClose(e);
|
|
@@ -54,7 +57,7 @@ const InnerSelect = ({ target, open, onClose, options = [], value, onChange, key
|
|
|
54
57
|
return (React.createElement("div", { key: index, className: classNames('rs-select--suggest-list-item', { '--selected': isSelected || isSelecting }), onClick: () => _onSelected(option[keyName]), onMouseEnter: () => {
|
|
55
58
|
onItemMouseEnter(option);
|
|
56
59
|
}, onMouseLeave: () => onItemMouseLeave(), onMouseMove: () => onItemMouseMove() },
|
|
57
|
-
React.createElement(
|
|
60
|
+
React.createElement(Text_1.default, { type: Text_1.TextType.Small, className: "rs-select--suggest-list-option-name" }, renderOption ? renderOption(option) : labelName ? option[labelName] : ''),
|
|
58
61
|
isSelected && (React.createElement("span", { className: "rs-select--suggest-list-option-icon" },
|
|
59
62
|
React.createElement(Icon_1.default, { icon: Icon_1.IconType.Check })))));
|
|
60
63
|
})))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sourceRoot":"/","sources":["src/components/generic/Select/Select.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,iCAAgF;AAChF,uCAA8C;AAE9C,yCAAyC;AAEzC,gCAA8B;AAC9B,gEAA6D;AAC7D,
|
|
1
|
+
{"version":3,"file":"Select.js","sourceRoot":"/","sources":["src/components/generic/Select/Select.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,iCAAgF;AAChF,uCAA8C;AAE9C,yCAAyC;AAEzC,gCAA8B;AAC9B,gEAA6D;AAC7D,2EAA2E;AAC3E,sCAAmC;AACnC,qDAAsD;AACtD,iDAAiD;AACjD,kDAAyD;AAsBzD,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAEvB,MAAM,WAAW,GAAG,CACvB,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,cAAc,GAAG,KAAK,EAA4B,EAC/J,GAAwB,EAC1B,EAAE;IACA,MAAM,EAAE,KAAK,EAAE,GAAG,IAAA,0BAAa,GAAE,CAAC;IAClC,MAAM,SAAS,GAAG,IAAA,cAAM,EAAkB,IAAI,CAAC,CAAC;IAChD,MAAM,CAAC,KAAK,EAAE,UAAU,CAAC,GAAG,IAAA,+BAAgB,EAAU,IAAI,EAAE,KAAK,CAAC,CAAC;IAEnE,qBAAqB;IACrB,cAAc,GAAG,KAAK,CAAC;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as React from 'react';\nimport { forwardRef, ReactNode, Ref, useImperativeHandle, useRef } from 'react';\nimport Icon, { IconType } from '../Icon/Icon';\n\nimport * as classNames from 'classnames';\n\nimport './Select.global.scss';\nimport { Overlay } from 'components/generic/Overlay/Overlay';\nimport { useKeyboardControlOnSelect } from 'hooks/KeyboardControlOnSelect';\nimport { Color } from 'util/Color';\nimport { useCombinedState } from 'hooks/CombineState';\nimport { useWindowSize } from 'hooks/WindowSize';\nimport Text, { TextType } from 'components/generic/Text';\n\nexport type Option<KeyName extends string> = {\n [keyName in KeyName]: string;\n} & Record<any, any>;\n\ntype Select<TOption extends Option<KeyName>, KeyName extends string> = {\n options: TOption[];\n value: TOption[KeyName];\n keyName: KeyName;\n\n labelName?: TOption[keyof TOption];\n target?: HTMLElement;\n open?: boolean;\n onClose?: (e: MouseEvent) => void;\n onChange?: (value: TOption[KeyName]) => void;\n className?: string;\n offset?: [number, number];\n renderOption?: (option: TOption) => ReactNode;\n nativeOnMobile?: boolean;\n};\n\nconst MOBILE_BREAKPOINT = 992;\n\nexport const InnerSelect = <TOption extends Option<KeyName>, KeyName extends string>(\n { target, open, onClose, options = [], value, onChange, keyName, labelName, className, offset, renderOption, nativeOnMobile = false }: Select<TOption, KeyName>,\n ref: Ref<HTMLDivElement>\n) => {\n const { width } = useWindowSize();\n const targetRef = useRef<HTMLSpanElement>(null);\n const [_open, _setIsOpen] = useCombinedState<boolean>(open, false);\n\n // Force to fix later\n nativeOnMobile = false;\n\n const _onClose = (e: MouseEvent): void => {\n _setIsOpen(false);\n onClose?.(e);\n };\n\n const overlayRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => overlayRef.current);\n\n const _onSelected = (value: TOption[KeyName]) => {\n onChange?.(value);\n _setIsOpen(false);\n };\n\n const _getOption = (value: TOption[keyof TOption]): TOption | undefined => {\n return options?.find((option) => option[keyName] === value);\n };\n\n const { selectingItem, onItemMouseMove, onItemMouseLeave, onItemMouseEnter } = useKeyboardControlOnSelect<TOption>({\n onSelected: (item) => _onSelected(item[keyName]),\n isEnabled: _open,\n options,\n idName: keyName,\n overlayRef: overlayRef.current,\n defaultOption: _getOption(value),\n });\n\n const _getLabel = (value: TOption[keyof TOption]): string => {\n const option = options?.find((option) => option[keyName] === value);\n return option?.[labelName] || value;\n };\n\n const native = width && width < MOBILE_BREAKPOINT && nativeOnMobile;\n\n return (\n <>\n {(native || !target) && (\n <span className={classNames('be-select', className)} onClick={() => _setIsOpen(true)} ref={targetRef}>\n {native ? (\n <select value={value} onChange={(e) => onChange(e.target.value as TOption[KeyName])}>\n {options.map((item) => {\n return <option value={value} key={item[keyName]} label={_getLabel(item[keyName])}></option>;\n })}\n </select>\n ) : (\n _getLabel(value)\n )}\n <Icon icon={IconType.Dropdown} color={Color.DarkGrey} />\n </span>\n )}\n {!native && (\n <Overlay\n offset={offset}\n usePortal={true}\n followElement={target || targetRef.current}\n placement=\"bottom-start\"\n open={open === undefined ? _open : open}\n onClose={_onClose}\n className=\"rs-select--suggest-list\"\n overlayRef={overlayRef}\n >\n {options.map((option, index) => {\n const isSelected = option[keyName] === value;\n const isSelecting = option[keyName] === selectingItem?.[keyName];\n\n return (\n <div\n key={index}\n className={classNames('rs-select--suggest-list-item', { '--selected': isSelected || isSelecting })}\n onClick={() => _onSelected(option[keyName])}\n onMouseEnter={() => {\n onItemMouseEnter(option);\n }}\n onMouseLeave={() => onItemMouseLeave()}\n onMouseMove={() => onItemMouseMove()}\n >\n <Text type={TextType.Small} className=\"rs-select--suggest-list-option-name\">\n {renderOption ? renderOption(option) : labelName ? option[labelName] : ''}\n </Text>\n {isSelected && (\n <span className=\"rs-select--suggest-list-option-icon\">\n <Icon icon={IconType.Check} />\n </span>\n )}\n </div>\n );\n })}\n </Overlay>\n )}\n </>\n );\n};\n\nexport const Select = forwardRef(InnerSelect) as <TOption extends Option<KeyName>, KeyName extends string>(\n p: Select<TOption, KeyName> & { ref?: Ref<HTMLDivElement> }\n) => JSX.Element;\n"]}
|
|
@@ -58,15 +58,11 @@ function StepConfirmationForm() {
|
|
|
58
58
|
const { queryPaymentMethod, queryRoomstayId, queryPlanpayCheckoutId } = (0, ConfirmationQuery_1.useConfirmationQuery)();
|
|
59
59
|
const context = (0, contexts_1.useBookingEngine)();
|
|
60
60
|
const methods = (0, react_hook_form_1.useFormContext)();
|
|
61
|
-
const { isBackFromPlanpay, isLoading
|
|
61
|
+
const { isBackFromPlanpay, isLoading, apiErrors, clearApiErrors, book, rollbackReservation, commitReservation } = (0, ConfirmationStepContext_1.useConfirmationStep)();
|
|
62
62
|
const basketContext = (0, contexts_1.useBasket)();
|
|
63
63
|
const tokenizerRef = (0, react_1.useRef)(null);
|
|
64
64
|
const history = (0, react_router_dom_1.useHistory)();
|
|
65
65
|
const { hotel } = (0, hooks_1.useCurrentHotel)();
|
|
66
|
-
const [isLoading, setIsLoading] = (0, react_1.useState)(false);
|
|
67
|
-
(0, react_1.useEffect)(() => {
|
|
68
|
-
setIsLoading(isPaymentLoading);
|
|
69
|
-
}, [isPaymentLoading]);
|
|
70
66
|
const toPaymentPayload = (paymentMethod) => __awaiter(this, void 0, void 0, function* () {
|
|
71
67
|
let payment;
|
|
72
68
|
switch (paymentMethod) {
|
|
@@ -111,7 +107,7 @@ function StepConfirmationForm() {
|
|
|
111
107
|
};
|
|
112
108
|
}, []);
|
|
113
109
|
const onPlaypayCallback = (paymentMethod) => __awaiter(this, void 0, void 0, function* () {
|
|
114
|
-
yield commitReservation(basketContext.reservationData
|
|
110
|
+
yield commitReservation(basketContext.reservationData);
|
|
115
111
|
});
|
|
116
112
|
const paymentMethod = methods.watch('paymentMethod');
|
|
117
113
|
context.engine
|
|
@@ -125,12 +121,11 @@ function StepConfirmationForm() {
|
|
|
125
121
|
history.push(StepRoom_1.default.getStepUrl());
|
|
126
122
|
});
|
|
127
123
|
const onNextStepClicked = () => __awaiter(this, void 0, void 0, function* () {
|
|
128
|
-
|
|
129
|
-
yield handleBook(paymentMethod, (resData) => __awaiter(this, void 0, void 0, function* () { return commitReservation(resData, yield toPaymentPayload(paymentMethod)); }));
|
|
124
|
+
yield handleBook(paymentMethod, (resData) => __awaiter(this, void 0, void 0, function* () { return commitReservation(resData); }));
|
|
130
125
|
return false;
|
|
131
126
|
});
|
|
132
127
|
const handleBook = (paymentMethod, onSuccess) => __awaiter(this, void 0, void 0, function* () {
|
|
133
|
-
yield book(
|
|
128
|
+
yield book(() => __awaiter(this, void 0, void 0, function* () { return toPaymentPayload(paymentMethod); }), () => __awaiter(this, void 0, void 0, function* () {
|
|
134
129
|
try {
|
|
135
130
|
if (paymentMethod === core_1.EBookingPaymentMethod.Card)
|
|
136
131
|
yield tokenizerRef.current.getTokenizedCode();
|
|
@@ -208,11 +203,10 @@ function StepConfirmationForm() {
|
|
|
208
203
|
label: (React.createElement("div", { className: "u-flex u-flex-align-center" },
|
|
209
204
|
React.createElement("div", null, t(Translation_1.Translation.Step.Confirmation.PlanpayLabel)),
|
|
210
205
|
React.createElement("div", { className: "u-flex u-flex-align-center u-marg-left--light", style: {
|
|
211
|
-
background: '#e5c5ff',
|
|
212
|
-
padding: '4px 8px',
|
|
213
206
|
borderRadius: '24px',
|
|
207
|
+
overflow: 'hidden',
|
|
214
208
|
} },
|
|
215
|
-
React.createElement("img", { height:
|
|
209
|
+
React.createElement("img", { height: 16, src: RoomstayThemeEngine_1.default.getImageAssetUrl('planpay-logo-small.svg'), alt: "" })),
|
|
216
210
|
!methods.formState.isValid && (React.createElement(Text_1.default, { color: Color_1.Color.Graphite, className: "u-flex u-flex-align-center", style: {
|
|
217
211
|
color: '#313131',
|
|
218
212
|
fontSize: 10,
|
|
@@ -253,7 +247,7 @@ function StepConfirmationForm() {
|
|
|
253
247
|
React.createElement("div", null,
|
|
254
248
|
React.createElement(StepConfirmationAcknowledgement_1.default, null)))),
|
|
255
249
|
React.createElement("div", { className: "u-flex u-marg-top--heavy justify-content-end" },
|
|
256
|
-
React.createElement(NextStepButton_1.default, { disabled: paymentMethod === core_1.EBookingPaymentMethod.Planpay ||
|
|
250
|
+
React.createElement(NextStepButton_1.default, { disabled: paymentMethod === core_1.EBookingPaymentMethod.Planpay || isLoading, text: t(Translation_1.Translation.Step.Confirmation.ConfirmReservation), history: null, isLoading: isLoading, currentStep: StepConfirmation_1.default, onClick: onNextStepClicked })))),
|
|
257
251
|
React.createElement(ErrorModal_1.default, { open: !!apiErrors, onClose: clearApiErrors },
|
|
258
252
|
React.createElement(Text_1.default, null, apiErrors)),
|
|
259
253
|
React.createElement(StepConfirmationCheckoutDifferencesModal_1.default, { differences: differenceWarning.differences, warnings: differenceWarning.warnings, isLoading: isLoading, onClose: () => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -267,7 +261,7 @@ function StepConfirmationForm() {
|
|
|
267
261
|
});
|
|
268
262
|
}
|
|
269
263
|
else {
|
|
270
|
-
yield commitReservation(basketContext.reservationData
|
|
264
|
+
yield commitReservation(basketContext.reservationData);
|
|
271
265
|
}
|
|
272
266
|
}) })));
|
|
273
267
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepConfirmationForm.js","sourceRoot":"/","sources":["src/components/steps/confirmation/StepConfirmationForm.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,+BAA+B;AAC/B,iCAAoD;AACpD,0DAAmD;AACnD,0DAAuD;AACvD,kDAAyD;AACzD,sCAAmC;AACnC,qDAA6D;AAC7D,yFAAkF;AAClF,4DAAqD;AACrD,mHAA4G;AAC5G,8EAAuE;AACvE,iDAA+C;AAC/C,iDAAiE;AACjE,uDAA8D;AAC9D,8EAAuE;AACvE,qIAA8H;AAC9H,uDAA8C;AAC9C,oEAA6D;AAC7D,2GAAoG;AAEpG,mHAA4G;AAC5G,0DAAmD;AACnD,oDAA4D;AAC5D,oFAA6E;AAC7E,4DAAqD;AACrD,2FAAoF;AACpF,wDAAiD;AACjD,uGAAgG;AAChG,iEAA8D;AAE9D,qDAA8C;AAC9C,sGAA+F;AAC/F,+DAA+D;AAE/D,uEAAgE;AAChE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A,EACD,SAAS,EAAE,GAAS,EAAE;gBAClB,IAAI,aAAa,KAAK,4BAAqB,CAAC,OAAO,EAAE;oBACjD,oBAAoB,CAAC;wBACjB,WAAW,EAAE,EAAE;wBACf,QAAQ,EAAE,EAAE;qBACf,CAAC,CAAC;iBACN;qBAAM;oBACH,MAAM,iBAAiB,CAAC,aAAa,CAAC,eAAe,EAAE,MAAM,gBAAgB,CAAC,aAAa,CAAC,CAAC,CAAC;iBACjG;YACL,CAAC,CAAA,GACH,CACC,CACV,CAAC;AACN,CAAC;AAhVD,uCAgVC","sourcesContent":["import * as React from 'react';\nimport { useEffect, useRef, useState } from 'react';\nimport Headline from 'components/generic/Headline';\nimport { Translation } from 'translations/Translation';\nimport Text, { TextType } from 'components/generic/Text';\nimport { Color } from 'util/Color';\nimport { Controller, useFormContext } from 'react-hook-form';\nimport RoomContactDetails from 'components/steps/confirmation/RoomContactDetails';\nimport LineBreak from 'components/generic/LineBreak';\nimport StepConfirmationPoliciesSection from 'components/steps/confirmation/StepConfirmationPoliciesSection';\nimport NextStepButton from 'components/generic/buttons/NextStepButton';\nimport { useTranslation } from 'react-i18next';\nimport { useBasket, useBookingEngine } from '@frontend/contexts';\nimport Icon, { IconType } from 'components/generic/Icon/Icon';\nimport SSLSecureBadge from 'components/generic/badging/SSLSecureBadge';\nimport StepConfirmationCheckoutDifferencesModal from 'components/steps/confirmation/StepConfirmationCheckoutDifferencesModal';\nimport { useHistory } from 'react-router-dom';\nimport ErrorModal from 'components/generic/modal/ErrorModal';\nimport StepConfirmationPolicyBlock from 'components/steps/confirmation/StepConfirmationPolicyBlock';\n\nimport StepConfirmationAcknowledgement from 'components/steps/confirmation/StepConfirmationAcknowledgement';\nimport BEButton from 'components/generic/BEButton';\nimport Alert, { AlertType } from 'components/generic/Alert';\nimport StepConfirmation from 'pages/steps/StepConfirmation/StepConfirmation';\nimport StepRoom from 'pages/steps/StepRoom/StepRoom';\nimport ConfirmationVerifyFeature from 'providers/feature/ConfirmationVerifyFeature';\nimport TextBox from 'components/generic/TextBox';\nimport ShowIATANumberOnCheckoutFeature from 'providers/feature/ShowIATANumberOnCheckoutFeature';\nimport { PlanpayPaymentMethod } from './PlanpayPaymentMethod';\nimport { ConfirmationFormValues, FBookSuccessCallback } from 'models/Confirmation';\nimport TextArea from '../../generic/TextArea';\nimport { useConfirmationStep } from 'contexts/ConfirmationStepContext/ConfirmationStepContext';\nimport { useConfirmationQuery } from 'hooks/ConfirmationQuery';\nimport BasketRowDifferences from '../../../models/BasketRowDifferences';\nimport LargeLoader from 'components/generic/loader/LargeLoader';\nimport StepConfirmationPaymentDetails from './PaymentDetails/StepConfirmationPaymentDetails';\nimport { EBookingPaymentMethod, IBookingPayment } from '@roomstay/core';\nimport RadioButtonGroup from 'components/generic/RadioButtonGroup/RadioButtonGroup';\nimport AcceptablePaymentCard from 'components/steps/confirmation/PaymentDetails/AcceptablePaymentCard';\nimport RoomstayThemeEngine from 'providers/RoomstayThemeEngine';\nimport { useCurrentHotel } from '@frontend/hooks';\nimport * as dayjs from 'dayjs';\n\nexport default function StepConfirmationForm() {\n const [differenceWarning, setDifferenceWarning] = useState<{\n differences: BasketRowDifferences[];\n warnings: string[];\n }>({\n differences: [],\n warnings: [],\n });\n\n const [source, setSource] = useState('');\n\n const { t } = useTranslation();\n const { queryPaymentMethod, queryRoomstayId, queryPlanpayCheckoutId } = useConfirmationQuery();\n const context = useBookingEngine();\n const methods = useFormContext<ConfirmationFormValues>();\n const { isBackFromPlanpay, isLoading: isPaymentLoading, apiErrors, clearApiErrors, book, rollbackReservation, commitReservation } = useConfirmationStep();\n const basketContext = useBasket();\n const tokenizerRef = useRef(null);\n const history = useHistory();\n const { hotel } = useCurrentHotel();\n\n const [isLoading, setIsLoading] = useState(false);\n\n useEffect(() => {\n setIsLoading(isPaymentLoading);\n }, [isPaymentLoading]);\n\n const toPaymentPayload = async (paymentMethod: EBookingPaymentMethod): Promise<IBookingPayment> => {\n let payment: IBookingPayment;\n switch (paymentMethod) {\n case EBookingPaymentMethod.Planpay:\n const params = new URLSearchParams(window.location.search);\n params.set('roomstayId', '{{rsId}}');\n params.set('session', context.sessionProvider.getCurrentSessionID().toString());\n params.set('paymentMethod', EBookingPaymentMethod.Planpay);\n const redirectURL = `${window.location.origin}${window.location.pathname}${window.location.search}#/step/confirmation/?${params}`;\n payment = {\n Method: EBookingPaymentMethod.Planpay,\n PlanpayCheckoutId: queryPlanpayCheckoutId,\n RedirectUrl: redirectURL,\n };\n break;\n default:\n payment = {\n Method: EBookingPaymentMethod.Card,\n PaymentCard: await tokenizerRef.current.getTokenizedCode(),\n };\n }\n\n return payment;\n };\n\n useEffect(() => {\n const validatedPaymentMethod = Object.values(EBookingPaymentMethod).includes(queryPaymentMethod as EBookingPaymentMethod)\n ? (queryPaymentMethod as EBookingPaymentMethod)\n : EBookingPaymentMethod.Card;\n methods.setValue('paymentMethod', validatedPaymentMethod);\n handleChangePaymentMethod(validatedPaymentMethod);\n if (isBackFromPlanpay) {\n if (queryRoomstayId === basketContext.reservationData?.roomstayId) {\n onPlaypayCallback(validatedPaymentMethod);\n } else {\n rollbackReservation();\n }\n }\n return () => {\n if (!isBackFromPlanpay) rollbackReservation();\n };\n }, []);\n\n const onPlaypayCallback = async (paymentMethod: EBookingPaymentMethod) => {\n await commitReservation(basketContext.reservationData, await toPaymentPayload(paymentMethod));\n };\n\n const paymentMethod = methods.watch('paymentMethod');\n\n context.engine\n .getSessionProvider()\n .getSession()\n .then((session) => {\n setSource(session.source);\n });\n\n const returnToPickRooms = async () => {\n // TODO: What if StepRoom doesn't exist?\n history.push(StepRoom.getStepUrl());\n };\n\n const onNextStepClicked = async () => {\n setIsLoading(true);\n await handleBook(paymentMethod, async (resData) => commitReservation(resData, await toPaymentPayload(paymentMethod)));\n return false;\n };\n\n const handleBook = async (paymentMethod: EBookingPaymentMethod, onSuccess?: FBookSuccessCallback): Promise<void> => {\n await book(\n await toPaymentPayload(paymentMethod),\n async (): Promise<boolean> => {\n try {\n if (paymentMethod === EBookingPaymentMethod.Card) await tokenizerRef.current.getTokenizedCode();\n return true;\n } catch (e) {\n return false;\n }\n },\n (validationResult) => {\n if (validationResult) {\n setDifferenceWarning(validationResult);\n }\n },\n onSuccess\n );\n };\n\n const handleChangePaymentMethod = async (paymentMethod: EBookingPaymentMethod) => {\n if (paymentMethod !== EBookingPaymentMethod.Planpay) {\n await rollbackReservation();\n }\n };\n\n return (\n <form>\n {isBackFromPlanpay ? (\n <LargeLoader />\n ) : (\n <>\n <div className=\"u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom--light\">\n <Headline bold={true}>{t(Translation.Step.Confirmation.GuestDetails)}</Headline>\n </div>\n <Text type={TextType.Small} color={Color.Success}>\n <strong>{t(Translation.Step.Confirmation.AlmostDone, { required: '*' })}</strong>\n </Text>\n </div>\n <RoomContactDetails />\n {source === 'inline' ? (\n <Alert type={AlertType.Accent2} heavyPadding={true}>\n <div className=\"u-flex u-w-100 flex-wrap flex-xl-nowrap\">\n <div>\n <Text color={Color.Accent} bold={true}>\n {t(Translation.Step.Confirmation.WantMoreRooms)}\n </Text>\n <Text color={Color.Navy}>{t(Translation.Step.Confirmation.YouCanAddAndEditRooms)}</Text>\n </div>\n <div className=\"d-flex align-items-center u-marg-top@xl-\">\n <BEButton filled={true} primary={true} icon={IconType.Add} iconPosition=\"left\" onClick={returnToPickRooms}>\n {t(Translation.Step.Confirmation.AddMoreRooms)}\n </BEButton>\n </div>\n </div>\n </Alert>\n ) : (\n <></>\n )}\n {ShowIATANumberOnCheckoutFeature.isActive() && (\n <>\n <div className=\"u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom\">\n <Headline bold={true}>Travel Agent</Headline>\n </div>\n\n <div className=\"u-marg-bottom--light\">\n <Text type={TextType.Small}>\n <strong>{t(Translation.Step.Confirmation.Inputs.IATANumber)}</strong>\n </Text>\n </div>\n <div className=\"u-marg-bottom--light\">\n <Text type={TextType.Small}>{t(Translation.Step.Confirmation.Inputs.IATANumberGuide)}</Text>\n </div>\n <TextBox placeholder={t(Translation.Step.Confirmation.Inputs.IATANumber)} wide={true} {...methods.register('IATANumber')} />\n </div>\n <LineBreak />\n </>\n )}\n <div className=\"u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom\">\n <Headline bold={true}>{t(Translation.Step.Confirmation.Comments)}</Headline>\n </div>\n <TextArea\n disabled={paymentMethod === EBookingPaymentMethod.Planpay}\n placeholder={t(Translation.Step.Confirmation.Inputs.EnterSpecialRequestsHere)}\n {...methods.register('comment')}\n />\n </div>\n <LineBreak />\n <div className=\"u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom\">\n <Headline bold>{t(Translation.Step.Confirmation.PaymentInformation)}</Headline>\n </div>\n <Controller\n control={methods.control}\n name=\"paymentMethod\"\n render={({ field: { onChange, value } }) => {\n return (\n <>\n <div>\n <RadioButtonGroup\n options={[\n {\n value: EBookingPaymentMethod.Card,\n label: (\n <div className=\"u-flex u-flex-align-center\">\n <div className=\"u-marg-right--light\">{t(Translation.Step.Confirmation.CardLabel)}</div>\n <AcceptablePaymentCard\n isDefault={(cardKey: any) => {\n return true;\n }}\n style={{\n height: 16,\n width: 24,\n borderRadius: 2.5,\n border: '0.5px solid #DFE1E5',\n marginRight: 4,\n }}\n />\n </div>\n ),\n renderContent: () => <StepConfirmationPaymentDetails ref={tokenizerRef} />,\n },\n {\n value: EBookingPaymentMethod.Planpay,\n label: (\n <div className=\"u-flex u-flex-align-center\">\n <div>{t(Translation.Step.Confirmation.PlanpayLabel)}</div>\n <div\n className=\"u-flex u-flex-align-center u-marg-left--light\"\n style={{\n background: '#e5c5ff',\n padding: '4px 8px',\n borderRadius: '24px',\n }}\n >\n <img height={8} src={RoomstayThemeEngine.getImageAssetUrl('planpay-logo-small.svg')} alt=\"\" />\n </div>\n {!methods.formState.isValid && (\n <Text\n color={Color.Graphite}\n className=\"u-flex u-flex-align-center\"\n style={{\n color: '#313131',\n fontSize: 10,\n }}\n >\n <Icon color={Color.DarkGrey} icon={IconType.Info} className=\"u-marg-right--lighter u-marg-left--light\" />\n {t(Translation.Step.Confirmation.PlanpayHelperText)}\n </Text>\n )}\n </div>\n ),\n disabled: !methods.formState.isValid,\n disabledReason: !methods.formState.isValid ? 'You must fill all the above details before proceeding with Planpay' : '',\n renderContent: () => <PlanpayPaymentMethod />,\n },\n ]\n .filter(({ value }) => hotel?.paymentMethods?.includes(value))\n .filter(\n ({ value }) =>\n value !== EBookingPaymentMethod.Planpay ||\n dayjs(basketContext.startDate).diff(dayjs(), 'day') > hotel?.planpay?.minDaysShowPlanpay\n )}\n value={value}\n onChange={async (code: EBookingPaymentMethod) => {\n onChange(code);\n await handleChangePaymentMethod(code);\n if (code === EBookingPaymentMethod.Planpay) {\n await handleBook(code);\n }\n }}\n />\n </div>\n </>\n );\n }}\n />\n <div className=\"u-marg-top u-flex align-items-center\">\n <div className=\"u-flex align-items-center justify-content-start\">\n <Icon icon={IconType.Lock} color={Color.Success} />\n <div className=\"u-marg-left--light\">\n <Text type={TextType.Small} color={Color.Success}>\n <strong>Secured</strong>\n </Text>\n </div>\n </div>\n <SSLSecureBadge />\n </div>\n </div>\n <LineBreak />\n <StepConfirmationPoliciesSection />\n <div className=\"u-pad-top--light u-marg-bottom\">\n <StepConfirmationPolicyBlock />\n </div>\n {ConfirmationVerifyFeature.isActive() && (\n <>\n <LineBreak />\n <div>\n <StepConfirmationAcknowledgement />\n </div>\n </>\n )}\n <div className=\"u-flex u-marg-top--heavy justify-content-end\">\n <NextStepButton\n disabled={paymentMethod === EBookingPaymentMethod.Planpay || isPaymentLoading}\n text={t(Translation.Step.Confirmation.ConfirmReservation)}\n history={null}\n isLoading={isLoading}\n currentStep={StepConfirmation}\n onClick={onNextStepClicked}\n />\n </div>\n </>\n )}\n\n <ErrorModal open={!!apiErrors} onClose={clearApiErrors}>\n <Text>{apiErrors}</Text>\n </ErrorModal>\n <StepConfirmationCheckoutDifferencesModal\n differences={differenceWarning.differences}\n warnings={differenceWarning.warnings}\n isLoading={isLoading}\n onClose={async () => {\n await rollbackReservation();\n history.push(StepRoom.getStepUrl());\n }}\n onProceed={async () => {\n if (paymentMethod === EBookingPaymentMethod.Planpay) {\n setDifferenceWarning({\n differences: [],\n warnings: [],\n });\n } else {\n await commitReservation(basketContext.reservationData, await toPaymentPayload(paymentMethod));\n }\n }}\n />\n </form>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"StepConfirmationForm.js","sourceRoot":"/","sources":["src/components/steps/confirmation/StepConfirmationForm.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,+BAA+B;AAC/B,iCAAoD;AACpD,0DAAmD;AACnD,0DAAuD;AACvD,kDAAyD;AACzD,sCAAmC;AACnC,qDAA6D;AAC7D,yFAAkF;AAClF,4DAAqD;AACrD,mHAA4G;AAC5G,8EAAuE;AACvE,iDAA+C;AAC/C,iDAAiE;AACjE,uDAA8D;AAC9D,8EAAuE;AACvE,qIAA8H;AAC9H,uDAA8C;AAC9C,oEAA6D;AAC7D,2GAAoG;AAEpG,mHAA4G;AAC5G,0DAAmD;AACnD,oDAA4D;AAC5D,oFAA6E;AAC7E,4DAAqD;AACrD,2FAAoF;AACpF,wDAAiD;AACjD,uGAAgG;AAChG,iEAA8D;AAE9D,qDAA8C;AAC9C,sGAA+F;AAC/F,+DAA+D;AAE/D,uEAAgE;AAChE,oGAA6F;AAC7F,yCAAwE;AACxE,2FAAoF;AACpF,8GAAuG;AACvG,uEAAgE;AAChE,2CAAkD;AAClD,+BAA+B;AAE/B,SAAwB,oBAAoB;IACxC,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,IAAA,gBAAQ,EAGvD;QACC,WAAW,EAAE,EAAE;QACf,QAAQ,EAAE,EAAE;KACf,CAAC,CAAC;IAEH,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,IAAA,gBAAQ,EAAC,EAAE,CAAC,CAAC;IAEzC,MAAM,EAAE,CAAC,EAAE,GAAG,IAAA,8BAAc,GAAE,CAAC;IAC/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EAAE,SAAS,EACpB,WAAW,EAAE,0BAAgB,EAC7B,OAAO,EAAE,iBAAiB,GAC5B,CACA,CACP,CACN;QAED,oBAAC,oBAAU,IAAC,IAAI,EAAE,CAAC,CAAC,SAAS,EAAE,OAAO,EAAE,cAAc;YAClD,oBAAC,cAAI,QAAE,SAAS,CAAQ,CACf;QACb,oBAAC,kDAAwC,IACrC,WAAW,EAAE,iBAAiB,CAAC,WAAW,EAC1C,QAAQ,EAAE,iBAAiB,CAAC,QAAQ,EACpC,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,GAAS,EAAE;gBAChB,MAAM,mBAAmB,EAAE,CAAC;gBAC5B,OAAO,CAAC,IAAI,CAAC,kBAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;YACxC,CAAC,CAAA,EACD,SAAS,EAAE,GAAS,EAAE;gBAClB,IAAI,aAAa,KAAK,4BAAqB,CAAC,OAAO,EAAE;oBACjD,oBAAoB,CAAC;wBACjB,WAAW,EAAE,EAAE;wBACf,QAAQ,EAAE,EAAE;qBACf,CAAC,CAAC;iBACN;qBAAM;oBACH,MAAM,iBAAiB,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC;iBAC1D;YACL,CAAC,CAAA,GACH,CACC,CACV,CAAC;AACN,CAAC;AAxUD,uCAwUC","sourcesContent":["import * as React from 'react';\nimport { useEffect, useRef, useState } from 'react';\nimport Headline from 'components/generic/Headline';\nimport { Translation } from 'translations/Translation';\nimport Text, { TextType } from 'components/generic/Text';\nimport { Color } from 'util/Color';\nimport { Controller, useFormContext } from 'react-hook-form';\nimport RoomContactDetails from 'components/steps/confirmation/RoomContactDetails';\nimport LineBreak from 'components/generic/LineBreak';\nimport StepConfirmationPoliciesSection from 'components/steps/confirmation/StepConfirmationPoliciesSection';\nimport NextStepButton from 'components/generic/buttons/NextStepButton';\nimport { useTranslation } from 'react-i18next';\nimport { useBasket, useBookingEngine } from '@frontend/contexts';\nimport Icon, { IconType } from 'components/generic/Icon/Icon';\nimport SSLSecureBadge from 'components/generic/badging/SSLSecureBadge';\nimport StepConfirmationCheckoutDifferencesModal from 'components/steps/confirmation/StepConfirmationCheckoutDifferencesModal';\nimport { useHistory } from 'react-router-dom';\nimport ErrorModal from 'components/generic/modal/ErrorModal';\nimport StepConfirmationPolicyBlock from 'components/steps/confirmation/StepConfirmationPolicyBlock';\n\nimport StepConfirmationAcknowledgement from 'components/steps/confirmation/StepConfirmationAcknowledgement';\nimport BEButton from 'components/generic/BEButton';\nimport Alert, { AlertType } from 'components/generic/Alert';\nimport StepConfirmation from 'pages/steps/StepConfirmation/StepConfirmation';\nimport StepRoom from 'pages/steps/StepRoom/StepRoom';\nimport ConfirmationVerifyFeature from 'providers/feature/ConfirmationVerifyFeature';\nimport TextBox from 'components/generic/TextBox';\nimport ShowIATANumberOnCheckoutFeature from 'providers/feature/ShowIATANumberOnCheckoutFeature';\nimport { PlanpayPaymentMethod } from './PlanpayPaymentMethod';\nimport { ConfirmationFormValues, FBookSuccessCallback } from 'models/Confirmation';\nimport TextArea from '../../generic/TextArea';\nimport { useConfirmationStep } from 'contexts/ConfirmationStepContext/ConfirmationStepContext';\nimport { useConfirmationQuery } from 'hooks/ConfirmationQuery';\nimport BasketRowDifferences from '../../../models/BasketRowDifferences';\nimport LargeLoader from 'components/generic/loader/LargeLoader';\nimport StepConfirmationPaymentDetails from './PaymentDetails/StepConfirmationPaymentDetails';\nimport { EBookingPaymentMethod, IBookingPayment } from '@roomstay/core';\nimport RadioButtonGroup from 'components/generic/RadioButtonGroup/RadioButtonGroup';\nimport AcceptablePaymentCard from 'components/steps/confirmation/PaymentDetails/AcceptablePaymentCard';\nimport RoomstayThemeEngine from 'providers/RoomstayThemeEngine';\nimport { useCurrentHotel } from '@frontend/hooks';\nimport * as dayjs from 'dayjs';\n\nexport default function StepConfirmationForm() {\n const [differenceWarning, setDifferenceWarning] = useState<{\n differences: BasketRowDifferences[];\n warnings: string[];\n }>({\n differences: [],\n warnings: [],\n });\n\n const [source, setSource] = useState('');\n\n const { t } = useTranslation();\n const { queryPaymentMethod, queryRoomstayId, queryPlanpayCheckoutId } = useConfirmationQuery();\n const context = useBookingEngine();\n const methods = useFormContext<ConfirmationFormValues>();\n const { isBackFromPlanpay, isLoading, apiErrors, clearApiErrors, book, rollbackReservation, commitReservation } = useConfirmationStep();\n const basketContext = useBasket();\n const tokenizerRef = useRef(null);\n const history = useHistory();\n const { hotel } = useCurrentHotel();\n\n const toPaymentPayload = async (paymentMethod: EBookingPaymentMethod): Promise<IBookingPayment> => {\n let payment: IBookingPayment;\n switch (paymentMethod) {\n case EBookingPaymentMethod.Planpay:\n const params = new URLSearchParams(window.location.search);\n params.set('roomstayId', '{{rsId}}');\n params.set('session', context.sessionProvider.getCurrentSessionID().toString());\n params.set('paymentMethod', EBookingPaymentMethod.Planpay);\n const redirectURL = `${window.location.origin}${window.location.pathname}${window.location.search}#/step/confirmation/?${params}`;\n payment = {\n Method: EBookingPaymentMethod.Planpay,\n PlanpayCheckoutId: queryPlanpayCheckoutId,\n RedirectUrl: redirectURL,\n };\n break;\n default:\n payment = {\n Method: EBookingPaymentMethod.Card,\n PaymentCard: await tokenizerRef.current.getTokenizedCode(),\n };\n }\n\n return payment;\n };\n\n useEffect(() => {\n const validatedPaymentMethod = Object.values(EBookingPaymentMethod).includes(queryPaymentMethod as EBookingPaymentMethod)\n ? (queryPaymentMethod as EBookingPaymentMethod)\n : EBookingPaymentMethod.Card;\n methods.setValue('paymentMethod', validatedPaymentMethod);\n handleChangePaymentMethod(validatedPaymentMethod);\n if (isBackFromPlanpay) {\n if (queryRoomstayId === basketContext.reservationData?.roomstayId) {\n onPlaypayCallback(validatedPaymentMethod);\n } else {\n rollbackReservation();\n }\n }\n return () => {\n if (!isBackFromPlanpay) rollbackReservation();\n };\n }, []);\n\n const onPlaypayCallback = async (paymentMethod: EBookingPaymentMethod) => {\n await commitReservation(basketContext.reservationData);\n };\n\n const paymentMethod = methods.watch('paymentMethod');\n\n context.engine\n .getSessionProvider()\n .getSession()\n .then((session) => {\n setSource(session.source);\n });\n\n const returnToPickRooms = async () => {\n // TODO: What if StepRoom doesn't exist?\n history.push(StepRoom.getStepUrl());\n };\n\n const onNextStepClicked = async () => {\n await handleBook(paymentMethod, async (resData) => commitReservation(resData));\n return false;\n };\n\n const handleBook = async (paymentMethod: EBookingPaymentMethod, onSuccess?: FBookSuccessCallback): Promise<void> => {\n await book(\n async () => toPaymentPayload(paymentMethod),\n async (): Promise<boolean> => {\n try {\n if (paymentMethod === EBookingPaymentMethod.Card) await tokenizerRef.current.getTokenizedCode();\n return true;\n } catch (e) {\n return false;\n }\n },\n (validationResult) => {\n if (validationResult) {\n setDifferenceWarning(validationResult);\n }\n },\n onSuccess\n );\n };\n\n const handleChangePaymentMethod = async (paymentMethod: EBookingPaymentMethod) => {\n if (paymentMethod !== EBookingPaymentMethod.Planpay) {\n await rollbackReservation();\n }\n };\n\n return (\n <form>\n {isBackFromPlanpay ? (\n <LargeLoader />\n ) : (\n <>\n <div className=\"u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom--light\">\n <Headline bold={true}>{t(Translation.Step.Confirmation.GuestDetails)}</Headline>\n </div>\n <Text type={TextType.Small} color={Color.Success}>\n <strong>{t(Translation.Step.Confirmation.AlmostDone, { required: '*' })}</strong>\n </Text>\n </div>\n <RoomContactDetails />\n {source === 'inline' ? (\n <Alert type={AlertType.Accent2} heavyPadding={true}>\n <div className=\"u-flex u-w-100 flex-wrap flex-xl-nowrap\">\n <div>\n <Text color={Color.Accent} bold={true}>\n {t(Translation.Step.Confirmation.WantMoreRooms)}\n </Text>\n <Text color={Color.Navy}>{t(Translation.Step.Confirmation.YouCanAddAndEditRooms)}</Text>\n </div>\n <div className=\"d-flex align-items-center u-marg-top@xl-\">\n <BEButton filled={true} primary={true} icon={IconType.Add} iconPosition=\"left\" onClick={returnToPickRooms}>\n {t(Translation.Step.Confirmation.AddMoreRooms)}\n </BEButton>\n </div>\n </div>\n </Alert>\n ) : (\n <></>\n )}\n {ShowIATANumberOnCheckoutFeature.isActive() && (\n <>\n <div className=\"u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom\">\n <Headline bold={true}>Travel Agent</Headline>\n </div>\n\n <div className=\"u-marg-bottom--light\">\n <Text type={TextType.Small}>\n <strong>{t(Translation.Step.Confirmation.Inputs.IATANumber)}</strong>\n </Text>\n </div>\n <div className=\"u-marg-bottom--light\">\n <Text type={TextType.Small}>{t(Translation.Step.Confirmation.Inputs.IATANumberGuide)}</Text>\n </div>\n <TextBox placeholder={t(Translation.Step.Confirmation.Inputs.IATANumber)} wide={true} {...methods.register('IATANumber')} />\n </div>\n <LineBreak />\n </>\n )}\n <div className=\"u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom\">\n <Headline bold={true}>{t(Translation.Step.Confirmation.Comments)}</Headline>\n </div>\n <TextArea\n disabled={paymentMethod === EBookingPaymentMethod.Planpay}\n placeholder={t(Translation.Step.Confirmation.Inputs.EnterSpecialRequestsHere)}\n {...methods.register('comment')}\n />\n </div>\n <LineBreak />\n <div className=\"u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom\">\n <Headline bold>{t(Translation.Step.Confirmation.PaymentInformation)}</Headline>\n </div>\n <Controller\n control={methods.control}\n name=\"paymentMethod\"\n render={({ field: { onChange, value } }) => {\n return (\n <>\n <div>\n <RadioButtonGroup\n options={[\n {\n value: EBookingPaymentMethod.Card,\n label: (\n <div className=\"u-flex u-flex-align-center\">\n <div className=\"u-marg-right--light\">{t(Translation.Step.Confirmation.CardLabel)}</div>\n <AcceptablePaymentCard\n isDefault={(cardKey: any) => {\n return true;\n }}\n style={{\n height: 16,\n width: 24,\n borderRadius: 2.5,\n border: '0.5px solid #DFE1E5',\n marginRight: 4,\n }}\n />\n </div>\n ),\n renderContent: () => <StepConfirmationPaymentDetails ref={tokenizerRef} />,\n },\n {\n value: EBookingPaymentMethod.Planpay,\n label: (\n <div className=\"u-flex u-flex-align-center\">\n <div>{t(Translation.Step.Confirmation.PlanpayLabel)}</div>\n <div\n className=\"u-flex u-flex-align-center u-marg-left--light\"\n style={{\n borderRadius: '24px',\n overflow: 'hidden',\n }}\n >\n <img height={16} src={RoomstayThemeEngine.getImageAssetUrl('planpay-logo-small.svg')} alt=\"\" />\n </div>\n {!methods.formState.isValid && (\n <Text\n color={Color.Graphite}\n className=\"u-flex u-flex-align-center\"\n style={{\n color: '#313131',\n fontSize: 10,\n }}\n >\n <Icon color={Color.DarkGrey} icon={IconType.Info} className=\"u-marg-right--lighter u-marg-left--light\" />\n {t(Translation.Step.Confirmation.PlanpayHelperText)}\n </Text>\n )}\n </div>\n ),\n disabled: !methods.formState.isValid,\n disabledReason: !methods.formState.isValid ? 'You must fill all the above details before proceeding with Planpay' : '',\n renderContent: () => <PlanpayPaymentMethod />,\n },\n ]\n .filter(({ value }) => hotel?.paymentMethods?.includes(value))\n .filter(\n ({ value }) =>\n value !== EBookingPaymentMethod.Planpay ||\n dayjs(basketContext.startDate).diff(dayjs(), 'day') > hotel?.planpay?.minDaysShowPlanpay\n )}\n value={value}\n onChange={async (code: EBookingPaymentMethod) => {\n onChange(code);\n await handleChangePaymentMethod(code);\n if (code === EBookingPaymentMethod.Planpay) {\n await handleBook(code);\n }\n }}\n />\n </div>\n </>\n );\n }}\n />\n <div className=\"u-marg-top u-flex align-items-center\">\n <div className=\"u-flex align-items-center justify-content-start\">\n <Icon icon={IconType.Lock} color={Color.Success} />\n <div className=\"u-marg-left--light\">\n <Text type={TextType.Small} color={Color.Success}>\n <strong>Secured</strong>\n </Text>\n </div>\n </div>\n <SSLSecureBadge />\n </div>\n </div>\n <LineBreak />\n <StepConfirmationPoliciesSection />\n <div className=\"u-pad-top--light u-marg-bottom\">\n <StepConfirmationPolicyBlock />\n </div>\n {ConfirmationVerifyFeature.isActive() && (\n <>\n <LineBreak />\n <div>\n <StepConfirmationAcknowledgement />\n </div>\n </>\n )}\n <div className=\"u-flex u-marg-top--heavy justify-content-end\">\n <NextStepButton\n disabled={paymentMethod === EBookingPaymentMethod.Planpay || isLoading}\n text={t(Translation.Step.Confirmation.ConfirmReservation)}\n history={null}\n isLoading={isLoading}\n currentStep={StepConfirmation}\n onClick={onNextStepClicked}\n />\n </div>\n </>\n )}\n\n <ErrorModal open={!!apiErrors} onClose={clearApiErrors}>\n <Text>{apiErrors}</Text>\n </ErrorModal>\n <StepConfirmationCheckoutDifferencesModal\n differences={differenceWarning.differences}\n warnings={differenceWarning.warnings}\n isLoading={isLoading}\n onClose={async () => {\n await rollbackReservation();\n history.push(StepRoom.getStepUrl());\n }}\n onProceed={async () => {\n if (paymentMethod === EBookingPaymentMethod.Planpay) {\n setDifferenceWarning({\n differences: [],\n warnings: [],\n });\n } else {\n await commitReservation(basketContext.reservationData);\n }\n }}\n />\n </form>\n );\n}\n"]}
|
|
@@ -36,9 +36,14 @@ const InactivityWindow = () => {
|
|
|
36
36
|
}, 300000); // 5 minutes
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
|
+
resetTimeout();
|
|
39
40
|
document.body.addEventListener('click', resetTimeout);
|
|
41
|
+
document.body.addEventListener('mouseover', resetTimeout);
|
|
42
|
+
document.body.addEventListener('keypress', resetTimeout);
|
|
40
43
|
return () => {
|
|
41
|
-
document.body.
|
|
44
|
+
document.body.removeEventListener('click', resetTimeout);
|
|
45
|
+
document.body.removeEventListener('mouseover', resetTimeout);
|
|
46
|
+
document.body.removeEventListener('keypress', resetTimeout);
|
|
42
47
|
clearTimeout(inactivityTimeout);
|
|
43
48
|
};
|
|
44
49
|
}, []);
|
|
@@ -48,21 +53,24 @@ const InactivityWindow = () => {
|
|
|
48
53
|
}
|
|
49
54
|
}, [isInactive]);
|
|
50
55
|
const onClose = () => {
|
|
56
|
+
setInactive(false);
|
|
57
|
+
};
|
|
58
|
+
const onReset = () => {
|
|
51
59
|
var _a;
|
|
52
60
|
setInactive(false);
|
|
53
61
|
switch (currentStep) {
|
|
54
62
|
case StepAddon_1.default:
|
|
55
63
|
history.push(StepRoom_1.default.getStepUrl());
|
|
64
|
+
break;
|
|
56
65
|
case StepConfirmation_1.default:
|
|
57
66
|
history.push(StepRoom_1.default.getStepUrl());
|
|
58
|
-
case StepRoom_1.default:
|
|
59
|
-
if (basketContext.selectedBasketRow) {
|
|
60
|
-
BookingAPI_1.default.Availability.invalidateAvailability(basketContext.selectedBasketRow, hotel.hotelID);
|
|
61
|
-
(_a = basketContext.selectedBasketRow) === null || _a === void 0 ? void 0 : _a.setStale(true);
|
|
62
|
-
basketContext.updateBasketRow(basketContext.selectedBasketRow);
|
|
63
|
-
}
|
|
64
67
|
break;
|
|
65
68
|
}
|
|
69
|
+
if (basketContext.selectedBasketRow) {
|
|
70
|
+
BookingAPI_1.default.Availability.invalidateAvailability(basketContext.selectedBasketRow, hotel.hotelID);
|
|
71
|
+
(_a = basketContext.selectedBasketRow) === null || _a === void 0 ? void 0 : _a.setStale(true);
|
|
72
|
+
basketContext.updateBasketRow(basketContext.selectedBasketRow);
|
|
73
|
+
}
|
|
66
74
|
};
|
|
67
75
|
return (React.createElement(SimpleModal_1.default, { size: SimpleModal_1.SimpleModalSize.ExtraSmall, open: isInactive, onClose: onClose, alignCenter: true },
|
|
68
76
|
React.createElement("div", { className: "u-pad--heavy inactivity-window" },
|
|
@@ -74,7 +82,7 @@ const InactivityWindow = () => {
|
|
|
74
82
|
React.createElement("div", { className: `u-marg-${screenSize > ScreenSize_1.default.Medium ? 'right' : 'bottom'}--light u-w-100` },
|
|
75
83
|
React.createElement(BEButton_1.default, { onClick: onClose, wide: true }, t(Translation_1.Translation.Step.Room.NoThanks))),
|
|
76
84
|
React.createElement("div", { className: "u-w-100" },
|
|
77
|
-
React.createElement(BEButton_1.default, { onClick:
|
|
85
|
+
React.createElement(BEButton_1.default, { onClick: onReset, wide: true, filled: true, primary: true }, t(Translation_1.Translation.Step.Room.Update)))))));
|
|
78
86
|
};
|
|
79
87
|
exports.default = InactivityWindow;
|
|
80
88
|
//# sourceMappingURL=InactivityWindow.js.map
|
|
@@ -1 +1 @@
|
|
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AAM,CAAC,CACzB,CACT,CACJ,CACJ,CACI,CACjB,CAAC;AACN,CAAC,CAAC;AAEF,kBAAe,gBAAgB,CAAC","sourcesContent":["import * as React from 'react';\nimport { useContext, useState, useEffect } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useHistory } from 'react-router-dom';\nimport API from 'api/BookingAPI';\nimport { BasketContext, BookingEngineContext } from '@frontend/contexts';\nimport { FullPageEngineContext } from '@frontend/contexts';\n\nimport { useCurrentHotel } from '@frontend/hooks';\n\nimport StepAddon from 'pages/steps/StepAddon/StepAddon';\nimport StepConfirmation from 'pages/steps/StepConfirmation/StepConfirmation';\nimport StepRoom from 'pages/steps/StepRoom/StepRoom';\nimport { Translation } from 'translations/Translation';\nimport DataLayer from 'util/DataLayer';\nimport ScreenSize from 'util/ScreenSize';\nimport BEButton from 'components/generic/BEButton';\nimport Headline from 'components/generic/Headline';\nimport SimpleModal, { SimpleModalSize } from 'components/generic/modal/SimpleModal';\nimport Text from 'components/generic/Text';\n\nconst InactivityWindow = () => {\n const { t } = useTranslation();\n\n const { currentStep } = useContext(FullPageEngineContext);\n const { screenSize } = useContext(BookingEngineContext);\n const basketContext = useContext(BasketContext);\n const { hotel } = useCurrentHotel();\n\n const history = useHistory();\n\n const [isInactive, setInactive] = useState(false);\n\n useEffect(() => {\n let inactivityTimeout: any;\n\n const resetTimeout = () => {\n clearTimeout(inactivityTimeout);\n\n if (!isInactive) {\n inactivityTimeout = setTimeout(() => {\n setInactive(true);\n }, 300000); // 5 minutes\n }\n };\n\n resetTimeout();\n\n document.body.addEventListener('click', resetTimeout);\n document.body.addEventListener('mouseover', resetTimeout);\n document.body.addEventListener('keypress', resetTimeout);\n\n return () => {\n document.body.removeEventListener('click', resetTimeout);\n document.body.removeEventListener('mouseover', resetTimeout);\n document.body.removeEventListener('keypress', resetTimeout);\n\n clearTimeout(inactivityTimeout);\n };\n }, []);\n\n useEffect(() => {\n if (isInactive) {\n DataLayer.instance.sendAwayWindowOpen();\n }\n }, [isInactive]);\n\n const onClose = () => {\n setInactive(false);\n };\n\n const onReset = () => {\n setInactive(false);\n\n switch (currentStep) {\n case StepAddon:\n history.push(StepRoom.getStepUrl());\n break;\n case StepConfirmation:\n history.push(StepRoom.getStepUrl());\n break;\n }\n\n if (basketContext.selectedBasketRow) {\n API.Availability.invalidateAvailability(basketContext.selectedBasketRow, hotel.hotelID);\n basketContext.selectedBasketRow?.setStale(true);\n basketContext.updateBasketRow(basketContext.selectedBasketRow);\n }\n };\n\n return (\n <SimpleModal size={SimpleModalSize.ExtraSmall} open={isInactive} onClose={onClose} alignCenter={true}>\n <div className=\"u-pad--heavy inactivity-window\">\n <div className=\"u-marg-bottom--heavy\">\n <Headline bold={true}>{t(Translation.Step.Room.YouHaveBeenAway)}</Headline>\n </div>\n <div className=\"u-marg-bottom--heavy\">\n <Text>{t(Translation.Step.Room.UpdateYourSearch)}</Text>\n </div>\n <div className=\"u-flex inactivity-buttons\">\n <div className={`u-marg-${screenSize > ScreenSize.Medium ? 'right' : 'bottom'}--light u-w-100`}>\n <BEButton onClick={onClose} wide={true}>\n {t(Translation.Step.Room.NoThanks)}\n </BEButton>\n </div>\n <div className=\"u-w-100\">\n <BEButton onClick={onReset} wide={true} filled={true} primary={true}>\n {t(Translation.Step.Room.Update)}\n </BEButton>\n </div>\n </div>\n </div>\n </SimpleModal>\n );\n};\n\nexport default InactivityWindow;\n"]}
|
|
@@ -4,9 +4,11 @@ const React = require("react");
|
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const contexts_1 = require("@frontend/contexts");
|
|
6
6
|
const BEButton_1 = require("components/generic/BEButton");
|
|
7
|
+
const ScreenSize_1 = require("util/ScreenSize");
|
|
7
8
|
function BookNowButton(props) {
|
|
8
9
|
const basketContext = (0, react_1.useContext)(contexts_1.BasketContext);
|
|
9
10
|
const [isLoading, setIsLoading] = (0, react_1.useState)(false);
|
|
11
|
+
const context = (0, react_1.useContext)(contexts_1.BookingEngineContext);
|
|
10
12
|
const ref = (0, react_1.useRef)(null);
|
|
11
13
|
const addRateOnClick = () => {
|
|
12
14
|
if (props.onAddToBasketOverride) {
|
|
@@ -22,7 +24,7 @@ function BookNowButton(props) {
|
|
|
22
24
|
}
|
|
23
25
|
};
|
|
24
26
|
return (React.createElement("span", { ref: ref },
|
|
25
|
-
React.createElement(BEButton_1.default, { isLoading: isLoading, name: "AddRateToCard", filled: props.isFilled, primary: true, mobileWidth: true, onClick: addRateOnClick }, props.buttonLabel)));
|
|
27
|
+
React.createElement(BEButton_1.default, { isLoading: isLoading, name: "AddRateToCard", filled: props.isFilled, primary: true, mobileWidth: true, wide: context.screenSize <= ScreenSize_1.default.Medium, onClick: addRateOnClick }, props.buttonLabel)));
|
|
26
28
|
}
|
|
27
29
|
exports.default = BookNowButton;
|
|
28
30
|
//# sourceMappingURL=BookNowButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BookNowButton.js","sourceRoot":"/","sources":["src/components/steps/room/roomDetails/roomRates/BookNowButton.tsx"],"names":[],"mappings":";;AAAA,+BAA+B;AAC/B,iCAAqD;AACrD,
|
|
1
|
+
{"version":3,"file":"BookNowButton.js","sourceRoot":"/","sources":["src/components/steps/room/roomDetails/roomRates/BookNowButton.tsx"],"names":[],"mappings":";;AAAA,+BAA+B;AAC/B,iCAAqD;AACrD,iDAAyE;AAEzE,0DAAmD;AACnD,gDAAyC;AAUzC,SAAwB,aAAa,CAAC,KAAyB;IAC3D,MAAM,aAAa,GAAG,IAAA,kBAAU,EAAC,wBAAa,CAAC,CAAC;IAChD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAClD,MAAM,OAAO,GAAG,IAAA,kBAAU,EAAC,+BAAoB,CAAC,CAAC;IAEjD,MAAM,GAAG,GAAG,IAAA,cAAM,EAAC,IAAI,CAAC,CAAC;IAEzB,MAAM,cAAc,GAAG,GAAG,EAAE;QACxB,IAAI,KAAK,CAAC,qBAAqB,EAAE;YAC7B,KAAK,CAAC,qBAAqB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;SAC3C;aAAM;YACH,YAAY,CAAC,IAAI,CAAC,CAAC;YAEnB,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;gBACxC,IAAI,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,OAAO,EAAE;oBACd,YAAY,CAAC,KAAK,CAAC,CAAC;iBACvB;YACL,CAAC,CAAC,CAAC;SACN;IACL,CAAC,CAAC;IAEF,OAAO,CACH,8BAAM,GAAG,EAAE,GAAG;QACV,oBAAC,kBAAQ,IACL,SAAS,EAAE,SAAS,EACpB,IAAI,EAAC,eAAe,EACpB,MAAM,EAAE,KAAK,CAAC,QAAQ,EACtB,OAAO,EAAE,IAAI,EACb,WAAW,EAAE,IAAI,EACjB,IAAI,EAAE,OAAO,CAAC,UAAU,IAAI,oBAAU,CAAC,MAAM,EAC7C,OAAO,EAAE,cAAc,IAEtB,KAAK,CAAC,WAAW,CACX,CACR,CACV,CAAC;AACN,CAAC;AApCD,gCAoCC","sourcesContent":["import * as React from 'react';\nimport { useContext, useRef, useState } from 'react';\nimport { BasketContext, BookingEngineContext } from '@frontend/contexts';\nimport { RoomRate } from 'models/Room/RoomRate';\nimport BEButton from 'components/generic/BEButton';\nimport ScreenSize from 'util/ScreenSize';\n\ninterface BookNowButtonProps {\n buttonLabel: string;\n rate: RoomRate;\n onAddToBasketOverride?: (rate: RoomRate) => void;\n\n isFilled?: boolean;\n}\n\nexport default function BookNowButton(props: BookNowButtonProps) {\n const basketContext = useContext(BasketContext);\n const [isLoading, setIsLoading] = useState(false);\n const context = useContext(BookingEngineContext);\n\n const ref = useRef(null);\n\n const addRateOnClick = () => {\n if (props.onAddToBasketOverride) {\n props.onAddToBasketOverride(props.rate);\n } else {\n setIsLoading(true);\n\n basketContext.addRate(props.rate).then(() => {\n if (ref?.current) {\n setIsLoading(false);\n }\n });\n }\n };\n\n return (\n <span ref={ref}>\n <BEButton\n isLoading={isLoading}\n name=\"AddRateToCard\"\n filled={props.isFilled}\n primary={true}\n mobileWidth={true}\n wide={context.screenSize <= ScreenSize.Medium}\n onClick={addRateOnClick}\n >\n {props.buttonLabel}\n </BEButton>\n </span>\n );\n}\n"]}
|
|
@@ -72,9 +72,7 @@ function RoomFilterPriceSlider(props) {
|
|
|
72
72
|
];
|
|
73
73
|
const handleBudgetChange = (newValue) => {
|
|
74
74
|
setRange(newValue.map((value) => value.value));
|
|
75
|
-
|
|
76
|
-
const handleBudgetCommittedChange = (event, newValue) => {
|
|
77
|
-
props.onChange(new BudgetFilter_1.default(newValue[0], newValue[1]));
|
|
75
|
+
props.onChange(new BudgetFilter_1.default(newValue[0].value, newValue[1].value));
|
|
78
76
|
};
|
|
79
77
|
const reset = () => {
|
|
80
78
|
setRange(rangeDefaults);
|
|
@@ -125,7 +123,10 @@ function RoomFilterPriceSlider(props) {
|
|
|
125
123
|
t(Translation_1.Translation.Misc.PerNight))),
|
|
126
124
|
React.createElement("div", null,
|
|
127
125
|
React.createElement(BEButton_1.default, { size: "tiny", isText: true, disabled: !props.filter, onClick: resetOnClickHandler }, t(Translation_1.Translation.Misc.Clear)))),
|
|
128
|
-
((_e = props.roomList) === null || _e === void 0 ? void 0 : _e.length) > 0 ? (React.createElement("div", { className: cx('roomstay-slider', {
|
|
126
|
+
((_e = props.roomList) === null || _e === void 0 ? void 0 : _e.length) > 0 ? (React.createElement("div", { className: cx('roomstay-slider', {
|
|
127
|
+
'--min-limit': peaksReached === 'left',
|
|
128
|
+
'--max-limit': peaksReached === 'right',
|
|
129
|
+
}) },
|
|
129
130
|
React.createElement(Slider_1.Slider, { min: rangeDefaults[0], max: rangeDefaults[1], onChange: handleBudgetChange,
|
|
130
131
|
// onChangeCommitted={handleBudgetCommittedChange}
|
|
131
132
|
// aria-labelledby="track-false-range-slider"
|