* Update naming of guidelines section and improve Introduction page * Add Docs * Add docs * Install Docs add-on - Rename top-level folders and sort manually - Add MDX static pages * Updated all Storybook addons to 6.1.3 except for notes as it's currently 5.3.21 * Fixed naming of section for the select component. * Updated yarn.lock file. * Added missing dependency @storybook/addon-docs Co-authored-by: Nick Taylor <nick@dev.to>
62 lines
1.3 KiB
JavaScript
62 lines
1.3 KiB
JavaScript
import { h } from 'preact';
|
|
import { action } from '@storybook/addon-actions';
|
|
import { withKnobs, select } from '@storybook/addon-knobs';
|
|
import {
|
|
CommentSubscription,
|
|
COMMENT_SUBSCRIPTION_TYPE,
|
|
} from '../CommentSubscription';
|
|
|
|
export default {
|
|
title: 'App Components/Comment Subscription',
|
|
decorators: [withKnobs],
|
|
};
|
|
|
|
const commonProps = {
|
|
onSubscribe: action('subscribed'),
|
|
onUnsubscribe: action('unsubscribed'),
|
|
};
|
|
|
|
export const Unsubscribed = () => (
|
|
<CommentSubscription
|
|
{...commonProps}
|
|
subscriptionType={select(
|
|
'subscriptionType',
|
|
COMMENT_SUBSCRIPTION_TYPE,
|
|
COMMENT_SUBSCRIPTION_TYPE.NOT_SUBSCRIBED,
|
|
)}
|
|
/>
|
|
);
|
|
|
|
Unsubscribed.story = {
|
|
name: 'unsubscribed',
|
|
};
|
|
|
|
export const Subscribed = () => (
|
|
<CommentSubscription
|
|
{...commonProps}
|
|
subscriptionType={select(
|
|
'subscriptionType',
|
|
COMMENT_SUBSCRIPTION_TYPE,
|
|
COMMENT_SUBSCRIPTION_TYPE.ALL,
|
|
)}
|
|
/>
|
|
);
|
|
|
|
Subscribed.story = {
|
|
name: 'subscribed',
|
|
};
|
|
|
|
export const SubscribedButNotDefault = () => (
|
|
<CommentSubscription
|
|
{...commonProps}
|
|
subscriptionType={select(
|
|
'subscriptionType',
|
|
COMMENT_SUBSCRIPTION_TYPE,
|
|
COMMENT_SUBSCRIPTION_TYPE.AUTHOR,
|
|
)}
|
|
/>
|
|
);
|
|
|
|
SubscribedButNotDefault.story = {
|
|
name: 'subscribed (with comment type other than the default',
|
|
};
|