@roomstay/frontend 2.6.62 → 2.6.64
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/537.bundle.js +1 -1
- package/dist/839.bundle.js +1 -1
- package/dist/950.bundle.js +1 -1
- package/dist/978.bundle.js +1 -1
- package/dist/main.bundle.js +1 -1
- package/dist/src/api/BaseAPI.js +5 -10
- package/dist/src/api/BaseAPI.js.map +1 -1
- package/dist/src/api/ReservationAPI.d.ts +23 -3
- package/dist/src/api/ReservationAPI.js +75 -31
- package/dist/src/api/ReservationAPI.js.map +1 -1
- package/dist/src/components/User/Forms/ForgotPasswordForm.js +11 -5
- package/dist/src/components/User/Forms/ForgotPasswordForm.js.map +1 -1
- package/dist/src/components/User/Forms/SignInForm.js +5 -2
- package/dist/src/components/User/Forms/SignInForm.js.map +1 -1
- package/dist/src/components/User/Forms/SignUpForm.d.ts +5 -0
- package/dist/src/components/User/Forms/SignUpForm.js +27 -10
- package/dist/src/components/User/Forms/SignUpForm.js.map +1 -1
- package/dist/src/components/generic/date/DatePicker.js +1 -1
- package/dist/src/components/generic/date/DatePicker.js.map +1 -1
- package/dist/src/components/members/InlineSignUpSection.d.ts +7 -0
- package/dist/src/components/members/InlineSignUpSection.js +122 -0
- package/dist/src/components/members/InlineSignUpSection.js.map +1 -0
- package/dist/src/components/members/SignInModal/ExternalMemberModal.js +4 -4
- package/dist/src/components/members/SignInModal/ExternalMemberModal.js.map +1 -1
- package/dist/src/components/members/SignInModal/InternalMemberSignInModal.js +78 -33
- package/dist/src/components/members/SignInModal/InternalMemberSignInModal.js.map +1 -1
- package/dist/src/components/members/SignInModal/MemberSignInModal.js +11 -1
- package/dist/src/components/members/SignInModal/MemberSignInModal.js.map +1 -1
- package/dist/src/components/reservation/ReservationItem.js +1 -1
- package/dist/src/components/reservation/ReservationItem.js.map +1 -1
- package/dist/src/components/steps/addons/AddonCard.js +14 -14
- package/dist/src/components/steps/addons/AddonCard.js.map +1 -1
- package/dist/src/components/steps/confirmation/RoomContactDetails.js +12 -12
- package/dist/src/components/steps/confirmation/RoomContactDetails.js.map +1 -1
- package/dist/src/components/steps/room/AvailableUpgradesModal.js +1 -1
- package/dist/src/components/steps/room/AvailableUpgradesModal.js.map +1 -1
- package/dist/src/components/steps/room/LargeRoomCard.js +7 -0
- package/dist/src/components/steps/room/LargeRoomCard.js.map +1 -1
- package/dist/src/components/steps/room/roomDetails/RoomDetails.js +1 -1
- package/dist/src/components/steps/room/roomDetails/RoomDetails.js.map +1 -1
- package/dist/src/components/steps/room/roomDetails/RoomDetailsBedsBlock.js +12 -7
- package/dist/src/components/steps/room/roomDetails/RoomDetailsBedsBlock.js.map +1 -1
- package/dist/src/components/summary/BESummaryAddonRow.js +1 -1
- package/dist/src/components/summary/BESummaryAddonRow.js.map +1 -1
- package/dist/src/contexts/BasketContext/BasketContextType.d.ts +2 -5
- package/dist/src/contexts/BasketContext/BasketContextType.js.map +1 -1
- package/dist/src/contexts/BasketContext/BasketContextWrapper.js +48 -22
- package/dist/src/contexts/BasketContext/BasketContextWrapper.js.map +1 -1
- package/dist/src/contexts/CompanyContext/CompanyContextType.type.d.ts +1 -1
- package/dist/src/contexts/CompanyContext/CompanyContextType.type.js.map +1 -1
- package/dist/src/contexts/CompanyContext/CompanyContextWrapper.js +4 -0
- package/dist/src/contexts/CompanyContext/CompanyContextWrapper.js.map +1 -1
- package/dist/src/contexts/ConfirmationStepContext/ConfirmationStepContextWrapper.js +18 -18
- package/dist/src/contexts/ConfirmationStepContext/ConfirmationStepContextWrapper.js.map +1 -1
- package/dist/src/contexts/FullPageEngineContext/FullPageEngineContextTypes.d.ts +5 -4
- package/dist/src/contexts/FullPageEngineContext/FullPageEngineContextTypes.js.map +1 -1
- package/dist/src/contexts/FullPageEngineContext/FullPageEngineContextWrapper.js +35 -14
- package/dist/src/contexts/FullPageEngineContext/FullPageEngineContextWrapper.js.map +1 -1
- package/dist/src/contexts/Members/RoomstayMemberContext/RoomstayMemberContextProvider.js.map +1 -1
- package/dist/src/hooks/useSignedInMember.d.ts +1 -1
- package/dist/src/models/Addon/Addon.d.ts +6 -64
- package/dist/src/models/Addon/Addon.js +14 -28
- package/dist/src/models/Addon/Addon.js.map +1 -1
- package/dist/src/models/Api/HotelDTO.d.ts +1 -0
- package/dist/src/models/Api/HotelDTO.js.map +1 -1
- package/dist/src/models/AppQueryParameters.d.ts +2 -1
- package/dist/src/models/AppQueryParameters.js +1 -0
- package/dist/src/models/AppQueryParameters.js.map +1 -1
- package/dist/src/models/BasketAddonRow.js +3 -2
- package/dist/src/models/BasketAddonRow.js.map +1 -1
- package/dist/src/models/BasketRow.d.ts +1 -0
- package/dist/src/models/BasketRow.js.map +1 -1
- package/dist/src/models/Client/Hotel/Hotel.d.ts +4 -2
- package/dist/src/models/Client/Hotel/Hotel.js.map +1 -1
- package/dist/src/models/RoomstaySession.d.ts +1 -0
- package/dist/src/models/RoomstaySession.js.map +1 -1
- package/dist/src/models/UserProfile.d.ts +20 -20
- package/dist/src/models/UserProfile.js.map +1 -1
- package/dist/src/pages/account/Reservations/AccountReservationSinglePage.js +2 -2
- package/dist/src/pages/account/Reservations/AccountReservationSinglePage.js.map +1 -1
- package/dist/src/pages/steps/StepThanks/StepThanksComponent.js +6 -4
- package/dist/src/pages/steps/StepThanks/StepThanksComponent.js.map +1 -1
- package/dist/src/providers/CurrencyProvider.js +1 -1
- package/dist/src/providers/CurrencyProvider.js.map +1 -1
- package/dist/src/providers/feature/MemberPortalFeature.d.ts +7 -1
- package/dist/src/providers/feature/MemberPortalFeature.js +11 -0
- package/dist/src/providers/feature/MemberPortalFeature.js.map +1 -1
- package/dist/src/translations/Translation.d.ts +1 -0
- package/dist/src/translations/Translation.js +1 -0
- package/dist/src/translations/Translation.js.map +1 -1
- package/dist/src/translations/languages/en-gb.js +1 -0
- package/dist/src/translations/languages/en-gb.js.map +1 -1
- package/dist/src/util/Analytics/GoogleAnalytics4.d.ts +1 -1
- package/dist/src/util/Analytics/UniversalAnalytics.d.ts +1 -1
- package/dist/src/util/CurrencyHelper.js +1 -1
- package/dist/src/util/CurrencyHelper.js.map +1 -1
- package/dist/src/util/EventsHelper.js +1 -1
- package/dist/src/util/EventsHelper.js.map +1 -1
- package/dist/src/util/TotalCalculator.js +2 -2
- package/dist/src/util/TotalCalculator.js.map +1 -1
- package/dist/test.bundle.js +1 -1
- package/dist/vendors.bundle.js +1 -1
- package/package.json +3 -3
|
@@ -63,11 +63,20 @@ const InputGroup_1 = __importDefault(require("../../generic/InputGroup/InputGrou
|
|
|
63
63
|
const SimpleModal_1 = __importStar(require("../../generic/modal/SimpleModal"));
|
|
64
64
|
const Text_1 = __importStar(require("../../generic/Text"));
|
|
65
65
|
const TextBox_1 = __importDefault(require("../../generic/TextBox"));
|
|
66
|
+
const ForgotPasswordForm_1 = require("../../User/Forms/ForgotPasswordForm");
|
|
67
|
+
const SignInForm_1 = require("../../User/Forms/SignInForm");
|
|
68
|
+
const MemberPortalFeature_1 = __importDefault(require("../../../providers/feature/MemberPortalFeature"));
|
|
66
69
|
const ImageProvider_1 = __importStar(require("../../../providers/ImageProvider"));
|
|
67
70
|
const RoomstayThemeEngine_1 = __importDefault(require("../../../providers/RoomstayThemeEngine"));
|
|
68
71
|
const Color_1 = require("../../../util/Color");
|
|
69
72
|
const ScreenSize_1 = __importDefault(require("../../../util/ScreenSize"));
|
|
70
73
|
const Validation_1 = require("../../../util/Validation");
|
|
74
|
+
var EViewingScreen;
|
|
75
|
+
(function (EViewingScreen) {
|
|
76
|
+
EViewingScreen["SignUp"] = "SignUp";
|
|
77
|
+
EViewingScreen["SignIn"] = "SignIn";
|
|
78
|
+
EViewingScreen["ForgotPassword"] = "ForgotPassword";
|
|
79
|
+
})(EViewingScreen || (EViewingScreen = {}));
|
|
71
80
|
function InternalMemberSignInModal(props) {
|
|
72
81
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
73
82
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
@@ -76,6 +85,7 @@ function InternalMemberSignInModal(props) {
|
|
|
76
85
|
const { hotel } = (0, hooks_1.useCurrentHotel)();
|
|
77
86
|
const [isLoading, setIsLoading] = (0, react_1.useState)(false);
|
|
78
87
|
const [showErrors, setShowErrors] = (0, react_1.useState)(false);
|
|
88
|
+
const [viewingScreen, setViewingScreen] = (0, react_1.useState)(EViewingScreen.SignUp);
|
|
79
89
|
const [captchaScriptLoaded, setCaptchaScriptLoaded] = (0, react_1.useState)(false);
|
|
80
90
|
const [captchaRendered, setCaptchaRendered] = (0, react_1.useState)(false);
|
|
81
91
|
const [reCaptchaSecret, setReCaptchaSecret] = (0, react_1.useState)(null);
|
|
@@ -244,10 +254,31 @@ function InternalMemberSignInModal(props) {
|
|
|
244
254
|
const modalInputs = (_c = hotel === null || hotel === void 0 ? void 0 : hotel.memberOnlySignupInputs) !== null && _c !== void 0 ? _c : MemberOnlyModalDefaultInputs;
|
|
245
255
|
const loadingOnClose = () => {
|
|
246
256
|
setIsLoading(false);
|
|
257
|
+
setViewingScreen(EViewingScreen.SignUp);
|
|
247
258
|
if (props.onClose) {
|
|
248
259
|
props.onClose();
|
|
249
260
|
}
|
|
250
261
|
};
|
|
262
|
+
const handleSignInClick = () => {
|
|
263
|
+
setViewingScreen(EViewingScreen.SignIn);
|
|
264
|
+
};
|
|
265
|
+
const handleBackToSignUp = () => {
|
|
266
|
+
setViewingScreen(EViewingScreen.SignUp);
|
|
267
|
+
};
|
|
268
|
+
const handleSignInSuccess = () => {
|
|
269
|
+
var _a;
|
|
270
|
+
(_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
271
|
+
};
|
|
272
|
+
const handleForgotPasswordClick = () => {
|
|
273
|
+
setViewingScreen(EViewingScreen.ForgotPassword);
|
|
274
|
+
};
|
|
275
|
+
const handleBackToSignIn = () => {
|
|
276
|
+
setViewingScreen(EViewingScreen.SignIn);
|
|
277
|
+
};
|
|
278
|
+
const handlePasswordResetSuccess = () => {
|
|
279
|
+
var _a;
|
|
280
|
+
(_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
281
|
+
};
|
|
251
282
|
const buttonOnClickHandler = () => __awaiter(this, void 0, void 0, function* () {
|
|
252
283
|
yield methods.handleSubmit(onSubmit)();
|
|
253
284
|
setShowErrors(true);
|
|
@@ -269,39 +300,53 @@ function InternalMemberSignInModal(props) {
|
|
|
269
300
|
} }),
|
|
270
301
|
react_1.default.createElement("div", { className: "col-md-6" },
|
|
271
302
|
react_1.default.createElement("div", { className: "u-pad u-pad-heavy" },
|
|
272
|
-
react_1.default.createElement(
|
|
273
|
-
react_1.default.createElement(
|
|
274
|
-
|
|
275
|
-
react_1.default.createElement(
|
|
276
|
-
react_1.default.createElement(
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
react_1.default.createElement(
|
|
281
|
-
react_1.default.createElement(
|
|
282
|
-
|
|
283
|
-
react_1.default.createElement(
|
|
284
|
-
|
|
285
|
-
react_1.default.createElement(
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
required: input.isRequired,
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
react_1.default.createElement(
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
react_1.default.createElement(
|
|
303
|
+
viewingScreen === EViewingScreen.SignUp && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
304
|
+
react_1.default.createElement("div", { className: "u-marg-bottom-half" },
|
|
305
|
+
react_1.default.createElement(Icon_1.default, { icon: Icon_1.IconType.Money, size: "24px", color: modalPrimaryColor, useColorAsBackground: hotel === null || hotel === void 0 ? void 0 : hotel.memberOnlyModalUsePrimaryColor, backgroundColor: Color_1.Color.SuccessTint })),
|
|
306
|
+
react_1.default.createElement("div", { className: "u-marg-bottom-half" },
|
|
307
|
+
react_1.default.createElement(Headline_1.default, { bold: true, color: modalPrimaryColor },
|
|
308
|
+
react_1.default.createElement("div", { style: { color: modalPrimaryColor }, dangerouslySetInnerHTML: {
|
|
309
|
+
__html: modalTitle,
|
|
310
|
+
} }))),
|
|
311
|
+
react_1.default.createElement("div", { className: "u-marg-bottom" },
|
|
312
|
+
react_1.default.createElement(Text_1.default, { type: Text_1.TextType.Small, color: Color_1.Color.DarkGrey },
|
|
313
|
+
react_1.default.createElement("span", { dangerouslySetInnerHTML: { __html: modalSubtitle } }))),
|
|
314
|
+
react_1.default.createElement(react_hook_form_1.FormProvider, Object.assign({}, methods),
|
|
315
|
+
react_1.default.createElement("div", null, modalInputs.Lines.map((inputLine, lineIndex) => {
|
|
316
|
+
return (react_1.default.createElement("div", { className: "u-marg-bottom-xxx", key: lineIndex },
|
|
317
|
+
react_1.default.createElement(InputGroup_1.default, { dimensions: inputLine.Dimension }, inputLine.Inputs.map((input, inputIndex) => {
|
|
318
|
+
switch (input.type) {
|
|
319
|
+
case 'TextBox':
|
|
320
|
+
return (react_1.default.createElement(TextBox_1.default, Object.assign({ key: inputIndex, wide: true, placeholder: input.placeholder, required: input.isRequired, validationStatus: getValidationClass(input.name) }, register(input.name, {
|
|
321
|
+
required: input.isRequired,
|
|
322
|
+
validate: input.validate,
|
|
323
|
+
}))));
|
|
324
|
+
}
|
|
325
|
+
}))));
|
|
326
|
+
})),
|
|
327
|
+
react_1.default.createElement("div", { className: "u-marg-top--light", style: { marginBottom: '45px' } },
|
|
328
|
+
captchaScriptLoaded && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
329
|
+
captchaError && (react_1.default.createElement(Text_1.default, { type: Text_1.TextType.Label, color: Color_1.Color.Alert }, captchaError)),
|
|
330
|
+
react_1.default.createElement("div", { ref: captchaRef, className: "u-marg-bottom" }))),
|
|
331
|
+
react_1.default.createElement(BEButton_1.default, { size: "normal", filled: true, primary: hotel === null || hotel === void 0 ? void 0 : hotel.memberOnlyModalUsePrimaryColor, success: !(hotel === null || hotel === void 0 ? void 0 : hotel.memberOnlyModalUsePrimaryColor), isLoading: isLoading, stopIconAnimation: true, icon: context.screenSize > ScreenSize_1.default.Mobile ? Icon_1.IconType.ArrowRight : undefined, onClick: buttonOnClickHandler }, modalButtonText))),
|
|
332
|
+
react_1.default.createElement(Text_1.default, { type: Text_1.TextType.Label, color: Color_1.Color.DarkGrey },
|
|
333
|
+
react_1.default.createElement("span", { dangerouslySetInnerHTML: { __html: t(Translation_1.Translation.MemberOnlyPopup.AgreeToReceiveDeals, { companyShort: ccx === null || ccx === void 0 ? void 0 : ccx.companyShort }) } })),
|
|
334
|
+
' ',
|
|
335
|
+
react_1.default.createElement(Text_1.default, { type: Text_1.TextType.Label, color: Color_1.Color.DarkGrey },
|
|
336
|
+
react_1.default.createElement("span", { dangerouslySetInnerHTML: { __html: t(Translation_1.Translation.MemberOnlyPopup.UnsubscribeAnytime) } })),
|
|
337
|
+
MemberPortalFeature_1.default.isActive() && (react_1.default.createElement("div", { className: "u-marg-top--light" },
|
|
338
|
+
react_1.default.createElement(Text_1.default, { type: Text_1.TextType.Label, color: Color_1.Color.DarkGrey }, t(Translation_1.Translation.Step.Confirmation.AlreadyHaveAccount)),
|
|
339
|
+
' ',
|
|
340
|
+
react_1.default.createElement(Text_1.default, { type: Text_1.TextType.Label, color: Color_1.Color.DarkGrey },
|
|
341
|
+
react_1.default.createElement(BEButton_1.default, { isText: true, size: "tiny", textColor: modalPrimaryColor, onClick: handleSignInClick }, t(Translation_1.Translation.Navigation.SignIn.SignIn))))))),
|
|
342
|
+
viewingScreen === EViewingScreen.SignIn && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
343
|
+
react_1.default.createElement("div", { className: "u-marg-bottom" },
|
|
344
|
+
react_1.default.createElement(BEButton_1.default, { isText: true, size: "small", icon: Icon_1.IconType.ArrowLeft, iconPosition: "left", onClick: handleBackToSignUp }, "Back to sign up")),
|
|
345
|
+
react_1.default.createElement(SignInForm_1.SignInForm, { onSignedIn: handleSignInSuccess, onForgotPassword: handleForgotPasswordClick }))),
|
|
346
|
+
viewingScreen === EViewingScreen.ForgotPassword && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
347
|
+
react_1.default.createElement("div", { className: "u-marg-bottom" },
|
|
348
|
+
react_1.default.createElement(BEButton_1.default, { isText: true, size: "small", icon: Icon_1.IconType.ArrowLeft, iconPosition: "left", onClick: handleBackToSignIn }, "Back to sign in")),
|
|
349
|
+
react_1.default.createElement(ForgotPasswordForm_1.ForgotPasswordForm, { onPasswordReset: handlePasswordResetSuccess, onCancelled: handleBackToSignIn, onDone: handlePasswordResetSuccess }))))))));
|
|
305
350
|
}
|
|
306
351
|
exports.default = InternalMemberSignInModal;
|
|
307
352
|
//# sourceMappingURL=InternalMemberSignInModal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InternalMemberSignInModal.js","sourceRoot":"/","sources":["src/components/members/SignInModal/InternalMemberSignInModal.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA0E;AAC1E,6CAA4D;AAC5D,2CAA4D;AAC5D,wDAA0C;AAC1C,wDAAqD;AACrD,+CAAgF;AAChF,qDAAwD;AACxD,iDAA+C;AAC/C,0DAAuD;AAEvD,kEAAmC;AACnC,6EAAqD;AACrD,6EAAqD;AACrD,uEAAgE;AAChE,4FAAoE;AACpE,sFAAsF;AACtF,kEAA2D;AAC3D,2EAAmD;AAEnD,2EAAqE;AACrE,0FAAkE;AAClE,wCAAqC;AACrC,mEAA2C;AAC3C,kDAAgD;AAQhD,SAAwB,yBAAyB,CAAC,KAA6B;;IAC3E,MAAM,EAAE,CAAC,EAAE,GAAG,IAAA,8BAAc,GAAE,CAAC;IAE/B,MAAM,OAAO,GAAG,IAAA,kBAAU,EAAC,+BAAoB,CAAC,CAAC;IACjD,MAAM,GAAG,GAAG,IAAA,kBAAU,EAAC,yBAAc,CAAC,CAAC;IAEvC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AE,CAAC,CAAC,yBAAW,CAAC,eAAe,CAAC,kBAAkB,CAAC,EAAE,GAAS,CAClG,CACL,CACJ,CACJ,CACI,CACjB,CAAC;AACN,CAAC;AApUD,4CAoUC","sourcesContent":["import { BookingEngineContext, CompanyContext } from '@frontend/contexts';\nimport { MemberOnlyModalViewEvent } from '@frontend/events';\nimport { useCurrentHotel, useEvent } from '@frontend/hooks';\nimport * as Sentry from '@sentry/browser';\nimport { ErrorHandler } from 'contexts/ErrorContext';\nimport React, { useContext, useEffect, useMemo, useRef, useState } from 'react';\nimport { FormProvider, useForm } from 'react-hook-form';\nimport { useTranslation } from 'react-i18next';\nimport { Translation } from 'translations/Translation';\n\nimport API from '@/api/BookingAPI';\nimport BEButton from '@/components/generic/BEButton';\nimport Headline from '@/components/generic/Headline';\nimport Icon, { IconType } from '@/components/generic/Icon/Icon';\nimport InputGroup from '@/components/generic/InputGroup/InputGroup';\nimport SimpleModal, { SimpleModalSize } from '@/components/generic/modal/SimpleModal';\nimport Text, { TextType } from '@/components/generic/Text';\nimport TextBox from '@/components/generic/TextBox';\nimport { InternalMemberSignInInputs } from '@/components/members/SignInModal/InternalMemberSignInModal.types';\nimport ImageProvider, { ImageSize } from '@/providers/ImageProvider';\nimport RoomstayThemeEngine from '@/providers/RoomstayThemeEngine';\nimport { Color } from '@/util/Color';\nimport ScreenSize from '@/util/ScreenSize';\nimport { EMAIL_REGEX } from '@/util/Validation';\n\ninterface MemberSignInModalProps {\n onClose?: () => void;\n isOpen?: boolean;\n image?: string;\n}\n\nexport default function InternalMemberSignInModal(props: MemberSignInModalProps) {\n const { t } = useTranslation();\n\n const context = useContext(BookingEngineContext);\n const ccx = useContext(CompanyContext);\n\n const { hotel } = useCurrentHotel();\n\n const [isLoading, setIsLoading] = useState(false);\n const [showErrors, setShowErrors] = useState(false);\n\n const [captchaScriptLoaded, setCaptchaScriptLoaded] = useState(false);\n const [captchaRendered, setCaptchaRendered] = useState(false);\n const [reCaptchaSecret, setReCaptchaSecret] = useState<string | null>(null);\n const [captchaError, setCaptchaError] = useState<string | null | undefined>(null);\n\n const captchaRef = useRef(null);\n\n const shouldLoadCaptcha = !!hotel?.googleReCaptcha?.loadForMembers && !!hotel?.googleReCaptcha?.siteKey;\n\n const MemberOnlyModalDefaultInputs: InternalMemberSignInInputs = useMemo(() => {\n return {\n Lines: [\n {\n Dimension: '2/2',\n Inputs: [\n {\n name: 'FirstName',\n type: 'TextBox',\n placeholder: t(Translation.MemberOnlyPopup.Fields.FirstName),\n isRequired: true,\n },\n {\n name: 'LastName',\n type: 'TextBox',\n placeholder: t(Translation.MemberOnlyPopup.Fields.LastName),\n isRequired: true,\n },\n ],\n },\n {\n Dimension: '1',\n Inputs: [\n {\n name: 'Email',\n type: 'TextBox',\n placeholder: t(Translation.MemberOnlyPopup.Fields.Email.Label),\n isRequired: true,\n validate: (input: string) => {\n if (!input.match(EMAIL_REGEX)) {\n return t(Translation.MemberOnlyPopup.Fields.Email.Validation.Invalid) as string;\n }\n return true;\n },\n },\n ],\n },\n ],\n };\n }, []);\n\n const memberImage = useMemo(() => {\n if (props.image) {\n return props.image;\n }\n\n if (hotel?.heroImage) {\n return hotel?.heroImage;\n }\n }, [hotel?.heroImage]);\n\n const { raise } = useEvent();\n\n useEffect(() => {\n if (props.isOpen) {\n const event = new MemberOnlyModalViewEvent();\n raise(event);\n }\n }, [props.isOpen]);\n\n useEffect(() => {\n let cancelled = false;\n\n if (shouldLoadCaptcha) {\n RoomstayThemeEngine.loadScript('https://www.google.com/recaptcha/api.js', 'Google ReCaptcha').then(() => {\n try {\n (window as any).grecaptcha.ready(() => {\n if (!cancelled) {\n setCaptchaScriptLoaded(true);\n }\n });\n } catch (ex) {\n console.log('Captcha loaded too quickly, will try again');\n }\n });\n }\n\n return () => {\n cancelled = true;\n };\n }, [hotel]);\n\n useEffect(() => {\n if (shouldLoadCaptcha && captchaScriptLoaded && captchaRef?.current && !captchaRendered && props.isOpen) {\n try {\n setTimeout(() => {\n const captchaCallback = (secret: string) => {\n setReCaptchaSecret(secret);\n setCaptchaError(undefined);\n };\n\n (window as any).grecaptcha.render(captchaRef.current, {\n sitekey: hotel.googleReCaptcha?.siteKey,\n callback: captchaCallback,\n });\n\n setCaptchaRendered(true);\n }, 5);\n } catch (ex) {\n console.log(ex);\n\n Sentry.captureException(ex);\n }\n }\n }, [props.isOpen, captchaScriptLoaded, captchaRef, captchaRef?.current, captchaRendered]);\n\n useEffect(() => {\n if (!props.isOpen) {\n setReCaptchaSecret(null);\n setCaptchaError(null);\n setCaptchaRendered(false);\n }\n }, [props.isOpen]);\n\n const getValidationClass = (name: string) => {\n if (errors && (formState.touchedFields[name] || showErrors)) {\n if (errors[name]) {\n return 'error';\n } else {\n return 'success';\n }\n }\n };\n\n const methods = useForm({\n mode: 'onChange',\n });\n\n const { formState, register } = methods;\n const errors = methods.formState.errors;\n\n const onSubmit = async () => {\n if (shouldLoadCaptcha && (!reCaptchaSecret || reCaptchaSecret === '')) {\n setCaptchaError(t(Translation.MemberOnlyPopup.Errors.ReCaptcha.PleaseTick));\n return;\n }\n\n await signUpMember();\n };\n\n const signUpMember = async () => {\n setIsLoading(true);\n const { FirstName, LastName, Email, ...extra } = methods.getValues();\n\n if (!FirstName || !LastName || !Email) {\n setIsLoading(false);\n ErrorHandler.add({\n title: t(Translation.MemberOnlyPopup.Errors.RequiredFields.Title),\n message: t(Translation.MemberOnlyPopup.Errors.RequiredFields.Message),\n });\n\n return;\n }\n\n try {\n const extraFields = Object.keys(extra).map((extraFieldKey: string) => {\n return { name: extraFieldKey, value: extra[extraFieldKey] };\n });\n\n const response = await API.Member.addMember(FirstName, LastName, Email, extraFields, hotel?.hotelID as string, reCaptchaSecret as string);\n\n if (response.error) {\n setCaptchaError(t(Translation.MemberOnlyPopup.Errors.ReCaptcha.ValidationError));\n } else {\n await ccx.signUserIn({ saveState: true, memberNumber: Email, firstName: FirstName, lastName: LastName, email: Email });\n }\n } catch (e) {\n ErrorHandler.add({\n title: t(Translation.MemberOnlyPopup.Errors.SignupFailed.Title),\n message: t(Translation.MemberOnlyPopup.Errors.SignupFailed.Message),\n });\n } finally {\n setIsLoading(false);\n }\n };\n\n const modalInputs: InternalMemberSignInInputs = hotel?.memberOnlySignupInputs ?? MemberOnlyModalDefaultInputs;\n\n const loadingOnClose = () => {\n setIsLoading(false);\n if (props.onClose) {\n props.onClose();\n }\n };\n const buttonOnClickHandler = async () => {\n await methods.handleSubmit(onSubmit)();\n setShowErrors(true);\n\n return false;\n };\n\n const modalTitle =\n ccx?.memberOnlyModalPromotion?.memberOnlyModalTitle ??\n t(Translation.MemberOnlyPopup.Headline, {\n companyShort: ccx?.companyShort,\n });\n\n const modalSubtitle = ccx?.memberOnlyModalPromotion?.memberOnlyModalSubtitle ?? t(Translation.MemberOnlyPopup.Subtitle);\n const modalButtonText = ccx?.memberOnlyModalPromotion?.memberOnlyModalButtonText ?? t(Translation.MemberOnlyPopup.SubmitButtonText);\n const modalPrimaryColor = hotel?.memberOnlyModalUsePrimaryColor ? Color.Accent : Color.Success;\n\n return (\n <SimpleModal open={props.isOpen} onClose={loadingOnClose} size={SimpleModalSize.Normal} alignCenter>\n <div className=\"row\">\n <div\n className=\"col-md-6 u-mh-none\"\n style={{\n background: 'url(\"' + (memberImage && ImageProvider.resizeImage(memberImage, ImageSize.Original)) + '\")',\n backgroundRepeat: 'no-repeat',\n backgroundPosition: 'center',\n backgroundSize: 'cover',\n }}\n />\n <div className=\"col-md-6\">\n <div className=\"u-pad u-pad-heavy\">\n <div className=\"u-marg-bottom-half\">\n <Icon\n icon={IconType.Money}\n size=\"24px\"\n color={modalPrimaryColor}\n useColorAsBackground={hotel?.memberOnlyModalUsePrimaryColor}\n backgroundColor={Color.SuccessTint}\n />\n </div>\n <div className=\"u-marg-bottom-half\">\n <Headline bold color={modalPrimaryColor}>\n <div\n style={{ color: modalPrimaryColor }}\n dangerouslySetInnerHTML={{\n __html: modalTitle as string,\n }}\n ></div>\n </Headline>\n </div>\n <div className=\"u-marg-bottom\">\n <Text type={TextType.Small} color={Color.DarkGrey}>\n <span dangerouslySetInnerHTML={{ __html: modalSubtitle as string }}></span>\n </Text>\n </div>\n <FormProvider {...methods}>\n <div>\n {modalInputs.Lines.map((inputLine, lineIndex) => {\n return (\n <div className=\"u-marg-bottom-xxx\" key={lineIndex}>\n <InputGroup dimensions={inputLine.Dimension}>\n {inputLine.Inputs.map((input, inputIndex) => {\n switch (input.type) {\n case 'TextBox':\n return (\n <TextBox\n key={inputIndex}\n wide\n placeholder={input.placeholder}\n required={input.isRequired}\n validationStatus={getValidationClass(input.name)}\n {...register(input.name, {\n required: input.isRequired,\n validate: input.validate,\n })}\n />\n );\n }\n })}\n </InputGroup>\n </div>\n );\n })}\n </div>\n <div className=\"u-marg-top--light\" style={{ marginBottom: '45px' }}>\n {captchaScriptLoaded && (\n <>\n {captchaError && (\n <Text type={TextType.Label} color={Color.Alert}>\n {captchaError}\n </Text>\n )}\n <div ref={captchaRef} className=\"u-marg-bottom\"></div>\n </>\n )}\n <BEButton\n size=\"normal\"\n filled\n primary={hotel?.memberOnlyModalUsePrimaryColor}\n success={!hotel?.memberOnlyModalUsePrimaryColor}\n isLoading={isLoading}\n stopIconAnimation\n icon={context.screenSize > ScreenSize.Mobile ? IconType.ArrowRight : undefined}\n onClick={buttonOnClickHandler}\n >\n {modalButtonText}\n </BEButton>\n </div>\n </FormProvider>\n <Text type={TextType.Label} color={Color.DarkGrey}>\n <span dangerouslySetInnerHTML={{ __html: t(Translation.MemberOnlyPopup.AgreeToReceiveDeals, { companyShort: ccx?.companyShort }) }}></span>\n </Text>{' '}\n <Text type={TextType.Label} color={Color.DarkGrey}>\n <span dangerouslySetInnerHTML={{ __html: t(Translation.MemberOnlyPopup.UnsubscribeAnytime) }}></span>\n </Text>\n </div>\n </div>\n </div>\n </SimpleModal>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"InternalMemberSignInModal.js","sourceRoot":"/","sources":["src/components/members/SignInModal/InternalMemberSignInModal.ts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CAAC,SAAS,EAAE,YAAY,EAAC,MAAM,EAAC,OAAO,EAAE,kBAAkB,sBAE5F,CACT;wBACN,8BAAC,uBAAU,IAAC,UAAU,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,yBAAyB,GAAI,CAC7F,CACN;oBACA,aAAa,KAAK,cAAc,CAAC,cAAc,IAAI,CAChD;wBACI,uCAAK,SAAS,EAAC,eAAe;4BAC1B,8BAAC,kBAAQ,IAAC,MAAM,QAAC,IAAI,EAAC,OAAO,EAAC,IAAI,EAAE,eAAQ,CAAC,SAAS,EAAE,YAAY,EAAC,MAAM,EAAC,OAAO,EAAE,kBAAkB,sBAE5F,CACT;wBACN,8BAAC,uCAAkB,IAAC,eAAe,EAAE,0BAA0B,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,EAAE,0BAA0B,GAAI,CACzI,CACN,CACC,CACJ,CACJ,CACI,CACjB,CAAC;AACN,CAAC;AApYD,4CAoYC","sourcesContent":["import { BookingEngineContext, CompanyContext } from '@frontend/contexts';\nimport { MemberOnlyModalViewEvent } from '@frontend/events';\nimport { useCurrentHotel, useEvent } from '@frontend/hooks';\nimport * as Sentry from '@sentry/browser';\nimport { ErrorHandler } from 'contexts/ErrorContext';\nimport React, { useContext, useEffect, useMemo, useRef, useState } from 'react';\nimport { FormProvider, useForm } from 'react-hook-form';\nimport { useTranslation } from 'react-i18next';\nimport { Translation } from 'translations/Translation';\n\nimport API from '@/api/BookingAPI';\nimport BEButton from '@/components/generic/BEButton';\nimport Headline from '@/components/generic/Headline';\nimport Icon, { IconType } from '@/components/generic/Icon/Icon';\nimport InputGroup from '@/components/generic/InputGroup/InputGroup';\nimport SimpleModal, { SimpleModalSize } from '@/components/generic/modal/SimpleModal';\nimport Text, { TextType } from '@/components/generic/Text';\nimport TextBox from '@/components/generic/TextBox';\nimport { InternalMemberSignInInputs } from '@/components/members/SignInModal/InternalMemberSignInModal.types';\nimport { ForgotPasswordForm } from '@/components/User/Forms/ForgotPasswordForm';\nimport { SignInForm } from '@/components/User/Forms/SignInForm';\nimport MemberPortalFeature from '@/providers/feature/MemberPortalFeature';\nimport ImageProvider, { ImageSize } from '@/providers/ImageProvider';\nimport RoomstayThemeEngine from '@/providers/RoomstayThemeEngine';\nimport { Color } from '@/util/Color';\nimport ScreenSize from '@/util/ScreenSize';\nimport { EMAIL_REGEX } from '@/util/Validation';\n\ninterface MemberSignInModalProps {\n onClose?: () => void;\n isOpen?: boolean;\n image?: string;\n}\n\nenum EViewingScreen {\n SignUp = 'SignUp',\n SignIn = 'SignIn',\n ForgotPassword = 'ForgotPassword',\n}\n\nexport default function InternalMemberSignInModal(props: MemberSignInModalProps) {\n const { t } = useTranslation();\n\n const context = useContext(BookingEngineContext);\n const ccx = useContext(CompanyContext);\n\n const { hotel } = useCurrentHotel();\n\n const [isLoading, setIsLoading] = useState(false);\n const [showErrors, setShowErrors] = useState(false);\n const [viewingScreen, setViewingScreen] = useState<EViewingScreen>(EViewingScreen.SignUp);\n\n const [captchaScriptLoaded, setCaptchaScriptLoaded] = useState(false);\n const [captchaRendered, setCaptchaRendered] = useState(false);\n const [reCaptchaSecret, setReCaptchaSecret] = useState<string | null>(null);\n const [captchaError, setCaptchaError] = useState<string | null | undefined>(null);\n\n const captchaRef = useRef(null);\n\n const shouldLoadCaptcha = !!hotel?.googleReCaptcha?.loadForMembers && !!hotel?.googleReCaptcha?.siteKey;\n\n const MemberOnlyModalDefaultInputs: InternalMemberSignInInputs = useMemo(() => {\n return {\n Lines: [\n {\n Dimension: '2/2',\n Inputs: [\n {\n name: 'FirstName',\n type: 'TextBox',\n placeholder: t(Translation.MemberOnlyPopup.Fields.FirstName),\n isRequired: true,\n },\n {\n name: 'LastName',\n type: 'TextBox',\n placeholder: t(Translation.MemberOnlyPopup.Fields.LastName),\n isRequired: true,\n },\n ],\n },\n {\n Dimension: '1',\n Inputs: [\n {\n name: 'Email',\n type: 'TextBox',\n placeholder: t(Translation.MemberOnlyPopup.Fields.Email.Label),\n isRequired: true,\n validate: (input: string) => {\n if (!input.match(EMAIL_REGEX)) {\n return t(Translation.MemberOnlyPopup.Fields.Email.Validation.Invalid) as string;\n }\n return true;\n },\n },\n ],\n },\n ],\n };\n }, []);\n\n const memberImage = useMemo(() => {\n if (props.image) {\n return props.image;\n }\n\n if (hotel?.heroImage) {\n return hotel?.heroImage;\n }\n }, [hotel?.heroImage]);\n\n const { raise } = useEvent();\n\n useEffect(() => {\n if (props.isOpen) {\n const event = new MemberOnlyModalViewEvent();\n raise(event);\n }\n }, [props.isOpen]);\n\n useEffect(() => {\n let cancelled = false;\n\n if (shouldLoadCaptcha) {\n RoomstayThemeEngine.loadScript('https://www.google.com/recaptcha/api.js', 'Google ReCaptcha').then(() => {\n try {\n (window as any).grecaptcha.ready(() => {\n if (!cancelled) {\n setCaptchaScriptLoaded(true);\n }\n });\n } catch (ex) {\n console.log('Captcha loaded too quickly, will try again');\n }\n });\n }\n\n return () => {\n cancelled = true;\n };\n }, [hotel]);\n\n useEffect(() => {\n if (shouldLoadCaptcha && captchaScriptLoaded && captchaRef?.current && !captchaRendered && props.isOpen) {\n try {\n setTimeout(() => {\n const captchaCallback = (secret: string) => {\n setReCaptchaSecret(secret);\n setCaptchaError(undefined);\n };\n\n (window as any).grecaptcha.render(captchaRef.current, {\n sitekey: hotel.googleReCaptcha?.siteKey,\n callback: captchaCallback,\n });\n\n setCaptchaRendered(true);\n }, 5);\n } catch (ex) {\n console.log(ex);\n\n Sentry.captureException(ex);\n }\n }\n }, [props.isOpen, captchaScriptLoaded, captchaRef, captchaRef?.current, captchaRendered]);\n\n useEffect(() => {\n if (!props.isOpen) {\n setReCaptchaSecret(null);\n setCaptchaError(null);\n setCaptchaRendered(false);\n }\n }, [props.isOpen]);\n\n const getValidationClass = (name: string) => {\n if (errors && (formState.touchedFields[name] || showErrors)) {\n if (errors[name]) {\n return 'error';\n } else {\n return 'success';\n }\n }\n };\n\n const methods = useForm({\n mode: 'onChange',\n });\n\n const { formState, register } = methods;\n const errors = methods.formState.errors;\n\n const onSubmit = async () => {\n if (shouldLoadCaptcha && (!reCaptchaSecret || reCaptchaSecret === '')) {\n setCaptchaError(t(Translation.MemberOnlyPopup.Errors.ReCaptcha.PleaseTick));\n return;\n }\n\n await signUpMember();\n };\n\n const signUpMember = async () => {\n setIsLoading(true);\n const { FirstName, LastName, Email, ...extra } = methods.getValues();\n\n if (!FirstName || !LastName || !Email) {\n setIsLoading(false);\n ErrorHandler.add({\n title: t(Translation.MemberOnlyPopup.Errors.RequiredFields.Title),\n message: t(Translation.MemberOnlyPopup.Errors.RequiredFields.Message),\n });\n\n return;\n }\n\n try {\n const extraFields = Object.keys(extra).map((extraFieldKey: string) => {\n return { name: extraFieldKey, value: extra[extraFieldKey] };\n });\n\n const response = await API.Member.addMember(FirstName, LastName, Email, extraFields, hotel?.hotelID as string, reCaptchaSecret as string);\n\n if (response.error) {\n setCaptchaError(t(Translation.MemberOnlyPopup.Errors.ReCaptcha.ValidationError));\n } else {\n await ccx.signUserIn({ saveState: true, memberNumber: Email, firstName: FirstName, lastName: LastName, email: Email });\n }\n } catch (e) {\n ErrorHandler.add({\n title: t(Translation.MemberOnlyPopup.Errors.SignupFailed.Title),\n message: t(Translation.MemberOnlyPopup.Errors.SignupFailed.Message),\n });\n } finally {\n setIsLoading(false);\n }\n };\n\n const modalInputs: InternalMemberSignInInputs = hotel?.memberOnlySignupInputs ?? MemberOnlyModalDefaultInputs;\n\n const loadingOnClose = () => {\n setIsLoading(false);\n setViewingScreen(EViewingScreen.SignUp);\n if (props.onClose) {\n props.onClose();\n }\n };\n\n const handleSignInClick = () => {\n setViewingScreen(EViewingScreen.SignIn);\n };\n\n const handleBackToSignUp = () => {\n setViewingScreen(EViewingScreen.SignUp);\n };\n\n const handleSignInSuccess = () => {\n props.onClose?.();\n };\n\n const handleForgotPasswordClick = () => {\n setViewingScreen(EViewingScreen.ForgotPassword);\n };\n\n const handleBackToSignIn = () => {\n setViewingScreen(EViewingScreen.SignIn);\n };\n\n const handlePasswordResetSuccess = () => {\n props.onClose?.();\n };\n\n const buttonOnClickHandler = async () => {\n await methods.handleSubmit(onSubmit)();\n setShowErrors(true);\n\n return false;\n };\n\n const modalTitle =\n ccx?.memberOnlyModalPromotion?.memberOnlyModalTitle ??\n t(Translation.MemberOnlyPopup.Headline, {\n companyShort: ccx?.companyShort,\n });\n\n const modalSubtitle = ccx?.memberOnlyModalPromotion?.memberOnlyModalSubtitle ?? t(Translation.MemberOnlyPopup.Subtitle);\n const modalButtonText = ccx?.memberOnlyModalPromotion?.memberOnlyModalButtonText ?? t(Translation.MemberOnlyPopup.SubmitButtonText);\n const modalPrimaryColor = hotel?.memberOnlyModalUsePrimaryColor ? Color.Accent : Color.Success;\n\n return (\n <SimpleModal open={props.isOpen} onClose={loadingOnClose} size={SimpleModalSize.Normal} alignCenter>\n <div className=\"row\">\n <div\n className=\"col-md-6 u-mh-none\"\n style={{\n background: 'url(\"' + (memberImage && ImageProvider.resizeImage(memberImage, ImageSize.Original)) + '\")',\n backgroundRepeat: 'no-repeat',\n backgroundPosition: 'center',\n backgroundSize: 'cover',\n }}\n />\n <div className=\"col-md-6\">\n <div className=\"u-pad u-pad-heavy\">\n {viewingScreen === EViewingScreen.SignUp && (\n <>\n <div className=\"u-marg-bottom-half\">\n <Icon\n icon={IconType.Money}\n size=\"24px\"\n color={modalPrimaryColor}\n useColorAsBackground={hotel?.memberOnlyModalUsePrimaryColor}\n backgroundColor={Color.SuccessTint}\n />\n </div>\n <div className=\"u-marg-bottom-half\">\n <Headline bold color={modalPrimaryColor}>\n <div\n style={{ color: modalPrimaryColor }}\n dangerouslySetInnerHTML={{\n __html: modalTitle as string,\n }}\n ></div>\n </Headline>\n </div>\n <div className=\"u-marg-bottom\">\n <Text type={TextType.Small} color={Color.DarkGrey}>\n <span dangerouslySetInnerHTML={{ __html: modalSubtitle as string }}></span>\n </Text>\n </div>\n <FormProvider {...methods}>\n <div>\n {modalInputs.Lines.map((inputLine, lineIndex) => {\n return (\n <div className=\"u-marg-bottom-xxx\" key={lineIndex}>\n <InputGroup dimensions={inputLine.Dimension}>\n {inputLine.Inputs.map((input, inputIndex) => {\n switch (input.type) {\n case 'TextBox':\n return (\n <TextBox\n key={inputIndex}\n wide\n placeholder={input.placeholder}\n required={input.isRequired}\n validationStatus={getValidationClass(input.name)}\n {...register(input.name, {\n required: input.isRequired,\n validate: input.validate,\n })}\n />\n );\n }\n })}\n </InputGroup>\n </div>\n );\n })}\n </div>\n <div className=\"u-marg-top--light\" style={{ marginBottom: '45px' }}>\n {captchaScriptLoaded && (\n <>\n {captchaError && (\n <Text type={TextType.Label} color={Color.Alert}>\n {captchaError}\n </Text>\n )}\n <div ref={captchaRef} className=\"u-marg-bottom\"></div>\n </>\n )}\n <BEButton\n size=\"normal\"\n filled\n primary={hotel?.memberOnlyModalUsePrimaryColor}\n success={!hotel?.memberOnlyModalUsePrimaryColor}\n isLoading={isLoading}\n stopIconAnimation\n icon={context.screenSize > ScreenSize.Mobile ? IconType.ArrowRight : undefined}\n onClick={buttonOnClickHandler}\n >\n {modalButtonText}\n </BEButton>\n </div>\n </FormProvider>\n <Text type={TextType.Label} color={Color.DarkGrey}>\n <span dangerouslySetInnerHTML={{ __html: t(Translation.MemberOnlyPopup.AgreeToReceiveDeals, { companyShort: ccx?.companyShort }) }}></span>\n </Text>{' '}\n <Text type={TextType.Label} color={Color.DarkGrey}>\n <span dangerouslySetInnerHTML={{ __html: t(Translation.MemberOnlyPopup.UnsubscribeAnytime) }}></span>\n </Text>\n {MemberPortalFeature.isActive() && (\n <div className=\"u-marg-top--light\">\n <Text type={TextType.Label} color={Color.DarkGrey}>\n {t(Translation.Step.Confirmation.AlreadyHaveAccount)}\n </Text>{' '}\n <Text type={TextType.Label} color={Color.DarkGrey}>\n <BEButton isText size=\"tiny\" textColor={modalPrimaryColor} onClick={handleSignInClick}>\n {t(Translation.Navigation.SignIn.SignIn)}\n </BEButton>\n </Text>\n </div>\n )}\n </>\n )}\n {viewingScreen === EViewingScreen.SignIn && (\n <>\n <div className=\"u-marg-bottom\">\n {/* Todo: Translation */}\n <BEButton isText size=\"small\" icon={IconType.ArrowLeft} iconPosition=\"left\" onClick={handleBackToSignUp}>\n Back to sign up\n </BEButton>\n </div>\n <SignInForm onSignedIn={handleSignInSuccess} onForgotPassword={handleForgotPasswordClick} />\n </>\n )}\n {viewingScreen === EViewingScreen.ForgotPassword && (\n <>\n <div className=\"u-marg-bottom\">\n <BEButton isText size=\"small\" icon={IconType.ArrowLeft} iconPosition=\"left\" onClick={handleBackToSignIn}>\n Back to sign in\n </BEButton>\n </div>\n <ForgotPasswordForm onPasswordReset={handlePasswordResetSuccess} onCancelled={handleBackToSignIn} onDone={handlePasswordResetSuccess} />\n </>\n )}\n </div>\n </div>\n </div>\n </SimpleModal>\n );\n}\n"]}
|
|
@@ -82,7 +82,17 @@ const MemberSignInModal = () => {
|
|
|
82
82
|
}
|
|
83
83
|
else {
|
|
84
84
|
if (MemberPortalFeature_1.default.isActive()) {
|
|
85
|
-
|
|
85
|
+
if (MemberPortalFeature_1.default.shouldUseMemberPortalForMemberPricing()) {
|
|
86
|
+
// Users will need to create a full member portal account (with password and email verification) to
|
|
87
|
+
// access member pricing.
|
|
88
|
+
return react_1.default.createElement(UnauthenticatedUserModal_1.UnauthenticatedUserModal, { open: isSigningIn, onClose: closeMemberSignupModal });
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
// Because Member Portal is enabled, the internal member signin modal will show the option to sign
|
|
92
|
+
// in with an exististing account. But they won't be forced to set a password and verify their email
|
|
93
|
+
// to access the member prices.
|
|
94
|
+
return react_1.default.createElement(InternalMemberSignInModal_1.default, { image: memberLogo, isOpen: isSigningIn, onClose: closeMemberSignupModal });
|
|
95
|
+
}
|
|
86
96
|
}
|
|
87
97
|
else {
|
|
88
98
|
return react_1.default.createElement(InternalMemberSignInModal_1.default, { image: memberLogo, isOpen: isSigningIn, onClose: closeMemberSignupModal });
|
|
@@ -1 +1 @@
|
|
|
1
|
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,UAAU,cAAV,UAAU,GAAI,6BAAmB,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,EAC5E,MAAM,EAAE,WAAW,EACnB,SAAS,EAAE,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,MAAM,GAChC,CACL,CAAC;YACN,KAAK,mBAAY,CAAC,IAAI;gBAClB,OAAO,CACH,8BAAC,+BAAqB,IAClB,KAAK,EAAE,CAAC,CAAC,yBAAW,CAAC,mBAAmB,CAAC,SAAS,CAAC,EACnD,KAAK,EAAE,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,6BAAmB,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,EAC3E,MAAM,EAAE,WAAW,EACnB,SAAS,EAAE,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,MAAM,GAChC,CACL,CAAC;YACN,KAAK,mBAAY,CAAC,UAAU;gBACxB,OAAO,CACH,8BAAC,qCAA2B,IACxB,KAAK,EAAE,CAAC,CAAC,yBAAW,CAAC,mBAAmB,CAAC,eAAe,CAAC,EACzD,KAAK,EAAE,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,6BAAmB,CAAC,gBAAgB,CAAC,sBAAsB,CAAC,EACjF,MAAM,EAAE,WAAW,EACnB,SAAS,EAAE,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,OAAO,GACjC,CACL,CAAC;YACN;gBACI,OAAO,IAAI,CAAC;SACnB;KACJ;SAAM;QACH,IAAI,6BAAmB,CAAC,QAAQ,EAAE,EAAE;YAChC,OAAO,8BAAC,mDAAwB,IAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,sBAAsB,GAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"MemberSignInModal.js","sourceRoot":"/","sources":["src/components/members/SignInModal/MemberSignInModal.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAoD;AACpD,2CAAkD;AAClD,yCAA8C;AAC9C,+CAAmD;AACnD,iDAA+C;AAE/C,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AA9FW,QAAA,iBAAiB,qBA8F5B","sourcesContent":["import { CompanyContext } from '@frontend/contexts';\nimport { useCurrentHotel } from '@frontend/hooks';\nimport { EIntegration } from '@roomstay/core';\nimport React, { useContext, useMemo } from 'react';\nimport { useTranslation } from 'react-i18next';\n\nimport { UnauthenticatedUserModal } from '@/components/generic/modal/SigninModal/UnauthenticatedUserModal';\nimport { useSignedInMember } from '@/hooks/useSignedInMember';\nimport MemberPortalFeature from '@/providers/feature/MemberPortalFeature';\nimport RoomstayThemeEngine from '@/providers/RoomstayThemeEngine';\nimport { Translation } from '@/translations/Translation';\n\nimport EmailAndFullnameMemberModal from './EmailAndFullnameMemberModal';\nimport EmailPasswordMemberModal from './EmailPasswordMemberModal';\nimport FamilyNameMemberModal from './FamilyNameMemberModal';\nimport InternalMemberSignInModal from './InternalMemberSignInModal';\n\nexport const MemberSignInModal = () => {\n const { externalMemberType, isExternalMemberHotel } = useSignedInMember();\n const { isSigningIn, closeMemberSignupModal, memberOnlyModalPromotion } = useContext(CompanyContext);\n const { t } = useTranslation();\n const { hotel } = useCurrentHotel();\n\n const memberLogo = useMemo(() => {\n // Preference promotion first\n if (memberOnlyModalPromotion?.memberOnlyModalImage) {\n return memberOnlyModalPromotion.memberOnlyModalImage;\n }\n\n if (hotel?.memberOnlyModalImage) {\n return hotel.memberOnlyModalImage;\n }\n }, [hotel?.memberOnlyModalImage, memberOnlyModalPromotion?.memberOnlyModalImage]);\n\n const imageSize = useMemo(() => {\n // Preference promotion first\n if (memberOnlyModalPromotion?.memberOnlyModalImageSize) {\n return memberOnlyModalPromotion.memberOnlyModalImageSize;\n }\n\n if (hotel?.memberOnlyModalImageSize) {\n return hotel.memberOnlyModalImageSize;\n }\n }, [hotel?.memberOnlyModalImageSize, memberOnlyModalPromotion?.memberOnlyModalImageSize]);\n\n if (isExternalMemberHotel) {\n switch (externalMemberType) {\n case EIntegration.Big4:\n return (\n <FamilyNameMemberModal\n title={t(Translation.ExternalMemberPopup.Big4Title)}\n image={memberLogo ?? RoomstayThemeEngine.getImageAssetUrl('big4-login.svg')}\n isOpen={isSigningIn}\n imageSize={imageSize ?? 'none'}\n />\n );\n case EIntegration.RmsTop10:\n return (\n <FamilyNameMemberModal\n title={t(Translation.ExternalMemberPopup.Top10Title)}\n image={memberLogo ?? RoomstayThemeEngine.getImageAssetUrl('top10-login.svg')}\n isOpen={isSigningIn}\n imageSize={imageSize ?? 'none'}\n />\n );\n case EIntegration.Top10:\n return (\n <EmailPasswordMemberModal\n title={t(Translation.ExternalMemberPopup.Top10Title)}\n image={memberLogo ?? RoomstayThemeEngine.getImageAssetUrl('top10-login.svg')}\n isOpen={isSigningIn}\n imageSize={imageSize ?? 'none'}\n />\n );\n case EIntegration.Gday:\n return (\n <FamilyNameMemberModal\n title={t(Translation.ExternalMemberPopup.GDayTitle)}\n image={memberLogo ?? RoomstayThemeEngine.getImageAssetUrl('gday-login.svg')}\n isOpen={isSigningIn}\n imageSize={imageSize ?? 'none'}\n />\n );\n case EIntegration.Salesforce:\n return (\n <EmailAndFullnameMemberModal\n title={t(Translation.ExternalMemberPopup.SalesforceTitle)}\n image={memberLogo ?? RoomstayThemeEngine.getImageAssetUrl('salesforce-login.png')}\n isOpen={isSigningIn}\n imageSize={imageSize ?? 'cover'}\n />\n );\n default:\n return null;\n }\n } else {\n if (MemberPortalFeature.isActive()) {\n if (MemberPortalFeature.shouldUseMemberPortalForMemberPricing()) {\n // Users will need to create a full member portal account (with password and email verification) to\n // access member pricing.\n return <UnauthenticatedUserModal open={isSigningIn} onClose={closeMemberSignupModal} />;\n } else {\n // Because Member Portal is enabled, the internal member signin modal will show the option to sign\n // in with an exististing account. But they won't be forced to set a password and verify their email\n // to access the member prices.\n return <InternalMemberSignInModal image={memberLogo} isOpen={isSigningIn} onClose={closeMemberSignupModal} />;\n }\n } else {\n return <InternalMemberSignInModal image={memberLogo} isOpen={isSigningIn} onClose={closeMemberSignupModal} />;\n }\n }\n};\n"]}
|
|
@@ -129,7 +129,7 @@ const ReservationItem = (props) => {
|
|
|
129
129
|
const checkInDate = (0, dayjs_1.default)(itineraryItem.checkInDate);
|
|
130
130
|
const checkOutDate = (0, dayjs_1.default)(itineraryItem.checkOutDate);
|
|
131
131
|
const reservationOccupancy = itineraryItem.adults + ((itineraryItem === null || itineraryItem === void 0 ? void 0 : itineraryItem.children) || 0);
|
|
132
|
-
const cancelled = itineraryItem.status === core_1.
|
|
132
|
+
const cancelled = itineraryItem.status === core_1.EBookingStatus.Cancelled;
|
|
133
133
|
const colorProfile = (_a = itineraryItem === null || itineraryItem === void 0 ? void 0 : itineraryItem.hotel) === null || _a === void 0 ? void 0 : _a.colors;
|
|
134
134
|
return (react_1.default.createElement("div", { id: `reservation-${itineraryItem.id}`, className: (0, classnames_1.default)({ 'u-marg-bottom--heavy u-marg-bottom@m-': !disableMarginBottom }) },
|
|
135
135
|
showCancelledNotifications && cancelled && (react_1.default.createElement("div", { className: ReservationItem_module_scss_1.default['cancelledNotification'] },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReservationItem.js","sourceRoot":"/","sources":["src/components/reservation/ReservationItem.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA4G;AAC5G,yCAAgD;AAChD,4DAAoC;AACpC,kDAA0B;AAC1B,+CAAmD;AACnD,iDAAsD;AACtD,uDAAwC;AACxC,0DAAuD;AAEvD,uGAA+E;AAC/E,6EAAwE;AACxE,6EAAwE;AACxE,uEAAgE;AAChE,iFAAyD;AACzD,kEAA2D;AAC3D,oGAA4E;AAC5E,mCAA0C;AAC1C,iEAA8D;AAC9D,oGAA4E;AAC5E,6DAAsD;AACtD,wCAAoE;AACpE,sDAAwE;AACxE,mEAA2C;AAC3C,qEAA6C;AAC7C,wDAAiD;AACjD,mEAA2C;AAE3C,gGAAmD;AAEnD,IAAY,iBAKX;AALD,WAAY,iBAAiB;IACzB,gDAA2B,CAAA;IAC3B,4CAAuB,CAAA;IACvB,sCA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;YACJ,uCAAK,SAAS,EAAC,oBAAoB;gBAC/B,8BAAC,gCAAsB,IAAC,eAAe,EAAE,qBAAqB,EAAE,aAAa,EAAE,aAAa,GAAI,CAC9F,CACA,CACb,CACC,CACT,CAAC;AACN,CAAC,CAAC;AAEF,kBAAe,eAAe,CAAC","sourcesContent":["import { BookingEngineContext, IRoomstayMemberBookingItemWithRefAndHotelDetails } from '@frontend/contexts';\nimport { IBookingStatus } from '@roomstay/core';\nimport classNames from 'classnames';\nimport dayjs from 'dayjs';\nimport React, { useContext, useMemo } from 'react';\nimport { Trans, useTranslation } from 'react-i18next';\nimport { Link } from 'react-router-dom';\nimport { Translation } from 'translations/Translation';\n\nimport EventCarouselContainer from '@/components/Event/EventCarouselContainer';\nimport BEButton, { BEButtonProps } from '@/components/generic/BEButton';\nimport Headline, { HeadlineProps } from '@/components/generic/Headline';\nimport Icon, { IconType } from '@/components/generic/Icon/Icon';\nimport NoPrint from '@/components/generic/print/NoPrint';\nimport Text, { TextType } from '@/components/generic/Text';\nimport ImageGallerySlider from '@/components/steps/room/ImageGallerySlider';\nimport { useCurrentHotel } from '@/hooks';\nimport { AccountRoutes } from '@/pages/account/AccountRoutes';\nimport ModifyBookingFeature from '@/providers/feature/ModifyBookingFeature';\nimport { ImageSize } from '@/providers/ImageProvider';\nimport { Color, getAccentOverrideStyleContent } from '@/util/Color';\nimport { isCancelledBooking, isPastBooking } from '@/util/EventsHelper';\nimport ScreenSize from '@/util/ScreenSize';\nimport StepManager from '@/util/StepManager';\nimport { TextAlign } from '@/util/TextAlignment';\nimport TimeHelper from '@/util/TimeHelper';\n\nimport styles from './ReservationItem.module.scss';\n\nexport enum ReservationAction {\n MoreDetails = 'MoreDetails',\n BookAgain = 'BookAgain',\n Cancel = 'Cancel',\n Modify = 'Modify',\n}\n\nexport type ReservationItemProps = {\n itineraryItem: IRoomstayMemberBookingItemWithRefAndHotelDetails;\n disableMarginBottom?: boolean;\n actions?: ReservationAction[];\n showCancelledNotifications?: boolean;\n onActionClick?: (action: ReservationAction, item: IRoomstayMemberBookingItemWithRefAndHotelDetails) => void;\n defaultEventsExpanded?: boolean;\n};\n\nconst defaultActions: ReservationAction[] = [ReservationAction.MoreDetails];\n\nconst ReservationItem = (props: ReservationItemProps) => {\n const { itineraryItem, disableMarginBottom, actions = defaultActions, showCancelledNotifications = false, defaultEventsExpanded } = props;\n\n // no events should be shown on “Past Stays” or “Cancelled Stays”\n const hideEvents = isCancelledBooking(itineraryItem) || isPastBooking(itineraryItem);\n\n const { t } = useTranslation();\n const context = useContext(BookingEngineContext);\n const { hotel } = useCurrentHotel();\n\n const isMobile = context.screenSize <= ScreenSize.Large;\n\n const nameSize: HeadlineProps['size'] = isMobile ? 'normal' : 'large';\n\n const CheckinCheckoutComponent = ({ translation, value }: { translation: string; value: string }) => {\n const TextContainer = isMobile ? Text : Headline;\n\n const time = useMemo(() => {\n // Using timeHelper to convert 24hr to 12hr\n return TimeHelper.convert24To12hr(value);\n }, [value]);\n\n return (\n <TextContainer>\n {t(translation)} {time}\n </TextContainer>\n );\n };\n\n const renderActions = () =>\n actions.map((action, index) => {\n const defaultButtonProps: BEButtonProps = {\n mobileWidth: true,\n rounded: true,\n wide: isMobile,\n key: index,\n className: classNames({\n 'u-marg-right@m': index === 0,\n }),\n };\n\n const onActionClick = () => {\n if (props.onActionClick) {\n props.onActionClick(action, itineraryItem);\n }\n };\n\n /**\n * Only renders Cancel/Modify if the booking is NOT cancelled\n */\n if (cancelled && [ReservationAction.Cancel, ReservationAction.Modify].includes(action)) {\n return;\n }\n\n /**\n * Only renders BookAgain if booking IS cancelled\n */\n if (!cancelled && action === ReservationAction.BookAgain) {\n return;\n }\n\n switch (action) {\n case ReservationAction.Modify:\n return ModifyBookingFeature.isActive() ? (\n <BEButton {...defaultButtonProps} icon={IconType.ArrowRight} iconPosition=\"right\" onClick={onActionClick} disabled={!itineraryItem.isCancellable}>\n {t(Translation.Reservation.ModifyThisRoom)}\n </BEButton>\n ) : null;\n case ReservationAction.Cancel:\n return (\n <BEButton {...defaultButtonProps} danger onClick={onActionClick} disabled={!itineraryItem.isCancellable}>\n {t(Translation.Reservation.CancelReservation)}\n </BEButton>\n );\n case ReservationAction.BookAgain:\n return (\n <Link to={StepManager.getFirstStep().getStepUrl()} key={index}>\n <BEButton {...defaultButtonProps} icon={IconType.ArrowRight} iconPosition=\"right\" onClick={onActionClick}>\n {t(Translation.Reservation.BookAgain)}\n </BEButton>\n </Link>\n );\n case ReservationAction.MoreDetails:\n return (\n <Link to={`${AccountRoutes.SingleReservation.path}${itineraryItem.bookingId}/item`} key={index}>\n <BEButton {...defaultButtonProps} primary filled icon={IconType.ArrowRight} iconPosition=\"right\">\n {t(Translation.Reservation.MoreDetails)}\n </BEButton>\n </Link>\n );\n }\n });\n\n if (!itineraryItem) {\n return <></>;\n }\n\n const itineraryItemNights = Object.keys(itineraryItem.nights);\n\n const checkInDate = dayjs(itineraryItem.checkInDate);\n const checkOutDate = dayjs(itineraryItem.checkOutDate);\n\n const reservationOccupancy = itineraryItem.adults + (itineraryItem?.children || 0);\n\n const cancelled = itineraryItem.status === IBookingStatus.Cancelled;\n\n const colorProfile = itineraryItem?.hotel?.colors;\n\n return (\n <div id={`reservation-${itineraryItem.id}`} className={classNames({ 'u-marg-bottom--heavy u-marg-bottom@m-': !disableMarginBottom })}>\n {showCancelledNotifications && cancelled && (\n <div className={styles['cancelledNotification']}>\n <div className={styles['cancelledNotification-icon']}>\n <Icon icon={IconType.Error} size=\"44px\" color={Color.Danger} />\n </div>\n <div>\n <Text type={TextType.Small} bold color={Color.Danger} className={styles['cancelledNotification-title']}>\n {t(Translation.Reservation.Notification.ThisRoomIsCancelled.Title)}\n </Text>\n <Trans\n i18nKey={Translation.Reservation.Notification.ThisRoomIsCancelled.Detail}\n components={[<Link key={0} to={AccountRoutes.Help.path} style={{ color: Color.Accent }}></Link>]}\n />\n </div>\n </div>\n )}\n <div className=\"reservation-item-container\">\n {!!colorProfile && (\n <style>\n {`\n #reservation-${itineraryItem.id} {\n ${getAccentOverrideStyleContent(colorProfile)}\n }\n `}\n </style>\n )}\n\n <div className=\"reservation-item\">\n <div className={classNames('reservation-item--image u-border-rounded u-print-none', { 'reservation-item--disabled': cancelled })}>\n <ImageGallerySlider images={itineraryItem.images} imageSize={ImageSize.Medium} />\n <div className=\"reservation-item--floating-date\">\n <Headline size=\"extra-large\" color={cancelled ? Color.DarkGrey : Color.White} align={TextAlign.Center}>\n {checkInDate.format('DD')}\n </Headline>\n <Text type={TextType.Small} color={cancelled ? Color.DarkGrey : Color.White} bold>\n {checkInDate.format('MMM YYYY')}\n </Text>\n </div>\n </div>\n\n <div className=\"reservation-item--content u-pad--heavy u-pad-left-none@m- u-pad-right-none@m- u-pad-bottom-none@m- u-print-pad-left-none\">\n <div className=\"reservation-item--content-title u-marg-bottom--light\">\n {hotel?.hotelID !== itineraryItem.hotelId && (\n <Text color={Color.Accent} size={nameSize} bold>\n {itineraryItem.hotel.name}\n </Text>\n )}\n <Headline bold size={nameSize}>\n {itineraryItem.roomName}\n </Headline>\n </div>\n <div className=\"text-body u-marg-bottom\">{(itineraryItem?.profile?.firstName ?? '') + ' ' + (itineraryItem?.profile?.lastName ?? '')}</div>\n <div className=\"reservation-item--info u-marg-bottom--heavy\">\n <div className=\"u-flex u-flex-gap--light\">\n <div className=\"u-flex u-flex-nowrap u-flex-gap--light\">\n <Icon icon={IconType.Calendar} color={Color.Grey} />\n <Text type={TextType.Small}>{checkInDate.format('D MMM, YYYY')}</Text>\n </div>\n <div className=\"u-flex u-flex-nowrap u-flex-gap--light\">\n <Icon icon={IconType.ArrowRight2} color={Color.Grey} />\n <Text type={TextType.Small}>{checkOutDate.format('D MMM, YYYY')}</Text>\n </div>\n </div>\n <div className=\"u-flex u-flex-gap\">\n <div className=\"u-flex u-flex-nowrap u-flex-gap--light\">\n <Icon icon={IconType.LateCheckout} color={Color.Grey} />\n <Text type={TextType.Small}>{`${itineraryItemNights.length} night${itineraryItemNights.length > 1 ? 's' : ''}`}</Text>\n </div>\n <div className=\"u-flex u-flex-nowrap u-flex-gap--light\">\n <Icon icon={IconType.Person} color={Color.Grey} />\n <Text type={TextType.Small}>{`${reservationOccupancy} guest${reservationOccupancy > 1 ? 's' : ''}`}</Text>\n </div>\n </div>\n </div>\n <div className=\"reservation-item--checkin-checkout u-flex justify-content-start u-pad u-border-rounded\">\n <div className=\"u-marg-right--heavy\">\n <Text type={TextType.Small} color={Color.DarkGrey} className=\"u-marg-bottom--light\">\n {t(Translation.Misc.CheckIn)}\n </Text>\n <CheckinCheckoutComponent translation={Translation.Reservation.After} value={itineraryItem?.hotel?.checkInTime} />\n </div>\n <div>\n <Text type={TextType.Small} color={Color.DarkGrey} className=\"u-marg-bottom--light\">\n {t(Translation.Misc.CheckOut)}\n </Text>\n <CheckinCheckoutComponent translation={Translation.Reservation.Before} value={itineraryItem?.hotel?.checkOutTime} />\n </div>\n </div>\n <div className=\"reservation-item--actions u-flex justify-content-start u-print-none u-marg-top--heavy\">{renderActions()}</div>\n </div>\n </div>\n </div>\n\n {hideEvents ? null : (\n <NoPrint>\n <div className=\"u-marg-top--medium\">\n <EventCarouselContainer defaultExpanded={defaultEventsExpanded} itineraryItem={itineraryItem} />\n </div>\n </NoPrint>\n )}\n </div>\n );\n};\n\nexport default ReservationItem;\n"]}
|
|
1
|
+
{"version":3,"file":"ReservationItem.js","sourceRoot":"/","sources":["src/components/reservation/ReservationItem.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA4G;AAC5G,yCAAgD;AAChD,4DAAoC;AACpC,kDAA0B;AAC1B,+CAAmD;AACnD,iDAAsD;AACtD,uDAAwC;AACxC,0DAAuD;AAEvD,uGAA+E;AAC/E,6EAAwE;AACxE,6EAAwE;AACxE,uEAAgE;AAChE,iFAAyD;AACzD,kEAA2D;AAC3D,oGAA4E;AAC5E,mCAA0C;AAC1C,iEAA8D;AAC9D,oGAA4E;AAC5E,6DAAsD;AACtD,wCAAo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K,0CAAE,YAAY,GAAI,CAClH,CACJ;oBACN,uCAAK,SAAS,EAAC,uFAAuF,IAAE,aAAa,EAAE,CAAO,CAC5H,CACJ,CACJ;QAEL,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CACjB,8BAAC,iBAAO;YACJ,uCAAK,SAAS,EAAC,oBAAoB;gBAC/B,8BAAC,gCAAsB,IAAC,eAAe,EAAE,qBAAqB,EAAE,aAAa,EAAE,aAAa,GAAI,CAC9F,CACA,CACb,CACC,CACT,CAAC;AACN,CAAC,CAAC;AAEF,kBAAe,eAAe,CAAC","sourcesContent":["import { BookingEngineContext, IRoomstayMemberBookingItemWithRefAndHotelDetails } from '@frontend/contexts';\nimport { EBookingStatus } from '@roomstay/core';\nimport classNames from 'classnames';\nimport dayjs from 'dayjs';\nimport React, { useContext, useMemo } from 'react';\nimport { Trans, useTranslation } from 'react-i18next';\nimport { Link } from 'react-router-dom';\nimport { Translation } from 'translations/Translation';\n\nimport EventCarouselContainer from '@/components/Event/EventCarouselContainer';\nimport BEButton, { BEButtonProps } from '@/components/generic/BEButton';\nimport Headline, { HeadlineProps } from '@/components/generic/Headline';\nimport Icon, { IconType } from '@/components/generic/Icon/Icon';\nimport NoPrint from '@/components/generic/print/NoPrint';\nimport Text, { TextType } from '@/components/generic/Text';\nimport ImageGallerySlider from '@/components/steps/room/ImageGallerySlider';\nimport { useCurrentHotel } from '@/hooks';\nimport { AccountRoutes } from '@/pages/account/AccountRoutes';\nimport ModifyBookingFeature from '@/providers/feature/ModifyBookingFeature';\nimport { ImageSize } from '@/providers/ImageProvider';\nimport { Color, getAccentOverrideStyleContent } from '@/util/Color';\nimport { isCancelledBooking, isPastBooking } from '@/util/EventsHelper';\nimport ScreenSize from '@/util/ScreenSize';\nimport StepManager from '@/util/StepManager';\nimport { TextAlign } from '@/util/TextAlignment';\nimport TimeHelper from '@/util/TimeHelper';\n\nimport styles from './ReservationItem.module.scss';\n\nexport enum ReservationAction {\n MoreDetails = 'MoreDetails',\n BookAgain = 'BookAgain',\n Cancel = 'Cancel',\n Modify = 'Modify',\n}\n\nexport type ReservationItemProps = {\n itineraryItem: IRoomstayMemberBookingItemWithRefAndHotelDetails;\n disableMarginBottom?: boolean;\n actions?: ReservationAction[];\n showCancelledNotifications?: boolean;\n onActionClick?: (action: ReservationAction, item: IRoomstayMemberBookingItemWithRefAndHotelDetails) => void;\n defaultEventsExpanded?: boolean;\n};\n\nconst defaultActions: ReservationAction[] = [ReservationAction.MoreDetails];\n\nconst ReservationItem = (props: ReservationItemProps) => {\n const { itineraryItem, disableMarginBottom, actions = defaultActions, showCancelledNotifications = false, defaultEventsExpanded } = props;\n\n // no events should be shown on “Past Stays” or “Cancelled Stays”\n const hideEvents = isCancelledBooking(itineraryItem) || isPastBooking(itineraryItem);\n\n const { t } = useTranslation();\n const context = useContext(BookingEngineContext);\n const { hotel } = useCurrentHotel();\n\n const isMobile = context.screenSize <= ScreenSize.Large;\n\n const nameSize: HeadlineProps['size'] = isMobile ? 'normal' : 'large';\n\n const CheckinCheckoutComponent = ({ translation, value }: { translation: string; value: string }) => {\n const TextContainer = isMobile ? Text : Headline;\n\n const time = useMemo(() => {\n // Using timeHelper to convert 24hr to 12hr\n return TimeHelper.convert24To12hr(value);\n }, [value]);\n\n return (\n <TextContainer>\n {t(translation)} {time}\n </TextContainer>\n );\n };\n\n const renderActions = () =>\n actions.map((action, index) => {\n const defaultButtonProps: BEButtonProps = {\n mobileWidth: true,\n rounded: true,\n wide: isMobile,\n key: index,\n className: classNames({\n 'u-marg-right@m': index === 0,\n }),\n };\n\n const onActionClick = () => {\n if (props.onActionClick) {\n props.onActionClick(action, itineraryItem);\n }\n };\n\n /**\n * Only renders Cancel/Modify if the booking is NOT cancelled\n */\n if (cancelled && [ReservationAction.Cancel, ReservationAction.Modify].includes(action)) {\n return;\n }\n\n /**\n * Only renders BookAgain if booking IS cancelled\n */\n if (!cancelled && action === ReservationAction.BookAgain) {\n return;\n }\n\n switch (action) {\n case ReservationAction.Modify:\n return ModifyBookingFeature.isActive() ? (\n <BEButton {...defaultButtonProps} icon={IconType.ArrowRight} iconPosition=\"right\" onClick={onActionClick} disabled={!itineraryItem.isCancellable}>\n {t(Translation.Reservation.ModifyThisRoom)}\n </BEButton>\n ) : null;\n case ReservationAction.Cancel:\n return (\n <BEButton {...defaultButtonProps} danger onClick={onActionClick} disabled={!itineraryItem.isCancellable}>\n {t(Translation.Reservation.CancelReservation)}\n </BEButton>\n );\n case ReservationAction.BookAgain:\n return (\n <Link to={StepManager.getFirstStep().getStepUrl()} key={index}>\n <BEButton {...defaultButtonProps} icon={IconType.ArrowRight} iconPosition=\"right\" onClick={onActionClick}>\n {t(Translation.Reservation.BookAgain)}\n </BEButton>\n </Link>\n );\n case ReservationAction.MoreDetails:\n return (\n <Link to={`${AccountRoutes.SingleReservation.path}${itineraryItem.bookingId}/item`} key={index}>\n <BEButton {...defaultButtonProps} primary filled icon={IconType.ArrowRight} iconPosition=\"right\">\n {t(Translation.Reservation.MoreDetails)}\n </BEButton>\n </Link>\n );\n }\n });\n\n if (!itineraryItem) {\n return <></>;\n }\n\n const itineraryItemNights = Object.keys(itineraryItem.nights);\n\n const checkInDate = dayjs(itineraryItem.checkInDate);\n const checkOutDate = dayjs(itineraryItem.checkOutDate);\n\n const reservationOccupancy = itineraryItem.adults + (itineraryItem?.children || 0);\n\n const cancelled = itineraryItem.status === EBookingStatus.Cancelled;\n\n const colorProfile = itineraryItem?.hotel?.colors;\n\n return (\n <div id={`reservation-${itineraryItem.id}`} className={classNames({ 'u-marg-bottom--heavy u-marg-bottom@m-': !disableMarginBottom })}>\n {showCancelledNotifications && cancelled && (\n <div className={styles['cancelledNotification']}>\n <div className={styles['cancelledNotification-icon']}>\n <Icon icon={IconType.Error} size=\"44px\" color={Color.Danger} />\n </div>\n <div>\n <Text type={TextType.Small} bold color={Color.Danger} className={styles['cancelledNotification-title']}>\n {t(Translation.Reservation.Notification.ThisRoomIsCancelled.Title)}\n </Text>\n <Trans\n i18nKey={Translation.Reservation.Notification.ThisRoomIsCancelled.Detail}\n components={[<Link key={0} to={AccountRoutes.Help.path} style={{ color: Color.Accent }}></Link>]}\n />\n </div>\n </div>\n )}\n <div className=\"reservation-item-container\">\n {!!colorProfile && (\n <style>\n {`\n #reservation-${itineraryItem.id} {\n ${getAccentOverrideStyleContent(colorProfile)}\n }\n `}\n </style>\n )}\n\n <div className=\"reservation-item\">\n <div className={classNames('reservation-item--image u-border-rounded u-print-none', { 'reservation-item--disabled': cancelled })}>\n <ImageGallerySlider images={itineraryItem.images} imageSize={ImageSize.Medium} />\n <div className=\"reservation-item--floating-date\">\n <Headline size=\"extra-large\" color={cancelled ? Color.DarkGrey : Color.White} align={TextAlign.Center}>\n {checkInDate.format('DD')}\n </Headline>\n <Text type={TextType.Small} color={cancelled ? Color.DarkGrey : Color.White} bold>\n {checkInDate.format('MMM YYYY')}\n </Text>\n </div>\n </div>\n\n <div className=\"reservation-item--content u-pad--heavy u-pad-left-none@m- u-pad-right-none@m- u-pad-bottom-none@m- u-print-pad-left-none\">\n <div className=\"reservation-item--content-title u-marg-bottom--light\">\n {hotel?.hotelID !== itineraryItem.hotelId && (\n <Text color={Color.Accent} size={nameSize} bold>\n {itineraryItem.hotel.name}\n </Text>\n )}\n <Headline bold size={nameSize}>\n {itineraryItem.roomName}\n </Headline>\n </div>\n <div className=\"text-body u-marg-bottom\">{(itineraryItem?.profile?.firstName ?? '') + ' ' + (itineraryItem?.profile?.lastName ?? '')}</div>\n <div className=\"reservation-item--info u-marg-bottom--heavy\">\n <div className=\"u-flex u-flex-gap--light\">\n <div className=\"u-flex u-flex-nowrap u-flex-gap--light\">\n <Icon icon={IconType.Calendar} color={Color.Grey} />\n <Text type={TextType.Small}>{checkInDate.format('D MMM, YYYY')}</Text>\n </div>\n <div className=\"u-flex u-flex-nowrap u-flex-gap--light\">\n <Icon icon={IconType.ArrowRight2} color={Color.Grey} />\n <Text type={TextType.Small}>{checkOutDate.format('D MMM, YYYY')}</Text>\n </div>\n </div>\n <div className=\"u-flex u-flex-gap\">\n <div className=\"u-flex u-flex-nowrap u-flex-gap--light\">\n <Icon icon={IconType.LateCheckout} color={Color.Grey} />\n <Text type={TextType.Small}>{`${itineraryItemNights.length} night${itineraryItemNights.length > 1 ? 's' : ''}`}</Text>\n </div>\n <div className=\"u-flex u-flex-nowrap u-flex-gap--light\">\n <Icon icon={IconType.Person} color={Color.Grey} />\n <Text type={TextType.Small}>{`${reservationOccupancy} guest${reservationOccupancy > 1 ? 's' : ''}`}</Text>\n </div>\n </div>\n </div>\n <div className=\"reservation-item--checkin-checkout u-flex justify-content-start u-pad u-border-rounded\">\n <div className=\"u-marg-right--heavy\">\n <Text type={TextType.Small} color={Color.DarkGrey} className=\"u-marg-bottom--light\">\n {t(Translation.Misc.CheckIn)}\n </Text>\n <CheckinCheckoutComponent translation={Translation.Reservation.After} value={itineraryItem?.hotel?.checkInTime} />\n </div>\n <div>\n <Text type={TextType.Small} color={Color.DarkGrey} className=\"u-marg-bottom--light\">\n {t(Translation.Misc.CheckOut)}\n </Text>\n <CheckinCheckoutComponent translation={Translation.Reservation.Before} value={itineraryItem?.hotel?.checkOutTime} />\n </div>\n </div>\n <div className=\"reservation-item--actions u-flex justify-content-start u-print-none u-marg-top--heavy\">{renderActions()}</div>\n </div>\n </div>\n </div>\n\n {hideEvents ? null : (\n <NoPrint>\n <div className=\"u-marg-top--medium\">\n <EventCarouselContainer defaultExpanded={defaultEventsExpanded} itineraryItem={itineraryItem} />\n </div>\n </NoPrint>\n )}\n </div>\n );\n};\n\nexport default ReservationItem;\n"]}
|
|
@@ -28,6 +28,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
const contexts_1 = require("../../../contexts/index.js");
|
|
30
30
|
const hooks_1 = require("../../../hooks/index.js");
|
|
31
|
+
const core_1 = require("@roomstay/core");
|
|
31
32
|
const classnames_1 = __importDefault(require("classnames"));
|
|
32
33
|
const Check_1 = __importDefault(require("icons/Check"));
|
|
33
34
|
const react_1 = __importStar(require("react"));
|
|
@@ -38,7 +39,6 @@ const Headline_1 = __importDefault(require("../../generic/Headline"));
|
|
|
38
39
|
const NumberIncrement_1 = __importDefault(require("../../generic/NumberIncrement"));
|
|
39
40
|
const Select_1 = require("../../generic/Select/Select");
|
|
40
41
|
const Text_1 = __importStar(require("../../generic/Text"));
|
|
41
|
-
const Addon_1 = require("../../../models/Addon/Addon");
|
|
42
42
|
const ImageProvider_1 = __importStar(require("../../../providers/ImageProvider"));
|
|
43
43
|
const Translation_1 = require("../../../translations/Translation");
|
|
44
44
|
const Color_1 = require("../../../util/Color");
|
|
@@ -129,31 +129,31 @@ const AddonCard = ({ addon, className }) => {
|
|
|
129
129
|
},
|
|
130
130
|
{
|
|
131
131
|
name: Translation_1.Translation.Step.Date.Adult_plural,
|
|
132
|
-
enabled: (priceInfo === null || priceInfo === void 0 ? void 0 : priceInfo.adultPrice) && addon.pricingType !==
|
|
132
|
+
enabled: (priceInfo === null || priceInfo === void 0 ? void 0 : priceInfo.adultPrice) && addon.pricingType !== core_1.EAddonPricingType.PER_ALL_PERSONS && addon.pricingType !== core_1.EAddonPricingType.PER_ALL_PERSONS_PER_NIGHT,
|
|
133
133
|
element: react_1.default.createElement(NumberIncrement_1.default, { number: adultQuantity, min: 0, max: priceInfo.quantity - childQuantity, onChange: setAdultsQuantityOnChange }),
|
|
134
134
|
},
|
|
135
135
|
{
|
|
136
136
|
name: Translation_1.Translation.Step.Date.Child_plural,
|
|
137
|
-
enabled: (priceInfo === null || priceInfo === void 0 ? void 0 : priceInfo.childPrice) && addon.pricingType !==
|
|
137
|
+
enabled: (priceInfo === null || priceInfo === void 0 ? void 0 : priceInfo.childPrice) && addon.pricingType !== core_1.EAddonPricingType.PER_ALL_PERSONS && addon.pricingType !== core_1.EAddonPricingType.PER_ALL_PERSONS_PER_NIGHT,
|
|
138
138
|
element: react_1.default.createElement(NumberIncrement_1.default, { number: childQuantity, min: 0, max: priceInfo.quantity - adultQuantity, onChange: setChildQuantityOnChange }),
|
|
139
139
|
},
|
|
140
140
|
];
|
|
141
141
|
const pricingTypeSuffix = (() => {
|
|
142
142
|
switch (addon.pricingType) {
|
|
143
|
-
case
|
|
143
|
+
case core_1.EAddonPricingType.PER_STAY:
|
|
144
144
|
return t(Translation_1.Translation.Misc.QTY);
|
|
145
|
-
case
|
|
145
|
+
case core_1.EAddonPricingType.PER_PERSON:
|
|
146
146
|
return t(Translation_1.Translation.Misc.Person);
|
|
147
|
-
case
|
|
148
|
-
case
|
|
147
|
+
case core_1.EAddonPricingType.PER_PERSON_OCCUPANCY_PER_NIGHT:
|
|
148
|
+
case core_1.EAddonPricingType.PER_PERSON_PER_NIGHT:
|
|
149
149
|
return t(Translation_1.Translation.Misc.PersonPerNight);
|
|
150
|
-
case
|
|
151
|
-
case
|
|
150
|
+
case core_1.EAddonPricingType.PER_ADULT_OCCUPANCY_PER_NIGHT:
|
|
151
|
+
case core_1.EAddonPricingType.PER_CHILD_OCCUPANCY_PER_NIGHT:
|
|
152
152
|
return t(Translation_1.Translation.Misc.AdultPerNight);
|
|
153
|
-
case
|
|
154
|
-
case
|
|
153
|
+
case core_1.EAddonPricingType.PER_NIGHT:
|
|
154
|
+
case core_1.EAddonPricingType.PER_QUANTITY_NAME_PER_NIGHT:
|
|
155
155
|
return t(Translation_1.Translation.Misc.Night);
|
|
156
|
-
case
|
|
156
|
+
case core_1.EAddonPricingType.PER_ROOM_QUANTITY_PER_NIGHT:
|
|
157
157
|
return t(Translation_1.Translation.Misc.PerRoomDay);
|
|
158
158
|
}
|
|
159
159
|
})();
|
|
@@ -201,7 +201,7 @@ const AddonCard = ({ addon, className }) => {
|
|
|
201
201
|
react_1.default.createElement(Text_1.default, { type: Text_1.TextType.Small, color: Color_1.Color.DarkGrey, inline: true, className: "u-marg-left--light u-clear-font-weight" },
|
|
202
202
|
"/",
|
|
203
203
|
' ',
|
|
204
|
-
addon.pricingType ===
|
|
204
|
+
addon.pricingType === core_1.EAddonPricingType.PER_ALL_PERSONS_PER_NIGHT
|
|
205
205
|
? t(Translation_1.Translation.Misc.AdultPerNight)
|
|
206
206
|
: t(Translation_1.Translation.Step.Date.Adult)))),
|
|
207
207
|
!!priceInfo.adultPrice && !!priceInfo.childPrice && react_1.default.createElement("br", null),
|
|
@@ -211,7 +211,7 @@ const AddonCard = ({ addon, className }) => {
|
|
|
211
211
|
react_1.default.createElement(Text_1.default, { type: Text_1.TextType.Small, color: Color_1.Color.DarkGrey, inline: true, className: "u-marg-left--light u-clear-font-weight" },
|
|
212
212
|
"/",
|
|
213
213
|
' ',
|
|
214
|
-
addon.pricingType ===
|
|
214
|
+
addon.pricingType === core_1.EAddonPricingType.PER_ALL_PERSONS_PER_NIGHT
|
|
215
215
|
? t(Translation_1.Translation.Misc.ChildPerNight)
|
|
216
216
|
: t(Translation_1.Translation.Step.Date.Child))))))),
|
|
217
217
|
react_1.default.createElement("div", { className: "u-marg-bottom--light" },
|