Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: storybook render without error (#862)
License: MIT Signed-off-by: Oli Evans <oli@tableflip.io>
- Loading branch information
Showing
28 changed files
with
146 additions
and
129 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
11 changes: 11 additions & 0 deletions
11
src/components/language-selector/LanguageSelector.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,11 @@ | ||
import React from 'react' | ||
import { storiesOf } from '@storybook/react' | ||
import i18n from '../../i18n' | ||
import LanguageSelector from './LanguageSelector' | ||
|
||
storiesOf('Language Selector', module) | ||
.add('Default', () => ( | ||
<div className='pa4 bg-light-gray'> | ||
<LanguageSelector t={i18n.getFixedT('en', 'settings')} /> | ||
</div> | ||
)) |
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,11 @@ | ||
import React from 'react' | ||
import DnDBackend from './lib/dnd-backend' | ||
import { DragDropContextProvider } from 'react-dnd' | ||
|
||
export default function DndDecorator (fn) { | ||
return ( | ||
<DragDropContextProvider backend={DnDBackend}> | ||
{fn()} | ||
</DragDropContextProvider> | ||
) | ||
} |
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,15 +1,17 @@ | ||
import React from 'react' | ||
import { storiesOf } from '@storybook/react' | ||
import { action } from '@storybook/addon-actions' | ||
import i18n from '../../i18n-decorator' | ||
import DeleteModal from './DeleteModal' | ||
|
||
storiesOf('Files', module) | ||
.addDecorator(i18n) | ||
.add('Delete Modal', () => ( | ||
<div> | ||
<DeleteModal className='ma3' onCancel={action('Cancel')} onDelete={action('Delete')} files={0} folders={1} /> | ||
<DeleteModal className='ma3' onCancel={action('Cancel')} onDelete={action('Delete')} files={0} folders={2} /> | ||
<DeleteModal className='ma3' onCancel={action('Cancel')} onDelete={action('Delete')} files={1} folders={0} /> | ||
<DeleteModal className='ma3' onCancel={action('Cancel')} onDelete={action('Delete')} files={4} folders={0} /> | ||
<DeleteModal className='ma3' onCancel={action('Cancel')} onDelete={action('Delete')} files={1} folders={1} /> | ||
<div className='ma3'> | ||
<DeleteModal | ||
onCancel={action('Cancel')} | ||
onDelete={action('Delete')} | ||
files={4} | ||
folders={0} /> | ||
</div> | ||
)) |
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,11 +1,16 @@ | ||
import React from 'react' | ||
import { storiesOf } from '@storybook/react' | ||
import { action } from '@storybook/addon-actions' | ||
import i18n from '../../i18n-decorator' | ||
import RenameModal from './RenameModal' | ||
|
||
storiesOf('Files', module) | ||
.addDecorator(i18n) | ||
.add('Rename Modal', () => ( | ||
<div className='ma2'> | ||
<RenameModal filename='my-agenda.markdown' onCancel={action('Cancel')} onSubmit={action('Rename')} /> | ||
<div className='ma3'> | ||
<RenameModal | ||
filename='my-agenda.markdown' | ||
onCancel={action('Cancel')} | ||
onSubmit={action('Rename')} /> | ||
</div> | ||
)) |
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,36 +1,24 @@ | ||
import React from 'react' | ||
import { storiesOf } from '@storybook/react' | ||
import { withKnobs, number } from '@storybook/addon-knobs' | ||
import { action } from '@storybook/addon-actions' | ||
import i18n from '../../i18n-decorator' | ||
import SelectedActions from './SelectedActions' | ||
|
||
storiesOf('Files', module) | ||
.add('Actions for One File', () => ( | ||
<div className='ma2'> | ||
.addDecorator(withKnobs) | ||
.addDecorator(i18n) | ||
.add('Selected Actions', () => ( | ||
<div className='ma3'> | ||
<SelectedActions | ||
count={1} | ||
className='mb4' | ||
count={number('Count', 1)} | ||
size={345345} | ||
downloadProgress={null} | ||
unselect={action('Unselect All')} | ||
remove={action('Delete Files')} | ||
share={action('Share Files')} | ||
download={action('Download Files')} | ||
rename={action('Rename Files')} | ||
inspect={action('Inspect Files')} | ||
/> | ||
</div> | ||
)) | ||
.add('Actions for Multiple Files', () => ( | ||
<div className='ma2'> | ||
<SelectedActions | ||
count={17} | ||
size={8518484848} | ||
downloadProgress={null} | ||
unselect={action('Unselect All')} | ||
remove={action('Delete Files')} | ||
share={action('Share Files')} | ||
download={action('Download Files')} | ||
rename={action('Rename Files')} | ||
inspect={action('Inspect Files')} | ||
/> | ||
</div> | ||
inspect={action('Inspect Files')} /> | ||
</div > | ||
)) |
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 React from 'react' | ||
import { storiesOf } from '@storybook/react' | ||
import i18n from '../../i18n-decorator' | ||
import ShareModal from './ShareModal' | ||
|
||
storiesOf('Files', module) | ||
.addDecorator(i18n) | ||
.add('Share Modal', () => ( | ||
<div className='ma3'> | ||
<ShareModal link='https://ipfs.io/ipfs/QmQK3p7MmycDutWkWAzJ4hNN1YBKK9bLTDz9jTtkWf16wC' /> | ||
</div> | ||
)) |
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,11 @@ | ||
import React from 'react' | ||
import { I18nextProvider } from 'react-i18next' | ||
import i18n from './i18n' | ||
|
||
export default function i18nDecorator (fn) { | ||
return ( | ||
<I18nextProvider i18n={i18n}> | ||
{fn()} | ||
</I18nextProvider> | ||
) | ||
} |
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,6 @@ | ||
|
||
@media only screen and (max-height: 680px) { | ||
.navbar-footer { | ||
display: none; | ||
} | ||
} |
Oops, something went wrong.