-
Notifications
You must be signed in to change notification settings - Fork 6
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 #49 from wpmudev/enhance/post
🐛 fix(react-post): Add component to Storybook.
- Loading branch information
Showing
3 changed files
with
49 additions
and
12 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,33 @@ | ||
import React from 'react'; | ||
import { Post } from '../lib/react-post'; | ||
|
||
export default { | ||
title: 'Components/Post', | ||
component: Post | ||
} | ||
|
||
const Template = args => { | ||
return ( | ||
<div style={ { width: '100%', maxWidth: '300px' } }> | ||
<Post {...args} /> | ||
</div> | ||
); | ||
}; | ||
|
||
export const primary = Template.bind({}); | ||
primary.storyName = 'Side Image'; | ||
primary.args = { | ||
image: 'https://www.wpexplorer.com/wp-content/uploads/amazing_fb_ad.png', | ||
title: 'Post Title', | ||
excerpt: '<p>Nullam quis risus eget urna mollis ornare vel eu leo. Maecenas faucibus mollis interdum. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Nullam id dolor id nibh ultricies vehicula ut id elit. Donec id elit non mi porta gravida at eget metus.</p>', | ||
time: '5' | ||
}; | ||
primary.argTypes = {}; | ||
|
||
export const secondary = Template.bind({}); | ||
secondary.storyName = 'Banner Image'; | ||
secondary.args = { | ||
...primary.args, | ||
banner: true | ||
}; | ||
secondary.argTypes = {}; |
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
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