
committed by
Eugen Rochko

14 changed files with 65 additions and 992 deletions
@ -1,15 +0,0 @@ |
|||
import { configure } from '@storybook/react'; |
|||
import { addLocaleData } from 'react-intl'; |
|||
import en from 'react-intl/locale-data/en'; |
|||
import '../app/javascript/styles/application.scss'; |
|||
import './storybook.scss'; |
|||
|
|||
addLocaleData(en); |
|||
|
|||
let req = require.context('./stories/', true, /.story.js$/); |
|||
|
|||
function loadStories () { |
|||
req.keys().forEach((filename) => req(filename)); |
|||
} |
|||
|
|||
configure(loadStories, module); |
@ -1,24 +0,0 @@ |
|||
export default { |
|||
meta: { |
|||
admin: 1, |
|||
domain: 'example.com', |
|||
me: 2, |
|||
}, |
|||
accounts: { |
|||
1: { |
|||
acct: 'admin', |
|||
avatar: '/avatars/original/missing.png', |
|||
id: 1, |
|||
url: 'https://example.com/@admin', |
|||
}, |
|||
2: { |
|||
acct: 'user', |
|||
avatar: '/avatars/original/missing.png', |
|||
id: 1, |
|||
url: 'https://example.com/@user', |
|||
}, |
|||
}, |
|||
media_attachments: { |
|||
accept_content_types: [], |
|||
}, |
|||
}; |
@ -1,18 +0,0 @@ |
|||
import React from 'react'; |
|||
import { List } from 'immutable'; |
|||
import { storiesOf } from '@storybook/react'; |
|||
import { action } from '@storybook/addon-actions'; |
|||
import AutosuggestTextarea from 'mastodon/components/autosuggest_textarea'; |
|||
|
|||
const props = { |
|||
onChange: action('changed'), |
|||
onPaste: action('pasted'), |
|||
onSuggestionSelected: action('suggestionsSelected'), |
|||
onSuggestionsClearRequested: action('suggestionsClearRequested'), |
|||
onSuggestionsFetchRequested: action('suggestionsFetchRequested'), |
|||
suggestions: List([]), |
|||
}; |
|||
|
|||
storiesOf('AutosuggestTextarea', module) |
|||
.add('default state', () => <AutosuggestTextarea value='' {...props} />) |
|||
.add('with text', () => <AutosuggestTextarea value='Hello' {...props} />); |
@ -1,18 +0,0 @@ |
|||
import React from 'react'; |
|||
import { storiesOf } from '@storybook/react'; |
|||
import { action } from '@storybook/addon-actions'; |
|||
import Button from 'mastodon/components/button'; |
|||
|
|||
storiesOf('Button', module) |
|||
.add('default state', () => ( |
|||
<Button text='submit' onClick={action('clicked')} /> |
|||
)) |
|||
.add('secondary', () => ( |
|||
<Button secondary text='submit' onClick={action('clicked')} /> |
|||
)) |
|||
.add('disabled', () => ( |
|||
<Button disabled text='submit' onClick={action('clicked')} /> |
|||
)) |
|||
.add('block', () => ( |
|||
<Button block text='submit' onClick={action('clicked')} /> |
|||
)); |
@ -1,21 +0,0 @@ |
|||
import React from 'react'; |
|||
import { storiesOf } from '@storybook/react'; |
|||
import CharacterCounter from 'mastodon/features/compose/components/character_counter'; |
|||
|
|||
storiesOf('CharacterCounter', module) |
|||
.add('no text', () => { |
|||
const text = ''; |
|||
return <CharacterCounter text={text} max={500} />; |
|||
}) |
|||
.add('a few strings text', () => { |
|||
const text = '0123456789'; |
|||
return <CharacterCounter text={text} max={500} />; |
|||
}) |
|||
.add('the same text', () => { |
|||
const text = '01234567890123456789'; |
|||
return <CharacterCounter text={text} max={20} />; |
|||
}) |
|||
.add('over text', () => { |
|||
const text = '01234567890123456789012345678901234567890123456789'; |
|||
return <CharacterCounter text={text} max={10} />; |
|||
}); |
@ -1,12 +0,0 @@ |
|||
import React from 'react'; |
|||
import { IntlProvider } from 'react-intl'; |
|||
import { storiesOf } from '@storybook/react'; |
|||
import en from 'mastodon/locales/en.json'; |
|||
import LoadingIndicator from 'mastodon/components/loading_indicator'; |
|||
|
|||
storiesOf('LoadingIndicator', module) |
|||
.add('default state', () => ( |
|||
<IntlProvider locale='en' messages={en}> |
|||
<LoadingIndicator /> |
|||
</IntlProvider> |
|||
)); |
@ -1,24 +0,0 @@ |
|||
import React from 'react'; |
|||
import { Provider } from 'react-redux'; |
|||
import { IntlProvider } from 'react-intl'; |
|||
import { storiesOf } from '@storybook/react'; |
|||
import { action } from '@storybook/addon-actions'; |
|||
import en from 'mastodon/locales/en.json'; |
|||
import configureStore from 'mastodon/store/configureStore'; |
|||
import { hydrateStore } from 'mastodon/actions/store'; |
|||
import OnboadingModal from 'mastodon/features/ui/components/onboarding_modal'; |
|||
import initialState from '../initial_state'; |
|||
|
|||
const store = configureStore(); |
|||
store.dispatch(hydrateStore(initialState)); |
|||
|
|||
storiesOf('OnboadingModal', module) |
|||
.add('default state', () => ( |
|||
<IntlProvider locale='en' messages={en}> |
|||
<Provider store={store}> |
|||
<div style={{ position: 'absolute' }}> |
|||
<OnboadingModal onClose={action('close')} /> |
|||
</div> |
|||
</Provider> |
|||
</IntlProvider> |
|||
)); |
@ -1,3 +0,0 @@ |
|||
#root { |
|||
padding: 4rem; |
|||
} |
@ -1,21 +0,0 @@ |
|||
const path = require('path'); |
|||
|
|||
module.exports = { |
|||
module: { |
|||
rules: [ |
|||
{ |
|||
test: /\.(jpg|jpeg|png|gif|svg|eot|ttf|woff|woff2)$/i, |
|||
loader: 'url-loader', |
|||
}, |
|||
{ |
|||
test: /.scss$/, |
|||
loaders: ['style-loader', 'css-loader', 'postcss-loader', 'sass-loader'], |
|||
}, |
|||
], |
|||
}, |
|||
resolve: { |
|||
alias: { |
|||
mastodon: path.resolve(__dirname, '..', 'app', 'javascript', 'mastodon'), |
|||
}, |
|||
}, |
|||
}; |
File diff suppressed because it is too large
Loading…
Reference in new issue