* Added story sorting to Storybook. * Added design system guidelines. * Made Base in Storybook tree 2nd in the tree view. * Now Components are 3rd in the treeview of Storybook. * Now App Components are 4th in the treeview of Storybook. * Froze node version to 12.16.0 * Revert "Froze node version to 12.16.0" This reverts commit 093b119c7d7ca05ecb4e1c0234b24bcf8e7b10a4.
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/react';
|
|
import {
|
|
CommentSubscription,
|
|
COMMENT_SUBSCRIPTION_TYPE,
|
|
} from '../CommentSubscription';
|
|
|
|
export default {
|
|
title: '4_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',
|
|
};
|