Skip to content

Commit

Permalink
add stories
Browse files Browse the repository at this point in the history
  • Loading branch information
milkman4 committed Dec 11, 2024
1 parent 270100d commit 2981cc5
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
10 changes: 10 additions & 0 deletions stories/props/eventIdAccessor.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Canvas, Story } from '@storybook/addon-docs'

# eventIdAccessor

- type: `string | function (event: Object) => string`
- default: 'id'

The id of the event. Must resolve to a string. Used as the key for the event in the DOM. If not provided, the event will be given a key of 'evt\_<index>'.

<Story id="props--event-id-accessor" />
33 changes: 33 additions & 0 deletions stories/props/eventIdAccessor.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import React from 'react'
import { Calendar } from '../../src'
import { accessorStoryArgs } from './storyDefaults'
import mdx from './eventIdAccessor.mdx'

export default {
title: 'props',
component: Calendar,
argTypes: {
localizer: { control: { type: null } },
events: { control: { type: null } },
defaultDate: {
control: {
type: null,
},
},
},
parameters: {
docs: {
page: mdx,
},
},
}

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

export const EventIdAccessor = Template.bind({})
EventIdAccessor.storyName = 'eventIdAccessor'
EventIdAccessor.args = accessorStoryArgs
1 change: 1 addition & 0 deletions stories/props/storyDefaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const accessorStoryArgs = {
titleAccessor: 'label',
tooltipAccessor: 'label',
startAccessor: 'startDate',
idAccessor: 'id',
}
/** END Specific to event key accessors */

Expand Down

0 comments on commit 2981cc5

Please sign in to comment.