Feat/SW-1719 strikethrough rates * feat(SW-1719): Strikethrough rate if logged in on regular rate cards * feat(SW-1719): Strikethrough rate if logged in on rate summary * feat(SW-1719): Strikethrough rate if logged in on mobile rate summary * feat(SW-1719): Strikethrough rate if logged in on enter details * feat(SW-1719): Strikethrough rate support for multiple rooms * feat(SW-1719): booking receipt fixes on confirmation page * feat(SW-1719): improve initial total price calculation * feat: harmonize enter details total price to use one and the same function Approved-by: Michael Zetterberg
125 lines
2.5 KiB
TypeScript
125 lines
2.5 KiB
TypeScript
import type { Meta, StoryObj } from '@storybook/react'
|
|
import RegularRateCard from '.'
|
|
|
|
const meta: Meta<typeof RegularRateCard> = {
|
|
title: 'Components/RateCard/Regular',
|
|
component: RegularRateCard,
|
|
decorators: [
|
|
(Story) => (
|
|
<div style={{ maxWidth: '400px' }}>
|
|
<Story />
|
|
</div>
|
|
),
|
|
],
|
|
argTypes: {
|
|
rateTitle: { control: 'text' },
|
|
paymentTerm: { control: 'text' },
|
|
rate: { control: 'object' },
|
|
memberRate: { control: 'object' },
|
|
omnibusRate: { control: 'object' },
|
|
approximateRate: { control: 'object' },
|
|
rateTermDetails: { control: 'object' },
|
|
},
|
|
}
|
|
|
|
export default meta
|
|
|
|
type Story = StoryObj<typeof RegularRateCard>
|
|
|
|
export const Default: Story = {
|
|
args: {
|
|
name: 'regular',
|
|
value: 'regular',
|
|
rateTitle: 'FREE CANCELLATION',
|
|
paymentTerm: 'PAY NOW',
|
|
rate: {
|
|
label: 'Standard Price',
|
|
price: '1980',
|
|
unit: 'SEK/NIGHT',
|
|
},
|
|
memberRate: {
|
|
label: 'Member Price',
|
|
price: '1900',
|
|
unit: 'SEK/NIGHT',
|
|
},
|
|
approximateRate: {
|
|
price: '198',
|
|
label: 'Approx.',
|
|
unit: 'EUR',
|
|
},
|
|
omnibusRate: {
|
|
label: 'Lowest past price (last 30 days)',
|
|
price: '1690',
|
|
unit: 'SEK/NIGHT',
|
|
},
|
|
rateTermDetails: [
|
|
{
|
|
title: 'Rate definition 1',
|
|
terms: ['term 1', 'term 2', 'term 3'],
|
|
},
|
|
],
|
|
},
|
|
}
|
|
|
|
export const Selected: Story = {
|
|
args: {
|
|
name: 'regular',
|
|
value: 'regular',
|
|
isSelected: true,
|
|
rateTitle: 'FREE CANCELLATION',
|
|
paymentTerm: 'PAY NOW',
|
|
rate: {
|
|
label: 'Standard Price',
|
|
price: '1980',
|
|
unit: 'SEK/NIGHT',
|
|
},
|
|
memberRate: {
|
|
label: 'Member Price',
|
|
price: '1900',
|
|
unit: 'SEK/NIGHT',
|
|
},
|
|
approximateRate: {
|
|
price: '198',
|
|
label: 'Approx.',
|
|
unit: 'EUR',
|
|
},
|
|
rateTermDetails: [
|
|
{
|
|
title: 'Rate definition 1',
|
|
terms: ['term 1', 'term 2', 'term 3'],
|
|
},
|
|
],
|
|
},
|
|
}
|
|
|
|
export const MemberRateActive: Story = {
|
|
args: {
|
|
name: 'regular',
|
|
value: 'regular',
|
|
rateTitle: 'FREE CANCELLATION',
|
|
paymentTerm: 'PAY NOW',
|
|
rate: {
|
|
label: 'Standard Price',
|
|
price: '1980',
|
|
unit: 'SEK',
|
|
},
|
|
memberRate: {
|
|
label: 'Member Price',
|
|
price: '1900',
|
|
unit: 'SEK/NIGHT',
|
|
},
|
|
approximateRate: {
|
|
price: '190',
|
|
label: 'Approx.',
|
|
unit: 'EUR',
|
|
},
|
|
isMemberRateActive: true,
|
|
rateTermDetails: [
|
|
{
|
|
title: 'Rate definition 1',
|
|
terms: ['term 1', 'term 2', 'term 3'],
|
|
},
|
|
],
|
|
},
|
|
}
|