Merged in fix/SW-3484-campaign-remove-breakfast-message-chip (pull request #2820)
fix(SW-3484): remove breakfast message in the booking code chip for campaign * fix(SW-3484): remove breakfast message in the booking code chip for campaign Approved-by: Matilda Landström
This commit is contained in:
@@ -83,9 +83,7 @@ export default function SummaryUI({
|
||||
const isAllCampaignRate = rooms.every(
|
||||
(room) => room.room.roomRate.rateDefinition.isCampaignRate
|
||||
)
|
||||
const isAllBreakfastIncluded = rooms.every(
|
||||
(room) => room.room.roomRate.rateDefinition.breakfastIncluded
|
||||
)
|
||||
|
||||
const containsBookingCodeRate = rooms.find(
|
||||
(r) => r && isBookingCodeRate(r.room.roomRate)
|
||||
)
|
||||
@@ -227,7 +225,6 @@ export default function SummaryUI({
|
||||
<BookingCodeChip
|
||||
isCampaign={isAllCampaignRate}
|
||||
bookingCode={booking.bookingCode}
|
||||
isBreakfastIncluded={isAllBreakfastIncluded}
|
||||
alignCenter
|
||||
/>
|
||||
<Divider className={styles.bottomDivider} color="Border/Divider/Subtle" />
|
||||
|
||||
@@ -12,7 +12,6 @@ interface BookingCodeRowProps {
|
||||
|
||||
export default function BookingCodeRow({
|
||||
bookingCode,
|
||||
isBreakfastIncluded,
|
||||
isCampaignRate,
|
||||
}: BookingCodeRowProps) {
|
||||
if (!bookingCode) {
|
||||
@@ -24,7 +23,6 @@ export default function BookingCodeRow({
|
||||
<td colSpan={2} align="left">
|
||||
<BookingCodeChip
|
||||
bookingCode={bookingCode}
|
||||
isBreakfastIncluded={isBreakfastIncluded}
|
||||
isCampaign={isCampaignRate}
|
||||
/>
|
||||
</td>
|
||||
|
||||
@@ -91,8 +91,6 @@ export default function PriceDetailsTable({
|
||||
const departue = dt(toDate).locale(lang).format(longDateFormat[lang])
|
||||
const duration = ` ${arrival} - ${departue} (${nightsMsg})`
|
||||
|
||||
const isAllBreakfastIncluded = rooms.every((room) => room.breakfastIncluded)
|
||||
|
||||
const allPricesIsDiscounted = rooms.every((room) => {
|
||||
if (!("regular" in room.price)) {
|
||||
return false
|
||||
@@ -223,7 +221,6 @@ export default function PriceDetailsTable({
|
||||
|
||||
<BookingCodeRow
|
||||
isCampaignRate={isCampaignRate}
|
||||
isBreakfastIncluded={isAllBreakfastIncluded}
|
||||
bookingCode={bookingCode}
|
||||
/>
|
||||
</Tbody>
|
||||
|
||||
@@ -45,32 +45,14 @@ export const WithCloseButton: Story = {
|
||||
),
|
||||
}
|
||||
|
||||
export const CampaignBreakfastIncluded: Story = {
|
||||
export const CampaignWithoutBookingCode: Story = {
|
||||
args: {},
|
||||
render: () => (
|
||||
<BookingCodeChip isCampaign bookingCode="SUMMER25" isBreakfastIncluded />
|
||||
),
|
||||
}
|
||||
|
||||
export const CampaignBreakfastExcluded: Story = {
|
||||
args: {},
|
||||
render: () => (
|
||||
<BookingCodeChip
|
||||
isCampaign
|
||||
bookingCode="SUMMER25"
|
||||
isBreakfastIncluded={false}
|
||||
/>
|
||||
),
|
||||
render: () => <BookingCodeChip isCampaign />,
|
||||
}
|
||||
|
||||
export const CampaignFilledIcon: Story = {
|
||||
args: {},
|
||||
render: () => (
|
||||
<BookingCodeChip
|
||||
isCampaign
|
||||
bookingCode="SUMMER25"
|
||||
isBreakfastIncluded
|
||||
filledIcon
|
||||
/>
|
||||
<BookingCodeChip isCampaign bookingCode="SUMMER25" filledIcon />
|
||||
),
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@ import styles from './bookingCodeChip.module.css'
|
||||
type BaseBookingCodeChipProps = {
|
||||
alignCenter?: boolean
|
||||
bookingCode?: string | null
|
||||
isBreakfastIncluded?: boolean
|
||||
isCampaign?: boolean
|
||||
isUnavailable?: boolean
|
||||
withText?: boolean
|
||||
@@ -33,7 +32,6 @@ type BookingCodeChipProps =
|
||||
export function BookingCodeChip({
|
||||
alignCenter,
|
||||
bookingCode,
|
||||
isBreakfastIncluded,
|
||||
isCampaign,
|
||||
isUnavailable,
|
||||
withText = true,
|
||||
@@ -61,19 +59,11 @@ export function BookingCodeChip({
|
||||
{intl.formatMessage({ defaultMessage: 'Campaign' })}
|
||||
</strong>
|
||||
</Typography>
|
||||
<Typography variant="Body/Supporting text (caption)/smRegular">
|
||||
<span>
|
||||
{isBreakfastIncluded
|
||||
? // eslint-disable-next-line formatjs/no-literal-string-in-jsx
|
||||
`${bookingCode ?? ''} ${intl.formatMessage({
|
||||
defaultMessage: 'Breakfast included',
|
||||
})}`
|
||||
: // eslint-disable-next-line formatjs/no-literal-string-in-jsx
|
||||
`${bookingCode ?? ''} ${intl.formatMessage({
|
||||
defaultMessage: 'Breakfast excluded',
|
||||
})}`}
|
||||
</span>
|
||||
</Typography>
|
||||
{bookingCode && (
|
||||
<Typography variant="Body/Supporting text (caption)/smRegular">
|
||||
<span>{bookingCode}</span>
|
||||
</Typography>
|
||||
)}
|
||||
</p>
|
||||
</IconChip>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user