Merged in fix/SW-2573-children-count-booking-confirmation (pull request #1939)
fix(SW-2573): add children count to summary * fix(SW-2573): add children count to summary Approved-by: Michael Zetterberg
This commit is contained in:
@@ -44,6 +44,25 @@ export default function ReceiptRoom({
|
||||
(c) => c.bedType === ChildBedTypeEnum.ExtraBed
|
||||
)
|
||||
|
||||
const adultsMsg = intl.formatMessage(
|
||||
{
|
||||
defaultMessage: "{totalAdults, plural, one {# adult} other {# adults}}",
|
||||
},
|
||||
{ totalAdults: room.adults }
|
||||
)
|
||||
|
||||
const guestsParts = [adultsMsg]
|
||||
if (room.childrenAges?.length) {
|
||||
const childrenMsg = intl.formatMessage(
|
||||
{
|
||||
defaultMessage:
|
||||
"{totalChildren, plural, one {# child} other {# children}}",
|
||||
},
|
||||
{ totalChildren: room.childrenAges.length }
|
||||
)
|
||||
guestsParts.push(childrenMsg)
|
||||
}
|
||||
|
||||
return (
|
||||
<article className={styles.room}>
|
||||
<header className={styles.roomHeader}>
|
||||
@@ -65,15 +84,7 @@ export default function ReceiptRoom({
|
||||
)}
|
||||
<Typography variant="Body/Paragraph/mdRegular">
|
||||
<p className={styles.uiTextMediumContrast}>
|
||||
{intl.formatMessage(
|
||||
{
|
||||
defaultMessage:
|
||||
"{totalAdults, plural, one {# adult} other {# adults}}",
|
||||
},
|
||||
{
|
||||
totalAdults: room.adults,
|
||||
}
|
||||
)}
|
||||
{guestsParts.join(", ")}
|
||||
</p>
|
||||
</Typography>
|
||||
<Typography variant="Body/Paragraph/mdRegular">
|
||||
|
||||
Reference in New Issue
Block a user