Merged in feat/sw-3472-booking-flow-parameterization (pull request #2811)
feat(SW-3272): Add BookingFlowConfig * Add BookingFlowConfig * Rename "provider" to BookingFlowConfig * Change bookingCode to boolean * Fix error Approved-by: Joakim Jäderberg Approved-by: Linus Flood
This commit is contained in:
@@ -5,15 +5,18 @@ import { useIntl } from "react-intl"
|
||||
import Caption from "@scandic-hotels/design-system/Caption"
|
||||
import SkeletonShimmer from "@scandic-hotels/design-system/SkeletonShimmer"
|
||||
|
||||
import { useBookingFlowConfig } from "../../../../../bookingFlowConfig/bookingFlowConfigContext"
|
||||
import BookingCode from "../BookingCode"
|
||||
import RewardNight from "../RewardNight"
|
||||
|
||||
import styles from "./voucher.module.css"
|
||||
|
||||
export default function Voucher() {
|
||||
const { config } = useBookingFlowConfig()
|
||||
|
||||
return (
|
||||
<div className={styles.optionsContainer}>
|
||||
<BookingCode />
|
||||
{config.bookingCodeEnabled && <BookingCode />}
|
||||
<div className={styles.options}>
|
||||
<div className={styles.option}>
|
||||
<RewardNight />
|
||||
@@ -25,6 +28,7 @@ export default function Voucher() {
|
||||
|
||||
export function VoucherSkeleton() {
|
||||
const intl = useIntl()
|
||||
const { config } = useBookingFlowConfig()
|
||||
|
||||
const vouchers = intl.formatMessage({
|
||||
defaultMessage: "Code / Voucher",
|
||||
@@ -35,14 +39,16 @@ export function VoucherSkeleton() {
|
||||
|
||||
return (
|
||||
<div className={styles.optionsContainer}>
|
||||
<div className={styles.voucherSkeletonContainer}>
|
||||
<label>
|
||||
<Caption type="bold" color="red" asChild>
|
||||
<span>{vouchers}</span>
|
||||
</Caption>
|
||||
</label>
|
||||
<SkeletonShimmer width="100%" display="block" />
|
||||
</div>
|
||||
{config.bookingCodeEnabled && (
|
||||
<div className={styles.voucherSkeletonContainer}>
|
||||
<label>
|
||||
<Caption type="bold" color="red" asChild>
|
||||
<span>{vouchers}</span>
|
||||
</Caption>
|
||||
</label>
|
||||
<SkeletonShimmer width="100%" display="block" />
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className={styles.options}>
|
||||
<div className={cx(styles.option, styles.showOnTablet)}>
|
||||
|
||||
Reference in New Issue
Block a user