* Renabled building Storybook. * Explicitly added webpack style loaders for Storybook custom webpack config. * Upgraded Storybook configuration. * Added mixin/function to handle SASS compilation for Sprockets and Storybook's webpack. * Readded stylesheets/js required for crayons to run. * Added a custom title to Storybook. * Fixed custom Storybook CSS. * Migrated Search storybook stories. * Migrated crayons' box stories. * Migrated crayons' modal stories. * Migrated crayons' button stories. * Changed title a bit until we get a logo. * Migrated crayons' notice stories. * Migrated crayons' dropdown stories. * Migrated crayons' indicator stories. * Migrated crayons' typography stories. * Migrated crayons' form element stories. * Migrated crayons' navigation stories. * Migrated crayons' avatar & logo stories. * Migrated fatured article stories. * Migrated article loading stories. * Migrated today's podcast episodes stories. * Migrated podcast episode stories. * Migrated rest of article stories. * Update app/javascript/.storybook/manager.js Co-Authored-By: rhymes <rhymesete@gmail.com> * Commented new SASS function and mixin. Co-authored-by: rhymes <rhymesete@gmail.com>
50 lines
1.4 KiB
JavaScript
50 lines
1.4 KiB
JavaScript
import { h } from 'preact';
|
|
import { withKnobs, object, text, boolean } from '@storybook/addon-knobs/react';
|
|
import { action } from '@storybook/addon-actions';
|
|
import {
|
|
featuredArticle,
|
|
assetPath,
|
|
} from '../__tests__/utilities/articleUtilities';
|
|
import { FeaturedArticle } from '..';
|
|
import { articleDecorator } from './articleDecorator';
|
|
|
|
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: 'App Components/Article/Featured',
|
|
decorators: [withKnobs, articleDecorator],
|
|
};
|
|
|
|
export const Default = () => (
|
|
<FeaturedArticle
|
|
{...commonProps}
|
|
reactionsIcon={text('reactionsIcon', ICONS.REACTIONS_ICON)}
|
|
commentsIcon={text('commentsIcon', ICONS.COMMENTS_ICON)}
|
|
videoIcon={text('videoIcon', ICONS.VIDEO_ICON)}
|
|
article={object('article', featuredArticle)}
|
|
/>
|
|
);
|
|
|
|
Default.story = { name: 'default' };
|
|
|
|
export const OnReadingList = () => (
|
|
<FeaturedArticle
|
|
{...commonProps}
|
|
reactionsIcon={text('reactionsIcon', ICONS.REACTIONS_ICON)}
|
|
commentsIcon={text('commentsIcon', ICONS.COMMENTS_ICON)}
|
|
isBookmarked={boolean('isBookmarked', true)}
|
|
article={object('article', featuredArticle)}
|
|
/>
|
|
);
|
|
|
|
OnReadingList.story = { name: 'is on reading List' };
|