about summary refs log tree commit diff
path: root/storybook
diff options
context:
space:
mode:
authorkibigo! <marrus-sh@users.noreply.github.com>2017-08-01 13:07:43 -0700
committerkibigo! <marrus-sh@users.noreply.github.com>2017-08-01 13:20:29 -0700
commit8150689b48716bb016d492d28cef08600a4b315e (patch)
treea05a2539e894c79ef17698dce0da5a6af0c25bf6 /storybook
parentb61e3daf983d87c6d2de7e54d420c2e8f5a531e6 (diff)
parent7ef848256871454a790a9b7cc725053c67ba3da4 (diff)
Merge upstream (#111)
Diffstat (limited to 'storybook')
-rw-r--r--storybook/config.js15
-rw-r--r--storybook/initial_state.js24
-rw-r--r--storybook/stories/autosuggest_textarea.story.js18
-rw-r--r--storybook/stories/button.story.js18
-rw-r--r--storybook/stories/character_counter.story.js21
-rw-r--r--storybook/stories/loading_indicator.story.js12
-rw-r--r--storybook/stories/onboarding_modal.story.js24
-rw-r--r--storybook/storybook.scss3
-rw-r--r--storybook/webpack.config.js21
9 files changed, 0 insertions, 156 deletions
diff --git a/storybook/config.js b/storybook/config.js
deleted file mode 100644
index 87479560f..000000000
--- a/storybook/config.js
+++ /dev/null
@@ -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);
diff --git a/storybook/initial_state.js b/storybook/initial_state.js
deleted file mode 100644
index 3872586f6..000000000
--- a/storybook/initial_state.js
+++ /dev/null
@@ -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: [],
-  },
-};
diff --git a/storybook/stories/autosuggest_textarea.story.js b/storybook/stories/autosuggest_textarea.story.js
deleted file mode 100644
index 65dfe965c..000000000
--- a/storybook/stories/autosuggest_textarea.story.js
+++ /dev/null
@@ -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} />);
diff --git a/storybook/stories/button.story.js b/storybook/stories/button.story.js
deleted file mode 100644
index 1971451e8..000000000
--- a/storybook/stories/button.story.js
+++ /dev/null
@@ -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')} />
-  ));
diff --git a/storybook/stories/character_counter.story.js b/storybook/stories/character_counter.story.js
deleted file mode 100644
index 39d9afb56..000000000
--- a/storybook/stories/character_counter.story.js
+++ /dev/null
@@ -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} />;
-  });
diff --git a/storybook/stories/loading_indicator.story.js b/storybook/stories/loading_indicator.story.js
deleted file mode 100644
index 6ee822758..000000000
--- a/storybook/stories/loading_indicator.story.js
+++ /dev/null
@@ -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>
-  ));
diff --git a/storybook/stories/onboarding_modal.story.js b/storybook/stories/onboarding_modal.story.js
deleted file mode 100644
index 91727bdb2..000000000
--- a/storybook/stories/onboarding_modal.story.js
+++ /dev/null
@@ -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>
-  ));
diff --git a/storybook/storybook.scss b/storybook/storybook.scss
deleted file mode 100644
index 3bda9e64c..000000000
--- a/storybook/storybook.scss
+++ /dev/null
@@ -1,3 +0,0 @@
-#root {
-  padding: 4rem;
-}
diff --git a/storybook/webpack.config.js b/storybook/webpack.config.js
deleted file mode 100644
index e16910b29..000000000
--- a/storybook/webpack.config.js
+++ /dev/null
@@ -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'),
-    },
-  },
-};