-
Notifications
You must be signed in to change notification settings - Fork 0
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 #9 from 4so-fourseasons/minor-story-changes
Change README display and add root README to stories
- Loading branch information
Showing
5 changed files
with
80 additions
and
85 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
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 |
---|---|---|
@@ -1,81 +1,70 @@ | ||
import React from 'react' | ||
import { storiesOf } from '@storybook/react' | ||
import { withDocs } from 'storybook-readme' | ||
import { withDocs, withReadme } from 'storybook-readme' | ||
|
||
import README from './makeWithLoadingIndicator.README.md' | ||
import README from '../../README.md' | ||
|
||
import ComponentREADME from './makeWithLoadingIndicator.README.md' | ||
import { makeWithLoadingIndicator } from './makeWithLoadingIndicator.jsx' | ||
|
||
const WrappedComponent = (props) => ( | ||
<h1>Wrapped Component</h1> | ||
) | ||
|
||
storiesOf('HOCS/makeWithLoadingIndicator', module) | ||
.add('Condition is false -> display wrapped Component', withDocs( | ||
README, | ||
() => { | ||
const WithLoadingIndicator = makeWithLoadingIndicator({ | ||
condition: () => false | ||
})(WrappedComponent) | ||
.addDecorator(withDocs(ComponentREADME)) | ||
.addDecorator(withReadme(README)) | ||
.add('Condition is false -> display wrapped Component', () => { | ||
const WithLoadingIndicator = makeWithLoadingIndicator({ | ||
condition: () => false | ||
})(WrappedComponent) | ||
|
||
return ( | ||
<WithLoadingIndicator /> | ||
) | ||
}) | ||
return ( | ||
<WithLoadingIndicator /> | ||
) | ||
.add('Condition is true -> display loading indicator', withDocs( | ||
README, | ||
() => { | ||
const WithLoadingIndicator = makeWithLoadingIndicator({ | ||
condition: () => true | ||
})(WrappedComponent) | ||
}) | ||
.add('Condition is true -> display loading indicator', () => { | ||
const WithLoadingIndicator = makeWithLoadingIndicator({ | ||
condition: () => true | ||
})(WrappedComponent) | ||
|
||
return ( | ||
<WithLoadingIndicator /> | ||
) | ||
}) | ||
) | ||
.add('Overwrite spinnerConfig', withDocs( | ||
README, | ||
() => { | ||
const WithLoadingIndicator = makeWithLoadingIndicator({ | ||
condition: () => true, | ||
spinnerConfig: { | ||
highlightColor: 'green' | ||
} | ||
})(WrappedComponent) | ||
return ( | ||
<WithLoadingIndicator /> | ||
) | ||
}) | ||
.add('Overwrite spinnerConfig', () => { | ||
const WithLoadingIndicator = makeWithLoadingIndicator({ | ||
condition: () => true, | ||
spinnerConfig: { | ||
highlightColor: 'green' | ||
} | ||
})(WrappedComponent) | ||
|
||
return ( | ||
<WithLoadingIndicator /> | ||
) | ||
}) | ||
) | ||
.add('Specify spinner', withDocs( | ||
README, | ||
() => { | ||
const WithLoadingIndicator = makeWithLoadingIndicator({ | ||
condition: () => true, | ||
spinnerType: 'Cube' | ||
})(WrappedComponent) | ||
return ( | ||
<WithLoadingIndicator /> | ||
) | ||
}) | ||
.add('Specify spinner', () => { | ||
const WithLoadingIndicator = makeWithLoadingIndicator({ | ||
condition: () => true, | ||
spinnerType: 'Cube' | ||
})(WrappedComponent) | ||
|
||
return ( | ||
<WithLoadingIndicator /> | ||
) | ||
}) | ||
) | ||
.add('Specify custom component as spinner', withDocs( | ||
README, | ||
() => { | ||
const CustomComponent = (props) => ( | ||
<h1>Custom Component</h1> | ||
return ( | ||
<WithLoadingIndicator /> | ||
) | ||
}) | ||
.add('Specify custom component as spinner', () => { | ||
const CustomComponent = (props) => ( | ||
<h1>Custom Component</h1> | ||
) | ||
|
||
const WithLoadingIndicator = makeWithLoadingIndicator({ | ||
condition: () => true, | ||
spinnerType: CustomComponent | ||
})(WrappedComponent) | ||
const WithLoadingIndicator = makeWithLoadingIndicator({ | ||
condition: () => true, | ||
spinnerType: CustomComponent | ||
})(WrappedComponent) | ||
|
||
return ( | ||
<WithLoadingIndicator /> | ||
) | ||
}) | ||
) | ||
return ( | ||
<WithLoadingIndicator /> | ||
) | ||
}) |
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 |
---|---|---|
@@ -1,18 +1,19 @@ | ||
import React from 'react' | ||
import { storiesOf } from '@storybook/react' | ||
import { withDocs } from 'storybook-readme' | ||
import { withDocs, withReadme } from 'storybook-readme' | ||
|
||
import README from './README.md' | ||
import README from '../../../README.md' | ||
|
||
import ComponentREADME from './README.md' | ||
import Cube from './index.jsx' | ||
|
||
storiesOf('components/Cube', module) | ||
.add('Default', withDocs( | ||
README, | ||
() => ( | ||
<Cube | ||
size={40} | ||
dark='#333333' | ||
light='#c8022f' | ||
/> | ||
)) | ||
) | ||
.addDecorator(withDocs(ComponentREADME)) | ||
.addDecorator(withReadme(README)) | ||
.add('Default', () => ( | ||
<Cube | ||
size={40} | ||
dark='#333333' | ||
light='#c8022f' | ||
/> | ||
)) |
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 |
---|---|---|
@@ -1,14 +1,15 @@ | ||
import React from 'react' | ||
import { storiesOf } from '@storybook/react' | ||
import { withDocs } from 'storybook-readme' | ||
import { withDocs, withReadme } from 'storybook-readme' | ||
|
||
import README from './README.md' | ||
import README from '../../../README.md' | ||
|
||
import ComponentREADME from './README.md' | ||
import SimpleCircle from './index.jsx' | ||
|
||
storiesOf('components/SimpleCircle', module) | ||
.add('Default', withDocs( | ||
README, | ||
() => ( | ||
<SimpleCircle /> | ||
)) | ||
) | ||
.addDecorator(withDocs(ComponentREADME)) | ||
.addDecorator(withReadme(README)) | ||
.add('Default', () => ( | ||
<SimpleCircle /> | ||
)) |