Merged in feat/sw-3547-update-member-rate-alert-text (pull request #2992)
feat(SW-3547): Update texts for SAS variant member rate alert * Update texts for SAS variant Approved-by: Hrishikesh Vaipurkar
This commit is contained in:
@@ -6,6 +6,8 @@ import { formatPrice } from "@scandic-hotels/common/utils/numberFormatting"
|
|||||||
import Caption from "@scandic-hotels/design-system/Caption"
|
import Caption from "@scandic-hotels/design-system/Caption"
|
||||||
import Footnote from "@scandic-hotels/design-system/Footnote"
|
import Footnote from "@scandic-hotels/design-system/Footnote"
|
||||||
|
|
||||||
|
import { useBookingFlowConfig } from "../../bookingFlowConfig/bookingFlowConfigContext"
|
||||||
|
|
||||||
import styles from "./signupPromo.module.css"
|
import styles from "./signupPromo.module.css"
|
||||||
|
|
||||||
type SignupPromoProps = {
|
type SignupPromoProps = {
|
||||||
@@ -36,38 +38,71 @@ export default function SignupPromoDesktop({
|
|||||||
>
|
>
|
||||||
{badgeContent && <span className={styles.badge}>{badgeContent}</span>}
|
{badgeContent && <span className={styles.badge}>{badgeContent}</span>}
|
||||||
<Footnote color="burgundy">
|
<Footnote color="burgundy">
|
||||||
{isEnterDetailsPage
|
<Message price={price} isEnterDetailsPage={isEnterDetailsPage} />
|
||||||
? intl.formatMessage(
|
|
||||||
{
|
|
||||||
id: "signup.toGetTheMemberRoomPrice",
|
|
||||||
defaultMessage:
|
|
||||||
"To get the member room price <span>{price}</span>, log in or join when completing the booking.",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
span: (str) => (
|
|
||||||
<Caption color="red" type="bold" asChild>
|
|
||||||
<span>{str}</span>
|
|
||||||
</Caption>
|
|
||||||
),
|
|
||||||
price,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
: intl.formatMessage(
|
|
||||||
{
|
|
||||||
id: "signup.toGetTheMemberPrice",
|
|
||||||
defaultMessage:
|
|
||||||
"To get the member price <span>{price}</span>, log in or join when completing the booking.",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
span: (str) => (
|
|
||||||
<Caption color="red" type="bold" asChild>
|
|
||||||
<span>{str}</span>
|
|
||||||
</Caption>
|
|
||||||
),
|
|
||||||
price,
|
|
||||||
}
|
|
||||||
)}
|
|
||||||
</Footnote>
|
</Footnote>
|
||||||
</div>
|
</div>
|
||||||
) : null
|
) : null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function Message({
|
||||||
|
price,
|
||||||
|
isEnterDetailsPage,
|
||||||
|
}: {
|
||||||
|
price: string
|
||||||
|
isEnterDetailsPage: boolean
|
||||||
|
}) {
|
||||||
|
const intl = useIntl()
|
||||||
|
const config = useBookingFlowConfig()
|
||||||
|
|
||||||
|
if (config.variant === "partner-sas") {
|
||||||
|
return intl.formatMessage(
|
||||||
|
{
|
||||||
|
id: "signup.toGetTheScandicMemberPrice",
|
||||||
|
defaultMessage:
|
||||||
|
"To get the Scandic member price <span>{price}</span>, enter your ID or join while booking.",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
span: (str) => (
|
||||||
|
<Caption color="red" type="bold" asChild>
|
||||||
|
<span>{str}</span>
|
||||||
|
</Caption>
|
||||||
|
),
|
||||||
|
price,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isEnterDetailsPage) {
|
||||||
|
return intl.formatMessage(
|
||||||
|
{
|
||||||
|
id: "signup.toGetTheMemberRoomPrice",
|
||||||
|
defaultMessage:
|
||||||
|
"To get the member room price <span>{price}</span>, log in or join when completing the booking.",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
span: (str) => (
|
||||||
|
<Caption color="red" type="bold" asChild>
|
||||||
|
<span>{str}</span>
|
||||||
|
</Caption>
|
||||||
|
),
|
||||||
|
price,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
return intl.formatMessage(
|
||||||
|
{
|
||||||
|
id: "signup.toGetTheMemberPrice",
|
||||||
|
defaultMessage:
|
||||||
|
"To get the member price <span>{price}</span>, log in or join when completing the booking.",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
span: (str) => (
|
||||||
|
<Caption color="red" type="bold" asChild>
|
||||||
|
<span>{str}</span>
|
||||||
|
</Caption>
|
||||||
|
),
|
||||||
|
price,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|||||||
@@ -4,21 +4,36 @@ import { useIntl } from "react-intl"
|
|||||||
|
|
||||||
import Footnote from "@scandic-hotels/design-system/Footnote"
|
import Footnote from "@scandic-hotels/design-system/Footnote"
|
||||||
|
|
||||||
|
import { useBookingFlowConfig } from "../../bookingFlowConfig/bookingFlowConfigContext"
|
||||||
|
|
||||||
import styles from "./signupPromo.module.css"
|
import styles from "./signupPromo.module.css"
|
||||||
|
|
||||||
export default function SignupPromoMobile() {
|
export default function SignupPromoMobile() {
|
||||||
const intl = useIntl()
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
data-footer-spacing-signup
|
data-footer-spacing-signup
|
||||||
className={styles.memberDiscountBannerMobile}
|
className={styles.memberDiscountBannerMobile}
|
||||||
>
|
>
|
||||||
<Footnote color="burgundy">
|
<Footnote color="burgundy">
|
||||||
{intl.formatMessage({
|
<Message />
|
||||||
id: "signup.joinOrLoginForMemberPricing",
|
|
||||||
defaultMessage: "Join or log in while booking for member pricing.",
|
|
||||||
})}
|
|
||||||
</Footnote>
|
</Footnote>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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 member price.",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return intl.formatMessage({
|
||||||
|
id: "signup.joinOrLoginForMemberPricing",
|
||||||
|
defaultMessage: "Join or log in while booking for member pricing.",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user