Skip to content

Commit

Permalink
docs: add decorator to wrap story in container (jquense#2385)
Browse files Browse the repository at this point in the history
  • Loading branch information
cutterbl authored Mar 24, 2023
1 parent 67db3d7 commit c7cd908
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 6 deletions.
13 changes: 8 additions & 5 deletions stories/Calendar.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@ import customComponents from './resources/customComponents'
export default {
title: 'Additional Examples',
component: Calendar,
decorators: [
(Story) => (
<div className="height600">
<Story />
</div>
),
],
}

const Template = (args) => (
<div className="height600">
<BaseCalendar {...args} />
</div>
)
const Template = (args) => <BaseCalendar {...args} />

export const ComplexDayViewLayout = Template.bind({})
ComplexDayViewLayout.storyName = 'complex day view layout'
Expand Down
7 changes: 7 additions & 0 deletions stories/DragAndDrop.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ import customComponents from './resources/customComponents'
export default {
title: 'Additional Examples/Drag and Drop',
component: Calendar,
decorators: [
(Story) => (
<div className="height600">
<Story />
</div>
),
],
}

const Template = (args) => (
Expand Down
8 changes: 7 additions & 1 deletion stories/Durations.stories.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react'
import { action } from '@storybook/addon-actions'
import {
Calendar,
Views,
Expand All @@ -25,6 +24,13 @@ const DraggableCalendar = withDragAndDrop(Calendar)
export default {
title: 'Additional Examples/Event Durations',
component: Calendar,
decorators: [
(Story) => (
<div className="height600">
<Story />
</div>
),
],
}

const Template = ({ localizer: loc = 'moment', ...args }) => {
Expand Down
7 changes: 7 additions & 0 deletions stories/Layout.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ import createEvents from './helpers/createEvents'
export default {
title: 'Additional Examples/Layout',
component: Calendar,
decorators: [
(Story) => (
<div className="height600">
<Story />
</div>
),
],
}

const Template = (args) => <Calendar {...args} />
Expand Down
7 changes: 7 additions & 0 deletions stories/Timeslots.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ import { Calendar as BaseCalendar, Views, events } from './helpers'
export default {
title: 'Additional Examples/Timeslots',
component: Calendar,
decorators: [
(Story) => (
<div className="height600">
<Story />
</div>
),
],
}

const Template = (args) => <BaseCalendar {...args} />
Expand Down

0 comments on commit c7cd908

Please sign in to comment.