about summary refs log tree commit diff
path: root/storybook
diff options
context:
space:
mode:
Diffstat (limited to 'storybook')
-rw-r--r--storybook/initial_state.js24
-rw-r--r--storybook/stories/onboarding_modal.story.js24
2 files changed, 48 insertions, 0 deletions
diff --git a/storybook/initial_state.js b/storybook/initial_state.js
new file mode 100644
index 000000000..3872586f6
--- /dev/null
+++ b/storybook/initial_state.js
@@ -0,0 +1,24 @@
+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/onboarding_modal.story.js b/storybook/stories/onboarding_modal.story.js
new file mode 100644
index 000000000..91727bdb2
--- /dev/null
+++ b/storybook/stories/onboarding_modal.story.js
@@ -0,0 +1,24 @@
+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>
+  ));