fix: align price formatting
This commit is contained in:
@@ -10,6 +10,7 @@ import { useEnterDetailsStore } from "@/stores/enter-details"
|
||||
import { Highlight } from "@/components/TempDesignSystem/Form/ChoiceCard/_Card"
|
||||
import RadioCard from "@/components/TempDesignSystem/Form/ChoiceCard/Radio"
|
||||
import Body from "@/components/TempDesignSystem/Text/Body"
|
||||
import { formatPrice } from "@/utils/numberFormatting"
|
||||
|
||||
import { breakfastFormSchema } from "./schema"
|
||||
|
||||
@@ -91,7 +92,11 @@ export default function Breakfast({ packages }: BreakfastProps) {
|
||||
? intl.formatMessage<React.ReactNode>(
|
||||
{ id: "breakfast.price.free" },
|
||||
{
|
||||
amount: pkg.localPrice.price,
|
||||
amount: formatPrice(
|
||||
intl,
|
||||
parseInt(pkg.localPrice.price),
|
||||
pkg.localPrice.currency
|
||||
),
|
||||
currency: pkg.localPrice.currency,
|
||||
free: (str) => <Highlight>{str}</Highlight>,
|
||||
strikethrough: (str) => <s>{str}</s>,
|
||||
@@ -100,8 +105,11 @@ export default function Breakfast({ packages }: BreakfastProps) {
|
||||
: intl.formatMessage(
|
||||
{ id: "breakfast.price" },
|
||||
{
|
||||
amount: pkg.localPrice.price,
|
||||
currency: pkg.localPrice.currency,
|
||||
amount: formatPrice(
|
||||
intl,
|
||||
parseInt(pkg.localPrice.price),
|
||||
pkg.localPrice.currency
|
||||
),
|
||||
}
|
||||
)
|
||||
}
|
||||
@@ -114,13 +122,7 @@ export default function Breakfast({ packages }: BreakfastProps) {
|
||||
))}
|
||||
<RadioCard
|
||||
name="breakfast"
|
||||
subtitle={intl.formatMessage(
|
||||
{ id: "{amount} {currency}" },
|
||||
{
|
||||
amount: "0",
|
||||
currency: packages[0].localPrice.currency,
|
||||
}
|
||||
)}
|
||||
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.",
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user