-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate molecules from CSF 2 to CSF 3
- Loading branch information
Showing
4 changed files
with
136 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,30 @@ | ||
import {ComponentMeta, ComponentStory} from '@storybook/react'; | ||
import {Meta, StoryObj} from '@storybook/react'; | ||
|
||
import {PerkInfo} from './perk-info.component'; | ||
|
||
export default { | ||
title: 'Molecules/PerkInfo', | ||
component: PerkInfo, | ||
} as ComponentMeta<typeof PerkInfo>; | ||
} as Meta<typeof PerkInfo>; | ||
|
||
const Template: ComponentStory<typeof PerkInfo> = (args) => ( | ||
<PerkInfo {...args} /> | ||
); | ||
type Story = StoryObj<typeof PerkInfo>; | ||
|
||
export const GamesPerk = Template.bind({}); | ||
GamesPerk.args = { | ||
icon: 'games', | ||
children: 'Juegos de mesa', | ||
export const GamesPerk: Story = { | ||
render: (args) => <PerkInfo {...args} />, | ||
args: {icon: 'games', children: 'Juegos de mesa'}, | ||
}; | ||
|
||
export const EventsPerk = Template.bind({}); | ||
EventsPerk.args = { | ||
icon: 'events', | ||
children: 'Hosteo de eventos', | ||
export const EventsPerk: Story = { | ||
render: (args) => <PerkInfo {...args} />, | ||
args: {icon: 'events', children: 'Hosteo de eventos'}, | ||
}; | ||
|
||
export const IngredientsPerk = Template.bind({}); | ||
IngredientsPerk.args = { | ||
icon: 'ingredients', | ||
children: 'Ingredientes 100% naturales', | ||
export const IngredientsPerk: Story = { | ||
render: (args) => <PerkInfo {...args} />, | ||
args: {icon: 'ingredients', children: 'Ingredientes 100% naturales'}, | ||
}; | ||
|
||
export const InternetPerk = Template.bind({}); | ||
InternetPerk.args = { | ||
icon: 'internet', | ||
children: 'Internet Rápido', | ||
export const InternetPerk: Story = { | ||
render: (args) => <PerkInfo {...args} />, | ||
args: {icon: 'internet', children: 'Internet Rápido'}, | ||
}; |
52 changes: 35 additions & 17 deletions
52
app/components/molecules/promotion-card/promotion-card.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,48 @@ | ||
import {ComponentMeta, ComponentStory} from '@storybook/react'; | ||
import {Meta, StoryObj} from '@storybook/react'; | ||
|
||
import {PromotionCard} from './promotion-card.component'; | ||
import {CustomLink} from '../../atoms/link'; | ||
|
||
export default { | ||
title: 'Molecules/PromotionCard', | ||
component: PromotionCard, | ||
} as ComponentMeta<typeof PromotionCard>; | ||
} as Meta<typeof PromotionCard>; | ||
|
||
const Template: ComponentStory<typeof PromotionCard> = (args) => ( | ||
<PromotionCard {...args} /> | ||
); | ||
type Story = StoryObj<typeof PromotionCard>; | ||
|
||
export const Default = Template.bind({}); | ||
Default.args = { | ||
image: 'https://placehold.co/600x800.png', | ||
label: 'Latte pilonsillo', | ||
export const Default: Story = { | ||
render: (args) => ( | ||
<div style={{width: '280px'}}> | ||
<PromotionCard {...args} /> | ||
</div> | ||
), | ||
args: { | ||
image: 'https://placehold.co/600x800.png', | ||
label: 'Latte pilonsillo', | ||
linkRender: (props) => <CustomLink {...props} />, | ||
}, | ||
}; | ||
|
||
export const IsRecommended = Template.bind({}); | ||
IsRecommended.args = { | ||
...Default.args, | ||
isRecommended: true, | ||
export const IsRecommended: Story = { | ||
render: (args) => ( | ||
<div style={{width: '280px'}}> | ||
<PromotionCard {...args} /> | ||
</div> | ||
), | ||
args: { | ||
...Default.args, | ||
isRecommended: true, | ||
}, | ||
}; | ||
|
||
export const IsSeasonal = Template.bind({}); | ||
IsSeasonal.args = { | ||
...Default.args, | ||
isSeasonal: true, | ||
export const IsSeasonal: Story = { | ||
render: (args) => ( | ||
<div style={{width: '280px'}}> | ||
<PromotionCard {...args} /> | ||
</div> | ||
), | ||
args: { | ||
...Default.args, | ||
isSeasonal: true, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters