Merged in chore/booking-flow-cleaning (pull request #3354)
chore: Clean booking-flow * Clean booking-flow * Fix type issue Approved-by: Joakim Jäderberg Approved-by: Linus Flood
This commit is contained in:
@@ -55,17 +55,23 @@ export function getErrorMessage(
|
||||
"Multi-room booking is not available with this booking code.",
|
||||
})
|
||||
case bookingWidgetErrors.MULTIROOM_REWARD_NIGHT_UNAVAILABLE:
|
||||
return variant === "partner-sas"
|
||||
? intl.formatMessage({
|
||||
id: "partnerSas.error.multiroomRewardNightUnavailable",
|
||||
defaultMessage:
|
||||
"Multi-room bookings are not available with EuroBonus points.",
|
||||
})
|
||||
: intl.formatMessage({
|
||||
switch (variant) {
|
||||
case "scandic":
|
||||
return intl.formatMessage({
|
||||
id: "error.multiroomRewardNightUnavailable",
|
||||
defaultMessage:
|
||||
"Multi-room booking is not available with reward night.",
|
||||
})
|
||||
case "partner-sas":
|
||||
return intl.formatMessage({
|
||||
id: "partnerSas.error.multiroomRewardNightUnavailable",
|
||||
defaultMessage:
|
||||
"Multi-room bookings are not available with EuroBonus points.",
|
||||
})
|
||||
default:
|
||||
const _exhaustiveCheck: never = variant
|
||||
throw new Error(`Unknown variant: ${variant}`)
|
||||
}
|
||||
case bookingWidgetErrors.CODE_VOUCHER_REWARD_NIGHT_UNAVAILABLE:
|
||||
return intl.formatMessage({
|
||||
id: "error.codeVoucherRewardNightUnavailable",
|
||||
|
||||
@@ -165,6 +165,9 @@ function getRewardMessage(config: BookingFlowConfig, intl: IntlShape): string {
|
||||
id: "bookingWidget.reward.rewardNight",
|
||||
defaultMessage: "Reward Night",
|
||||
})
|
||||
default:
|
||||
const _exhaustiveCheck: never = config.variant
|
||||
throw new Error(`Unknown variant: ${config.variant}`)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,15 +25,19 @@ function Message() {
|
||||
const intl = useIntl()
|
||||
const config = useBookingFlowConfig()
|
||||
|
||||
if (config.variant === "partner-sas") {
|
||||
return intl.formatMessage({
|
||||
id: "signup.toGetTheScandicMemberPrice",
|
||||
defaultMessage: "Enter ID or join to get the Scandic Friends price.",
|
||||
})
|
||||
switch (config.variant) {
|
||||
case "partner-sas":
|
||||
return intl.formatMessage({
|
||||
id: "signup.toGetTheScandicMemberPrice",
|
||||
defaultMessage: "Enter ID or join to get the Scandic Friends price.",
|
||||
})
|
||||
case "scandic":
|
||||
return intl.formatMessage({
|
||||
id: "signup.joinOrLoginForMemberPricing",
|
||||
defaultMessage: "Join or log in while booking for member pricing.",
|
||||
})
|
||||
default:
|
||||
const _exhaustiveCheck: never = config.variant
|
||||
throw new Error(`Unknown variant: ${config.variant}`)
|
||||
}
|
||||
|
||||
return intl.formatMessage({
|
||||
id: "signup.joinOrLoginForMemberPricing",
|
||||
defaultMessage: "Join or log in while booking for member pricing.",
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user