Skip to content

Commit c7cd908

Browse files
authored
docs: add decorator to wrap story in container (jquense#2385)
1 parent 67db3d7 commit c7cd908

File tree

5 files changed

+36
-6
lines changed

5 files changed

+36
-6
lines changed

stories/Calendar.stories.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,16 @@ import customComponents from './resources/customComponents'
1212
export default {
1313
title: 'Additional Examples',
1414
component: Calendar,
15+
decorators: [
16+
(Story) => (
17+
<div className="height600">
18+
<Story />
19+
</div>
20+
),
21+
],
1522
}
1623

17-
const Template = (args) => (
18-
<div className="height600">
19-
<BaseCalendar {...args} />
20-
</div>
21-
)
24+
const Template = (args) => <BaseCalendar {...args} />
2225

2326
export const ComplexDayViewLayout = Template.bind({})
2427
ComplexDayViewLayout.storyName = 'complex day view layout'

stories/DragAndDrop.stories.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ import customComponents from './resources/customComponents'
77
export default {
88
title: 'Additional Examples/Drag and Drop',
99
component: Calendar,
10+
decorators: [
11+
(Story) => (
12+
<div className="height600">
13+
<Story />
14+
</div>
15+
),
16+
],
1017
}
1118

1219
const Template = (args) => (

stories/Durations.stories.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React from 'react'
2-
import { action } from '@storybook/addon-actions'
32
import {
43
Calendar,
54
Views,
@@ -25,6 +24,13 @@ const DraggableCalendar = withDragAndDrop(Calendar)
2524
export default {
2625
title: 'Additional Examples/Event Durations',
2726
component: Calendar,
27+
decorators: [
28+
(Story) => (
29+
<div className="height600">
30+
<Story />
31+
</div>
32+
),
33+
],
2834
}
2935

3036
const Template = ({ localizer: loc = 'moment', ...args }) => {

stories/Layout.stories.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ import createEvents from './helpers/createEvents'
99
export default {
1010
title: 'Additional Examples/Layout',
1111
component: Calendar,
12+
decorators: [
13+
(Story) => (
14+
<div className="height600">
15+
<Story />
16+
</div>
17+
),
18+
],
1219
}
1320

1421
const Template = (args) => <Calendar {...args} />

stories/Timeslots.stories.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ import { Calendar as BaseCalendar, Views, events } from './helpers'
77
export default {
88
title: 'Additional Examples/Timeslots',
99
component: Calendar,
10+
decorators: [
11+
(Story) => (
12+
<div className="height600">
13+
<Story />
14+
</div>
15+
),
16+
],
1017
}
1118

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

0 commit comments

Comments
 (0)