This repository has been archived by the owner on Jul 4, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding default Storybook config to the project
- Loading branch information
Jan Hoogeveen
committed
Feb 22, 2017
1 parent
e06ac01
commit f2888dc
Showing
6 changed files
with
81 additions
and
4 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 |
---|---|---|
|
@@ -25,6 +25,7 @@ node_modules | |
|
||
# build directory | ||
build | ||
.out | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
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,7 @@ | ||
import { configure } from '@kadira/storybook'; | ||
|
||
function loadStories() { | ||
require('../stories'); | ||
} | ||
|
||
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,19 @@ | ||
/** | ||
* This webpack config is only used by storybook | ||
* We modified it a little bit to mimick the way we load | ||
* CSS/Scss files in the main project | ||
*/ | ||
|
||
const path = require('path'); | ||
|
||
module.exports = { | ||
module: { | ||
loaders: [ | ||
{ | ||
test: /.scss$/, | ||
loaders: ['style', 'css?modules=1', '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,46 @@ | ||
import React from 'react'; | ||
import { storiesOf, action } from '@kadira/storybook'; | ||
import { Count } from '../src/components/Count'; | ||
import '../src/containers/App/styles.scss'; | ||
|
||
storiesOf('Count', module) | ||
.add('Empty', () => ( | ||
<Count | ||
shouldIncrement={action('increment it')} | ||
promiseIncrement={action('promise increment it')} | ||
count={0} | ||
promiseCount={0} | ||
rejectionCount={0} | ||
promisePending={false} | ||
/> | ||
)) | ||
.add('Promise pending', () => ( | ||
<Count | ||
shouldIncrement={action('increment it')} | ||
promiseIncrement={action('promise increment it')} | ||
count={0} | ||
promiseCount={0} | ||
rejectionCount={0} | ||
promisePending | ||
/> | ||
)) | ||
.add('Count 1', () => ( | ||
<Count | ||
shouldIncrement={action('increment it')} | ||
promiseIncrement={action('promise increment it')} | ||
count={1} | ||
promiseCount={0} | ||
rejectionCount={0} | ||
promisePending={false} | ||
/> | ||
)) | ||
.add('Promise count 1', () => ( | ||
<Count | ||
shouldIncrement={action('increment it')} | ||
promiseIncrement={action('promise increment it')} | ||
count={0} | ||
promiseCount={1} | ||
rejectionCount={0} | ||
promisePending={false} | ||
/> | ||
)); |