fix: clean up dictionaries
This commit is contained in:
@@ -218,8 +218,12 @@ export default function AddAncillaryFlowModal({
|
||||
<>
|
||||
<Divider variant="vertical" color="subtle" />
|
||||
<Body textTransform="bold" color="uiTextHighContrast">
|
||||
{selectedAncillary.points}{" "}
|
||||
{intl.formatMessage({ id: "points" })}
|
||||
{intl.formatMessage(
|
||||
{ id: "{value} points" },
|
||||
{
|
||||
value: selectedAncillary.points,
|
||||
}
|
||||
)}
|
||||
</Body>
|
||||
</>
|
||||
)}
|
||||
|
||||
@@ -110,7 +110,10 @@ export default function ConfirmationStep() {
|
||||
<Divider variant="vertical" color="subtle" />
|
||||
</div>
|
||||
<Body textTransform="bold" color="uiTextHighContrast">
|
||||
{totalPoints} {intl.formatMessage({ id: "points" })}
|
||||
{intl.formatMessage(
|
||||
{ id: "{value} points" },
|
||||
{ value: totalPoints }
|
||||
)}
|
||||
</Body>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -73,7 +73,12 @@ export function AddedAncillaries({
|
||||
color="baseSurfaceSubtleNormal"
|
||||
/>
|
||||
<Body textTransform="bold">
|
||||
{`${ancillary.points} ${intl.formatMessage({ id: "Points" })}`}
|
||||
{intl.formatMessage(
|
||||
{ id: "{value} points" },
|
||||
{
|
||||
value: ancillary.points,
|
||||
}
|
||||
)}
|
||||
</Body>
|
||||
</div>
|
||||
</div>
|
||||
@@ -120,7 +125,12 @@ export function AddedAncillaries({
|
||||
</Body>
|
||||
<Divider variant="vertical" color="baseSurfaceSubtleNormal" />
|
||||
<Body textTransform="bold">
|
||||
{`${ancillary.points} ${intl.formatMessage({ id: "Points" })}`}
|
||||
{intl.formatMessage(
|
||||
{ id: "{value} points" },
|
||||
{
|
||||
value: ancillary.points,
|
||||
}
|
||||
)}
|
||||
</Body>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -68,7 +68,12 @@ export function CancelStayConfirmation({
|
||||
>
|
||||
<div className={styles.roomInfo}>
|
||||
<Caption color="uiTextHighContrast">
|
||||
{intl.formatMessage({ id: "Room" })} {index + 1}
|
||||
{intl.formatMessage(
|
||||
{ id: "Room {roomIndex}" },
|
||||
{
|
||||
roomIndex: index + 1,
|
||||
}
|
||||
)}
|
||||
</Caption>
|
||||
{roomDetail && (
|
||||
<>
|
||||
|
||||
@@ -56,11 +56,35 @@ export default function LinkedReservation({
|
||||
const fromDate = dt(booking.checkInDate).locale(lang)
|
||||
const toDate = dt(booking.checkOutDate).locale(lang)
|
||||
|
||||
const adultsMsg = intl.formatMessage(
|
||||
{ id: "{adults, plural, one {# adult} other {# adults}}" },
|
||||
{
|
||||
adults: booking.adults,
|
||||
}
|
||||
)
|
||||
|
||||
const childrenMsg = intl.formatMessage(
|
||||
{
|
||||
id: "{children, plural, one {# child} other {# children}}",
|
||||
},
|
||||
{
|
||||
children: booking.childrenAges.length,
|
||||
}
|
||||
)
|
||||
|
||||
const adultsOnlyMsg = adultsMsg
|
||||
const adultsAndChildrenMsg = [adultsMsg, childrenMsg].join(", ")
|
||||
|
||||
return (
|
||||
<article className={styles.linkedReservation}>
|
||||
<div className={styles.title}>
|
||||
<Subtitle color="burgundy">
|
||||
{intl.formatMessage({ id: "Room" }) + " " + (index + 2)}
|
||||
{intl.formatMessage(
|
||||
{ id: "Room {roomIndex}" },
|
||||
{
|
||||
roomIndex: index + 2,
|
||||
}
|
||||
)}
|
||||
</Subtitle>
|
||||
</div>
|
||||
<div className={styles.details}>
|
||||
@@ -70,19 +94,8 @@ export default function LinkedReservation({
|
||||
<div>
|
||||
<Caption color="uiTextHighContrast">
|
||||
{booking.childrenAges.length > 0
|
||||
? intl.formatMessage(
|
||||
{ id: "{adults} adults, {children} children" },
|
||||
{
|
||||
adults: booking.adults,
|
||||
children: booking.childrenAges.length,
|
||||
}
|
||||
)
|
||||
: intl.formatMessage(
|
||||
{ id: "{adults} adults" },
|
||||
{
|
||||
adults: booking.adults,
|
||||
}
|
||||
)}
|
||||
? adultsAndChildrenMsg
|
||||
: adultsOnlyMsg}
|
||||
</Caption>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -49,6 +49,7 @@ export function ReferenceCard({ booking, hotel }: ReferenceCardProps) {
|
||||
(acc, linkedReservation) => acc + linkedReservation.adults,
|
||||
0
|
||||
) ?? 0)
|
||||
|
||||
const children =
|
||||
booking.childrenAges.length +
|
||||
(booking.linkedReservations?.reduce(
|
||||
@@ -56,6 +57,25 @@ export function ReferenceCard({ booking, hotel }: ReferenceCardProps) {
|
||||
0
|
||||
) ?? 0)
|
||||
|
||||
const adultsMsg = intl.formatMessage(
|
||||
{ id: "{adults, plural, one {# adult} other {# adults}}" },
|
||||
{
|
||||
adults: adults,
|
||||
}
|
||||
)
|
||||
|
||||
const childrenMsg = intl.formatMessage(
|
||||
{
|
||||
id: "{children, plural, one {# child} other {# children}}",
|
||||
},
|
||||
{
|
||||
children: children,
|
||||
}
|
||||
)
|
||||
|
||||
const adultsOnlyMsg = adultsMsg
|
||||
const adultsAndChildrenMsg = [adultsMsg, childrenMsg].join(", ")
|
||||
|
||||
return (
|
||||
<div className={styles.referenceCard}>
|
||||
<div className={styles.referenceRow}>
|
||||
@@ -83,20 +103,7 @@ export function ReferenceCard({ booking, hotel }: ReferenceCardProps) {
|
||||
{intl.formatMessage({ id: "Guests" })}
|
||||
</Caption>
|
||||
<Caption type="bold" color="uiTextHighContrast">
|
||||
{children > 0
|
||||
? intl.formatMessage(
|
||||
{ id: "{adults} adults, {children} children" },
|
||||
{
|
||||
adults: adults,
|
||||
children: children,
|
||||
}
|
||||
)
|
||||
: intl.formatMessage(
|
||||
{ id: "{adults} adults" },
|
||||
{
|
||||
adults: adults,
|
||||
}
|
||||
)}
|
||||
{children > 0 ? adultsAndChildrenMsg : adultsOnlyMsg}
|
||||
</Caption>
|
||||
</div>
|
||||
<div className={styles.referenceRow}>
|
||||
|
||||
@@ -158,8 +158,12 @@ export default function GuestDetails({
|
||||
</Body>
|
||||
{isMemberBooking && (
|
||||
<Body color="uiTextHighContrast">
|
||||
{intl.formatMessage({ id: "Member no." })}{" "}
|
||||
{user.membership!.membershipNumber}
|
||||
{intl.formatMessage(
|
||||
{ id: "Member no. {nr}" },
|
||||
{
|
||||
nr: user.membership!.membershipNumber,
|
||||
}
|
||||
)}
|
||||
</Body>
|
||||
)}
|
||||
<Caption color="uiTextHighContrast">{guestDetails.email}</Caption>
|
||||
|
||||
@@ -87,6 +87,44 @@ export function Room({ booking, room, hotel, user }: RoomProps) {
|
||||
|
||||
const fromDate = dt(booking.checkInDate).locale(lang)
|
||||
|
||||
const mainBedWidthValueMsg = intl.formatMessage(
|
||||
{ id: "{value} cm" },
|
||||
{
|
||||
value: room.bedType.mainBed.widthRange.min,
|
||||
}
|
||||
)
|
||||
|
||||
const mainBedWidthRangeMsg = intl.formatMessage(
|
||||
{
|
||||
id: "{min}–{max} cm",
|
||||
},
|
||||
{
|
||||
min: room.bedType.mainBed.widthRange.min,
|
||||
max: room.bedType.mainBed.widthRange.max,
|
||||
}
|
||||
)
|
||||
|
||||
const adultsMsg = intl.formatMessage(
|
||||
{
|
||||
id: "{adults, plural, one {# adult} other {# adults}}",
|
||||
},
|
||||
{
|
||||
adults: booking.adults,
|
||||
}
|
||||
)
|
||||
|
||||
const childrenMsg = intl.formatMessage(
|
||||
{
|
||||
id: "{children, plural, one {# child} other {# children}}",
|
||||
},
|
||||
{
|
||||
children: booking.childrenAges.length,
|
||||
}
|
||||
)
|
||||
|
||||
const adultsOnlyMsg = adultsMsg
|
||||
const adultsAndChildrenMsg = [adultsMsg, childrenMsg].join(", ")
|
||||
|
||||
return (
|
||||
<div>
|
||||
<article className={styles.room}>
|
||||
@@ -189,19 +227,8 @@ export function Room({ booking, room, hotel, user }: RoomProps) {
|
||||
<div className={styles.rowContent}>
|
||||
<Body color="uiTextHighContrast">
|
||||
{booking.childrenAges.length > 0
|
||||
? intl.formatMessage(
|
||||
{ id: "{adults} adults, {children} children" },
|
||||
{
|
||||
adults: booking.adults,
|
||||
children: booking.childrenAges.length,
|
||||
}
|
||||
)
|
||||
: intl.formatMessage(
|
||||
{ id: "{adults} adults" },
|
||||
{
|
||||
adults: booking.adults,
|
||||
}
|
||||
)}
|
||||
? adultsAndChildrenMsg
|
||||
: adultsOnlyMsg}
|
||||
</Body>
|
||||
</div>
|
||||
</div>
|
||||
@@ -232,8 +259,8 @@ export function Room({ booking, room, hotel, user }: RoomProps) {
|
||||
{room.bedType.mainBed.description}
|
||||
{room.bedType.mainBed.widthRange.min ===
|
||||
room.bedType.mainBed.widthRange.max
|
||||
? ` (${room.bedType.mainBed.widthRange.min} ${intl.formatMessage({ id: "cm" })})`
|
||||
: ` (${room.bedType.mainBed.widthRange.min} - ${room.bedType.mainBed.widthRange.max} ${intl.formatMessage({ id: "cm" })})`}
|
||||
? ` (${mainBedWidthValueMsg})`
|
||||
: ` (${mainBedWidthRangeMsg})`}
|
||||
</Body>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user