-
Notifications
You must be signed in to change notification settings - Fork 23
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 #74 from kiki-le-singe/implement_storybook
Implement storybook
- Loading branch information
Showing
6 changed files
with
962 additions
and
92 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,12 @@ | ||
import { configure, setAddon } from '@kadira/storybook' | ||
import infoAddon from '@kadira/react-storybook-addon-info' | ||
|
||
setAddon(infoAddon) | ||
|
||
const req = require.context('../src/common/components', true, /.stories.js$/) | ||
|
||
function loadStories() { | ||
req.keys().forEach(filename => req(filename)) | ||
} | ||
|
||
configure(loadStories, module) |
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,13 @@ | ||
const path = require('path') | ||
|
||
module.exports = { | ||
module: { | ||
loaders: [ | ||
{ | ||
test: /.scss$/, | ||
loaders: ['style', 'css', 'sass'], | ||
include: path.resolve(__dirname, '../') | ||
} | ||
] | ||
} | ||
} |
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
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,45 @@ | ||
import React from 'react' | ||
import { storiesOf } from '@kadira/storybook' | ||
import Hello from './Hello' | ||
|
||
import '../../styles/global/views/hello.scss' | ||
|
||
storiesOf('Hello', module) | ||
.addWithInfo( | ||
'without props', | ||
` | ||
This is the basic usage with the Hello component. | ||
`, | ||
() => ( | ||
<Hello /> | ||
) | ||
) | ||
.addWithInfo( | ||
'with name props as string', | ||
` | ||
This is the basic usage with the name props as string. | ||
`, | ||
() => ( | ||
<Hello name="World" /> | ||
) | ||
) | ||
.addWithInfo( | ||
'with name props as element', | ||
` | ||
This is the basic usage with the name props as element. | ||
`, | ||
() => ( | ||
<Hello name={<span className="text">World!</span>} /> | ||
) | ||
) | ||
.addWithInfo( | ||
'with some styles', | ||
` | ||
This is the basic usage with some styles. | ||
`, | ||
() => ( | ||
<div className="view__hello"> | ||
<Hello name={<span className="text">World!</span>} /> | ||
</div> | ||
) | ||
) |
Oops, something went wrong.