Merged in feat/SW-1504-UI-update-breakfast-component (pull request #1284)
feat(SW-1504): Used AncillaryCard and added to breakfast choice * feat(SW-1504): Craeted AncillaryCard and added to breakfast choice * feat(SW-1504): Using of AncillaryCard * feat(SW-1504) Removed unused imports * feat(SW-1504): Added price text * feat(SW-1504): added /night per adult * feat(SW-1504) Removed type prop Approved-by: Arvid Norlin
This commit is contained in:
@@ -8,10 +8,8 @@ import { useIntl } from "react-intl"
|
||||
import { useEnterDetailsStore } from "@/stores/enter-details"
|
||||
import { selectRoom } from "@/stores/enter-details/helpers"
|
||||
|
||||
import { Highlight } from "@/components/TempDesignSystem/Form/ChoiceCard/_Card"
|
||||
import RadioCard from "@/components/TempDesignSystem/Form/ChoiceCard/Radio"
|
||||
import BreakfastChoiceCard from "@/components/HotelReservation/EnterDetails/Breakfast/BreakfastChoiceCard"
|
||||
import Body from "@/components/TempDesignSystem/Text/Body"
|
||||
import { formatPrice } from "@/utils/numberFormatting"
|
||||
|
||||
import { breakfastFormSchema } from "./schema"
|
||||
|
||||
@@ -93,52 +91,41 @@ export default function Breakfast({
|
||||
) : null}
|
||||
<form className={styles.form} onSubmit={methods.handleSubmit(onSubmit)}>
|
||||
{packages.map((pkg) => (
|
||||
<RadioCard
|
||||
<BreakfastChoiceCard
|
||||
key={pkg.code}
|
||||
id={pkg.code}
|
||||
name="breakfast"
|
||||
subtitle={
|
||||
pkg.code === BreakfastPackageEnum.FREE_MEMBER_BREAKFAST
|
||||
? intl.formatMessage<React.ReactNode>(
|
||||
{
|
||||
id: "<strikethrough>{amount}</strikethrough> <free>0 {currency}</free>/night per adult",
|
||||
},
|
||||
{
|
||||
amount: formatPrice(
|
||||
intl,
|
||||
parseInt(pkg.localPrice.price),
|
||||
pkg.localPrice.currency
|
||||
),
|
||||
currency: pkg.localPrice.currency,
|
||||
free: (str) => <Highlight>{str}</Highlight>,
|
||||
strikethrough: (str) => <s>{str}</s>,
|
||||
}
|
||||
)
|
||||
: intl.formatMessage(
|
||||
{ id: "{amount}/night per adult" },
|
||||
{
|
||||
amount: formatPrice(
|
||||
intl,
|
||||
parseInt(pkg.localPrice.price),
|
||||
pkg.localPrice.currency
|
||||
),
|
||||
}
|
||||
)
|
||||
}
|
||||
text={intl.formatMessage({
|
||||
id: "All our breakfast buffets offer gluten free, vegan, and allergy-friendly options.",
|
||||
})}
|
||||
title={intl.formatMessage({ id: "Breakfast buffet" })}
|
||||
ancillary={{
|
||||
title: intl.formatMessage({ id: "Breakfast buffet" }),
|
||||
price: {
|
||||
total: parseInt(pkg.localPrice.price),
|
||||
currency: pkg.localPrice.currency,
|
||||
included:
|
||||
pkg.code === BreakfastPackageEnum.FREE_MEMBER_BREAKFAST,
|
||||
text: intl.formatMessage({ id: "/night per adult" }),
|
||||
},
|
||||
description: intl.formatMessage({
|
||||
id: "All our breakfast buffets offer gluten free, vegan, and allergy-friendly options.",
|
||||
}),
|
||||
imageUrl: "/_static/img/enter-details/breakfast.png", // TODO: Add dynamic image
|
||||
}}
|
||||
value={pkg.code}
|
||||
id={pkg.code}
|
||||
/>
|
||||
))}
|
||||
<RadioCard
|
||||
<BreakfastChoiceCard
|
||||
name="breakfast"
|
||||
subtitle={formatPrice(intl, 0, packages[0].localPrice.currency)}
|
||||
text={intl.formatMessage({
|
||||
id: "You can always change your mind later and add breakfast at the hotel.",
|
||||
})}
|
||||
title={intl.formatMessage({ id: "No breakfast" })}
|
||||
ancillary={{
|
||||
title: intl.formatMessage({ id: "No breakfast" }),
|
||||
price: {
|
||||
total: 0,
|
||||
currency: packages[0].localPrice.currency,
|
||||
},
|
||||
description: intl.formatMessage({
|
||||
id: "You can always change your mind later and add breakfast at the hotel.",
|
||||
}),
|
||||
imageUrl: "/_static/img/enter-details/breakfast.png", // TODO: Add dynamic image
|
||||
imageOpacity: 0.1,
|
||||
}}
|
||||
value="false"
|
||||
/>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user