-
-
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.
- Loading branch information
Tom Coleman
committed
Mar 1, 2019
1 parent
9f87b71
commit 1e0016c
Showing
2 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
examples/official-storybook/stories/core/decorators.stories.js
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,39 @@ | ||
import React from 'react'; | ||
|
||
// We would need to add this in config.js idomatically however that would make this file a bit confusing | ||
import { addDecorator } from '@storybook/react'; | ||
|
||
addDecorator((s, { kind }) => | ||
kind === 'Core|Decorators' ? ( | ||
<> | ||
<p>Global Decorator</p> | ||
{s()} | ||
</> | ||
) : ( | ||
s() | ||
) | ||
); | ||
|
||
export default { | ||
title: 'Core|Decorators', | ||
decorators: [ | ||
s => ( | ||
<> | ||
<p>Kind Decorator</p> | ||
{s()} | ||
</> | ||
), | ||
], | ||
}; | ||
|
||
export const all = () => <p>Story</p>; | ||
all.parameters = { | ||
decorators: [ | ||
s => ( | ||
<> | ||
<p>Local Decorator</p> | ||
{s()} | ||
</> | ||
), | ||
], | ||
}; |
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