* 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.
53 lines
1.5 KiB
JavaScript
53 lines
1.5 KiB
JavaScript
import { h } from 'preact';
|
|
import { withKnobs, object, text, boolean } from '@storybook/addon-knobs/react';
|
|
import { action } from '@storybook/addon-actions';
|
|
import { Article } from '..';
|
|
import {
|
|
videoArticle,
|
|
assetPath,
|
|
} from '../__tests__/utilities/articleUtilities';
|
|
|
|
import '../../../assets/stylesheets/articles.scss';
|
|
|
|
const ICONS = {
|
|
REACTIONS_ICON: assetPath('reactions-stack.png'),
|
|
COMMENTS_ICON: assetPath('comments-bubble.png'),
|
|
VIDEO_ICON: assetPath('video-camera.svg'),
|
|
};
|
|
|
|
const commonProps = {
|
|
bookmarkClick: action('Saved/unsaved article'),
|
|
};
|
|
|
|
export default {
|
|
title: '4_App Components/Article/Video',
|
|
decorators: [withKnobs],
|
|
};
|
|
|
|
export const Default = () => (
|
|
<Article
|
|
{...commonProps}
|
|
reactionsIcon={text('reactionsIcon', ICONS.REACTIONS_ICON)}
|
|
commentsIcon={text('commentsIcon', ICONS.COMMENTS_ICON)}
|
|
videoIcon={text('videoIcon', ICONS.VIDEO_ICON)}
|
|
isBookmarked={boolean('isBookmarked', false)}
|
|
article={object('article', videoArticle)}
|
|
currentTag={text('currentTag', 'javascript')}
|
|
/>
|
|
);
|
|
|
|
Default.story = { name: 'default' };
|
|
|
|
export const VideoArticleWithFlareTag = () => (
|
|
<Article
|
|
{...commonProps}
|
|
reactionsIcon={text('reactionsIcon', ICONS.REACTIONS_ICON)}
|
|
commentsIcon={text('commentsIcon', ICONS.COMMENTS_ICON)}
|
|
videoIcon={text('videoIcon', ICONS.VIDEO_ICON)}
|
|
isBookmarked={boolean('isBookmarked', false)}
|
|
article={object('article', videoArticle)}
|
|
currentTag={text('currentTag')}
|
|
/>
|
|
);
|
|
|
|
VideoArticleWithFlareTag.story = { name: 'video with flare tag' };
|