@roomstay/frontend 2.6.51 → 2.6.52

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.
@@ -95,7 +95,6 @@ const RateDescriptionOverides = ({ rate }) => {
95
95
  react_1.default.createElement("span", { className: "u-clear-font-weight", dangerouslySetInnerHTML: { __html: displayRate.longDescription } })))))));
96
96
  };
97
97
  function RoomRateDescriptionTab(props) {
98
- var _a;
99
98
  const ccx = (0, react_1.useContext)(contexts_1.CompanyContext);
100
99
  const { currentBasketRows } = (0, react_1.useContext)(contexts_1.BasketContext);
101
100
  const { t } = (0, react_i18next_1.useTranslation)();
@@ -113,7 +112,7 @@ function RoomRateDescriptionTab(props) {
113
112
  react_1.default.createElement("div", null,
114
113
  react_1.default.createElement("div", { className: "u-marg-bottom--light" },
115
114
  react_1.default.createElement(Headline_1.default, { bold: true }, rateName)),
116
- react_1.default.createElement("div", { className: "u-marg-bottom--heavy text-small u-pre-wrap u-clear-font-weight", dangerouslySetInnerHTML: { __html: (_a = longDescription !== null && longDescription !== void 0 ? longDescription : shortDescription) !== null && _a !== void 0 ? _a : '' } }),
115
+ react_1.default.createElement("div", { className: "u-marg-bottom--heavy text-small u-pre-wrap u-clear-font-weight", dangerouslySetInnerHTML: { __html: longDescription ? longDescription : shortDescription !== null && shortDescription !== void 0 ? shortDescription : '' } }),
117
116
  react_1.default.createElement("div", { className: "u-marg-bottom--light" },
118
117
  react_1.default.createElement(Calendar, { row: row }),
119
118
  react_1.default.createElement(RateDescriptionOverides, { rate: rate })),
@@ -1 +1 @@
1
- {"version":3,"file":"RoomRateDescriptionTab.js","sourceRoot":"/","sources":["src/components/steps/room/roomDetails/roomRates/RoomRateDescriptionTab.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAmE;AACnE,+CAA0C;AAC1C,iDAA+C;AAC/C,0DAAuD;AAEvD,6EAAqD;AACrD,sFAA8D;AAC9D,6EAAqD;AAC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AK,EAAE,KAAK,EAAE,aAAK,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,yBAAS,CAAC,IAAI,CAAC,CAAC,CAAC,yBAAS,CAAC,KAAK;oBACjG,wCAAM,uBAAuB,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,yBAAW,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,GAAS,CAChG,CACL,CACJ,CACP,CACN,CAAC;AACN,CAAC;AAlFD,yCAkFC","sourcesContent":["import { BasketContext, CompanyContext } from '@frontend/contexts';\nimport React, { useContext } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { Translation } from 'translations/Translation';\n\nimport BEButton from '@/components/generic/BEButton';\nimport DatePicker from '@/components/generic/date/DatePicker';\nimport Headline from '@/components/generic/Headline';\nimport { HtmlContentViewer } from '@/components/generic/HtmlContentViewer';\nimport LineBreak from '@/components/generic/LineBreak';\nimport Text, { TextType } from '@/components/generic/Text';\nimport RoomDetailsPriceBlock from '@/components/steps/room/roomDetails/RoomDetailsPriceBlock';\nimport BookNowButton from '@/components/steps/room/roomDetails/roomRates/BookNowButton';\nimport { useRateDetails } from '@/hooks/useRateDetails';\nimport { useWindowSize } from '@/hooks/WindowSize';\nimport BasketRow from '@/models/BasketRow';\nimport { RoomRate } from '@/models/Room/RoomRate';\nimport { Color } from '@/util/Color';\nimport DataLayer, { InteractionStep, InteractionType } from '@/util/DataLayer';\nimport { TextAlign } from '@/util/TextAlignment';\n\nimport styles from './RoomRateDescriptionTab.module.scss';\n\ninterface RoomRateDescriptionTabProps {\n rate: RoomRate;\n}\n\ninterface RoomRateDescriptionFooterProps {\n rate: RoomRate;\n onClose: () => void;\n\n getButtonLabel?: (isRoomSelectedAndEditing: boolean, isThisSelectedRow: boolean) => string;\n onAddToBasketOverride?: (rate: RoomRate) => void;\n}\n\nexport const RoomRateDescriptionFooter = (props: RoomRateDescriptionFooterProps) => {\n const { t } = useTranslation();\n const ccx = useContext(CompanyContext);\n\n const { rate } = props;\n\n let isLocked = false;\n\n if (rate.isMemberOnly && !ccx.signedInUser) {\n isLocked = true;\n }\n\n const bookButtonLabel = props.getButtonLabel ? props.getButtonLabel(false, false) : t(Translation.Misc.BookNow);\n\n const openSignupModalOnClick = () => {\n DataLayer.instance.sendInteraction('Member Signup Modal', InteractionType.LINK, InteractionStep.ROOMS);\n ccx.openMemberSignupModal();\n };\n\n const bookNowButton = isLocked ? (\n <BEButton filled success onClick={openSignupModalOnClick}>\n {t(Translation.Step.Room.RoomInfo.RevealPrice)}\n </BEButton>\n ) : (\n <BookNowButton isFilled rate={props.rate} buttonLabel={bookButtonLabel} onAddToBasketOverride={props.onAddToBasketOverride} />\n );\n\n const priceBlock = <div className=\"u-flex flex-column align-items-start align-items-md-end justify-content-start\" />;\n\n return (\n <div className=\"u-flex\">\n {priceBlock}\n <div className=\"u-flex align-items-center\">{bookNowButton}</div>\n </div>\n );\n};\n\nconst Calendar = ({ row }: { row: BasketRow }): React.ReactElement => {\n return (\n <div className={'d-flex align-items-center flex-column ' + styles.calendarContainer}>\n <DatePicker\n showMonthOnLoad={row?.getStartDate()}\n showMultipleMonths={false}\n supportsMultiSelecting\n showMinNightStay={false}\n supportsWeek={false}\n selectedStartDate={row?.getStartDate()}\n selectedEndDate={row?.getEndDate()}\n readOnly\n className={styles.calendar}\n />\n </div>\n );\n};\n\nconst RateDescriptionOverides = ({ rate }: { rate: RoomRate }) => {\n const basketContext = useContext(BasketContext);\n const basketRow = basketContext.selectedBasketRow ?? basketContext.currentBasketRows[basketContext.currentBasketRows.length - 1];\n\n const displayRates = rate.getDisplayRates({\n startDate: basketRow?.getStartDate(),\n endDate: basketRow?.getEndDate(),\n });\n\n const { t } = useTranslation();\n\n return (\n <div className=\"u-marg-top--medium\">\n {displayRates.map((displayRate, index) => (\n <div className=\"u-marg-bottom--light\" key={index}>\n {displayRate.startDate && displayRate.endDate ? (\n <>\n <Text>\n <strong>{rate.displayRateToDayLabel(displayRate)}</strong>\n </Text>\n <Text>\n {rate.displayRateToDayName(displayRate)}: {displayRate.name}\n </Text>\n </>\n ) : (\n <Text bold>\n {t(Translation.Step.Room.RoomInfo.BaseRate)}: {displayRate.name}\n </Text>\n )}\n\n <Text type={TextType.Small}>\n <span className=\"u-clear-font-weight\" dangerouslySetInnerHTML={{ __html: displayRate.shortDescription }} />\n </Text>\n <Text type={TextType.Small}>\n <span className=\"u-clear-font-weight\" dangerouslySetInnerHTML={{ __html: displayRate.longDescription }} />\n </Text>\n </div>\n ))}\n </div>\n );\n};\n\nexport default function RoomRateDescriptionTab(props: RoomRateDescriptionTabProps) {\n const ccx = useContext(CompanyContext);\n const { currentBasketRows } = useContext(BasketContext);\n\n const { t } = useTranslation();\n const { isMobile } = useWindowSize();\n const cancelPolicy = props.rate.getCancellationPolicy();\n const guaranteePolicy = props.rate.getGuaranteePolicy();\n\n let isLocked = false;\n if (props.rate.isMemberOnly && !ccx.signedInUser) {\n isLocked = true;\n }\n\n const rate = props.rate;\n const row = currentBasketRows[0];\n\n const { rateName, shortDescription, longDescription } = useRateDetails(rate, isLocked);\n\n return (\n <>\n <div>\n <div className=\"u-marg-bottom--light\">\n <Headline bold>{rateName}</Headline>\n </div>\n\n <div className=\"u-marg-bottom--heavy text-small u-pre-wrap u-clear-font-weight\" dangerouslySetInnerHTML={{ __html: longDescription ?? shortDescription ?? '' }} />\n\n <div className=\"u-marg-bottom--light\">\n <Calendar row={row} />\n <RateDescriptionOverides rate={rate} />\n </div>\n\n <LineBreak />\n <div className=\"u-marg-bottom--light\">\n <Text>\n <strong>{t(Translation.Step.Confirmation.Policies)}</strong>\n </Text>\n </div>\n <div className=\"u-marg-bottom--heavy\">\n {guaranteePolicy && (\n <div className=\"u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom--light\">\n <Text type={TextType.Small}>\n <strong>{t(Translation.Misc.GuaranteePolicy)}</strong>\n </Text>\n </div>\n <Text type={TextType.Small}>\n <HtmlContentViewer content={guaranteePolicy} />\n </Text>\n </div>\n )}\n <div className=\"u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom--light\">\n <Text type={TextType.Small}>\n <strong>{t(Translation.Misc.CancellationPolicy)}</strong>\n </Text>\n </div>\n <Text type={TextType.Small}>\n <HtmlContentViewer content={cancelPolicy} />\n </Text>\n </div>\n </div>\n\n <div className=\"u-flex flex-column align-items-start align-items-md-end justify-content-end\">\n <Text type={TextType.Small} color={Color.Navy}>\n {t(Translation.Misc.Total)}\n </Text>\n <RoomDetailsPriceBlock\n isLocked={isLocked}\n averagePreDiscount={rate.getTotalPriceBeforeDiscount()}\n averagePrice={rate.getTotalPrice()}\n isMemberOnly={props.rate.isMemberOnly}\n hidePerNight\n />\n <Text type={TextType.Label} color={Color.DarkGrey} align={isMobile ? TextAlign.Left : TextAlign.Right}>\n <span dangerouslySetInnerHTML={{ __html: t(Translation.Step.Room.RoomInfo.IncludesTaxes) }}></span>\n </Text>\n </div>\n </div>\n </>\n );\n}\n"]}
1
+ {"version":3,"file":"RoomRateDescriptionTab.js","sourceRoot":"/","sources":["src/components/steps/room/roomDetails/roomRates/RoomRateDescriptionTab.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAmE;AACnE,+CAA0C;AAC1C,iDAA+C;AAC/C,0DAAuD;AAEvD,6EAAqD;AACrD,sFAA8D;AAC9D,6EAAqD;AACrD,8EAA2E;AAC3E,+EAAuD;AACvD,kEAA2D;AAC3D,sHAA8F;AAC9F,gHAAwF;AACxF,2DAAwD;AACxD,mDAAmD;AAGnD,wCAAqC;AACrC,8DAA+E;AAC/E,wDAAiD;AAEjD,8GAA0D;AAcnD,MAAM,yBAAyB,GAAG,CAAC,KAAqC,EAAE,EAAE;IAC/E,MAAM,EAAE,CAAC,EAAE,GAAG,IAAA,8BAAc,GAAE,CAAC;IAC/B,MAAM,GAAG,GAAG,IAAA,kBAAU,EAAC,yBAAc,CAAC,CAAC;IAEvC,MAAM,E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,yCAqFC","sourcesContent":["import { BasketContext, CompanyContext } from '@frontend/contexts';\nimport React, { useContext } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { Translation } from 'translations/Translation';\n\nimport BEButton from '@/components/generic/BEButton';\nimport DatePicker from '@/components/generic/date/DatePicker';\nimport Headline from '@/components/generic/Headline';\nimport { HtmlContentViewer } from '@/components/generic/HtmlContentViewer';\nimport LineBreak from '@/components/generic/LineBreak';\nimport Text, { TextType } from '@/components/generic/Text';\nimport RoomDetailsPriceBlock from '@/components/steps/room/roomDetails/RoomDetailsPriceBlock';\nimport BookNowButton from '@/components/steps/room/roomDetails/roomRates/BookNowButton';\nimport { useRateDetails } from '@/hooks/useRateDetails';\nimport { useWindowSize } from '@/hooks/WindowSize';\nimport BasketRow from '@/models/BasketRow';\nimport { RoomRate } from '@/models/Room/RoomRate';\nimport { Color } from '@/util/Color';\nimport DataLayer, { InteractionStep, InteractionType } from '@/util/DataLayer';\nimport { TextAlign } from '@/util/TextAlignment';\n\nimport styles from './RoomRateDescriptionTab.module.scss';\n\ninterface RoomRateDescriptionTabProps {\n rate: RoomRate;\n}\n\ninterface RoomRateDescriptionFooterProps {\n rate: RoomRate;\n onClose: () => void;\n\n getButtonLabel?: (isRoomSelectedAndEditing: boolean, isThisSelectedRow: boolean) => string;\n onAddToBasketOverride?: (rate: RoomRate) => void;\n}\n\nexport const RoomRateDescriptionFooter = (props: RoomRateDescriptionFooterProps) => {\n const { t } = useTranslation();\n const ccx = useContext(CompanyContext);\n\n const { rate } = props;\n\n let isLocked = false;\n\n if (rate.isMemberOnly && !ccx.signedInUser) {\n isLocked = true;\n }\n\n const bookButtonLabel = props.getButtonLabel ? props.getButtonLabel(false, false) : t(Translation.Misc.BookNow);\n\n const openSignupModalOnClick = () => {\n DataLayer.instance.sendInteraction('Member Signup Modal', InteractionType.LINK, InteractionStep.ROOMS);\n ccx.openMemberSignupModal();\n };\n\n const bookNowButton = isLocked ? (\n <BEButton filled success onClick={openSignupModalOnClick}>\n {t(Translation.Step.Room.RoomInfo.RevealPrice)}\n </BEButton>\n ) : (\n <BookNowButton isFilled rate={props.rate} buttonLabel={bookButtonLabel} onAddToBasketOverride={props.onAddToBasketOverride} />\n );\n\n const priceBlock = <div className=\"u-flex flex-column align-items-start align-items-md-end justify-content-start\" />;\n\n return (\n <div className=\"u-flex\">\n {priceBlock}\n <div className=\"u-flex align-items-center\">{bookNowButton}</div>\n </div>\n );\n};\n\nconst Calendar = ({ row }: { row: BasketRow }): React.ReactElement => {\n return (\n <div className={'d-flex align-items-center flex-column ' + styles.calendarContainer}>\n <DatePicker\n showMonthOnLoad={row?.getStartDate()}\n showMultipleMonths={false}\n supportsMultiSelecting\n showMinNightStay={false}\n supportsWeek={false}\n selectedStartDate={row?.getStartDate()}\n selectedEndDate={row?.getEndDate()}\n readOnly\n className={styles.calendar}\n />\n </div>\n );\n};\n\nconst RateDescriptionOverides = ({ rate }: { rate: RoomRate }) => {\n const basketContext = useContext(BasketContext);\n const basketRow = basketContext.selectedBasketRow ?? basketContext.currentBasketRows[basketContext.currentBasketRows.length - 1];\n\n const displayRates = rate.getDisplayRates({\n startDate: basketRow?.getStartDate(),\n endDate: basketRow?.getEndDate(),\n });\n\n const { t } = useTranslation();\n\n return (\n <div className=\"u-marg-top--medium\">\n {displayRates.map((displayRate, index) => (\n <div className=\"u-marg-bottom--light\" key={index}>\n {displayRate.startDate && displayRate.endDate ? (\n <>\n <Text>\n <strong>{rate.displayRateToDayLabel(displayRate)}</strong>\n </Text>\n <Text>\n {rate.displayRateToDayName(displayRate)}: {displayRate.name}\n </Text>\n </>\n ) : (\n <Text bold>\n {t(Translation.Step.Room.RoomInfo.BaseRate)}: {displayRate.name}\n </Text>\n )}\n\n <Text type={TextType.Small}>\n <span className=\"u-clear-font-weight\" dangerouslySetInnerHTML={{ __html: displayRate.shortDescription }} />\n </Text>\n <Text type={TextType.Small}>\n <span className=\"u-clear-font-weight\" dangerouslySetInnerHTML={{ __html: displayRate.longDescription }} />\n </Text>\n </div>\n ))}\n </div>\n );\n};\n\nexport default function RoomRateDescriptionTab(props: RoomRateDescriptionTabProps) {\n const ccx = useContext(CompanyContext);\n const { currentBasketRows } = useContext(BasketContext);\n\n const { t } = useTranslation();\n const { isMobile } = useWindowSize();\n const cancelPolicy = props.rate.getCancellationPolicy();\n const guaranteePolicy = props.rate.getGuaranteePolicy();\n\n let isLocked = false;\n if (props.rate.isMemberOnly && !ccx.signedInUser) {\n isLocked = true;\n }\n\n const rate = props.rate;\n const row = currentBasketRows[0];\n\n const { rateName, shortDescription, longDescription } = useRateDetails(rate, isLocked);\n\n return (\n <>\n <div>\n <div className=\"u-marg-bottom--light\">\n <Headline bold>{rateName}</Headline>\n </div>\n\n <div\n className=\"u-marg-bottom--heavy text-small u-pre-wrap u-clear-font-weight\"\n dangerouslySetInnerHTML={{ __html: longDescription ? longDescription : shortDescription ?? '' }}\n />\n\n <div className=\"u-marg-bottom--light\">\n <Calendar row={row} />\n <RateDescriptionOverides rate={rate} />\n </div>\n\n <LineBreak />\n <div className=\"u-marg-bottom--light\">\n <Text>\n <strong>{t(Translation.Step.Confirmation.Policies)}</strong>\n </Text>\n </div>\n <div className=\"u-marg-bottom--heavy\">\n {guaranteePolicy && (\n <div className=\"u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom--light\">\n <Text type={TextType.Small}>\n <strong>{t(Translation.Misc.GuaranteePolicy)}</strong>\n </Text>\n </div>\n <Text type={TextType.Small}>\n <HtmlContentViewer content={guaranteePolicy} />\n </Text>\n </div>\n )}\n <div className=\"u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom--light\">\n <Text type={TextType.Small}>\n <strong>{t(Translation.Misc.CancellationPolicy)}</strong>\n </Text>\n </div>\n <Text type={TextType.Small}>\n <HtmlContentViewer content={cancelPolicy} />\n </Text>\n </div>\n </div>\n\n <div className=\"u-flex flex-column align-items-start align-items-md-end justify-content-end\">\n <Text type={TextType.Small} color={Color.Navy}>\n {t(Translation.Misc.Total)}\n </Text>\n <RoomDetailsPriceBlock\n isLocked={isLocked}\n averagePreDiscount={rate.getTotalPriceBeforeDiscount()}\n averagePrice={rate.getTotalPrice()}\n isMemberOnly={props.rate.isMemberOnly}\n hidePerNight\n />\n <Text type={TextType.Label} color={Color.DarkGrey} align={isMobile ? TextAlign.Left : TextAlign.Right}>\n <span dangerouslySetInnerHTML={{ __html: t(Translation.Step.Room.RoomInfo.IncludesTaxes) }}></span>\n </Text>\n </div>\n </div>\n </>\n );\n}\n"]}