-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18824 from storybookjs/tom/sb-581-copy-in-the-ren…
…dererframework-specific Copy example stories over from renderer + addons
- Loading branch information
Showing
6 changed files
with
148 additions
and
6 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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// TODO -- for now react, going to generalise | ||
import React, { FC } from 'react'; | ||
|
||
import { action } from '@storybook/addon-actions'; | ||
|
||
// TODO -- this needs to be a generic component | ||
const Button: FC<{ onClick: () => void }> = ({ onClick, children }) => ( | ||
<button type="button" onClick={onClick}> | ||
{children} | ||
</button> | ||
); | ||
|
||
export default { | ||
component: Button, | ||
}; | ||
|
||
export const BasicExample = { | ||
args: { onClick: action('hello-world') }, | ||
}; |
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
27 changes: 27 additions & 0 deletions
27
code/renderers/react/template/stories/decorators.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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import React, { FC } from 'react'; | ||
import type { ComponentStory, ComponentMeta } from '@storybook/react'; | ||
|
||
const Component: FC = () => <p>Story</p>; | ||
|
||
export default { | ||
component: Component, | ||
decorators: [ | ||
(Story) => ( | ||
<> | ||
<p>Component Decorator</p> | ||
<Story /> | ||
</> | ||
), | ||
], | ||
} as ComponentMeta<typeof Component>; | ||
|
||
export const All: ComponentStory<typeof Component> = { | ||
decorators: [ | ||
(Story) => ( | ||
<> | ||
<p>Local Decorator</p> | ||
<Story /> | ||
</> | ||
), | ||
], | ||
}; |
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
Submodule react
deleted from
28e606
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