docbrown/app/javascript/articles/__stories__/Article.stories.jsx
Josh Puetz 2abe830377
[deploy] Home Page Feed redesign + top comments (#7579)
* feed cards

* frontend

* preactify

* preactify

* .

* fix

* fixing things and adding dropdown

* whoops.

* whoops 2.

* revert body bg color change

* search snippet

* search snippet

* get rid of featured article

* get rid of featured article...

* cover to its own component

* videos

* videos

* reading time

* small-save-filled asset

* author adjustments

* adjustments

* Author --> Meta

* whoops.

* loader

* logged out state

* .

* dropping what's not needed for now

* better name for cover

* get rid of nav overflow

* bringin comments placeholder back

* bringing comments placeholder back

* publish date

* fix

* date

* .

* save button icon

* ghost button

* lets skip the icon for saving for now

* more buttons

* counting logic

* Display top comments on homepage feed

* Comment list and item components

* Remove 'Top Comments' title

* Remove subscribe button, add reading time

* Update snapshots and tests

* Fix article and follower scrolling

* Added reading time

* (Try) to do flare tags

* Button component from Pawel

* More button styles from Pawel

* Comment count style from Pawel

* Handle empty parens for age on older articles

* Dont show 'more comment' button for more than 2 comments

* cover ratio

* flare tag

* cover fix

* fix buttons

* more button fixes

* tags fix

* responsiveness fix

* reading time  + a bit of responsiveness

* Reading time in more places

* snapshots

* default color for flare tag

* Update CommentsList test snapshot with new styles

* fixing search results

* fixing buttons

* Fix podcast card tests by updating snapshots

* Line clamping for top comments

* Reflect save button state after click before mouseout

* Now the entire feed card is clickable. (#7638)

* Now pointer cursor is only on feed posts. (#7727)

* Revert podcast card styling

* Update test snapshot

* merge

* Fix rspec on feed page

* Reduce complexity of class check for feed card clicking

* PR feedback/fixes

* Fix featured article test and snapshot

* Last minute test tweaks

* clean up crayons

* padding issue + empty div

* Correct merge error

* Fix search results tests

* Test fixes and snapshot updates

* themes

* podcasts colors

Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
2020-05-12 07:57:57 -05:00

130 lines
2.9 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 {
article,
articleWithOrganization,
articleWithSnippetResult,
articleWithReactions,
articleWithComments,
featuredArticle,
} from '../__tests__/utilities/articleUtilities';
import { articleDecorator } from './articleDecorator';
import '../../../assets/stylesheets/articles.scss';
const commonProps = {
bookmarkClick: action('Saved/unsaved article'),
};
export default {
title: 'App Components/Article/Standard',
component: Article,
decorators: [withKnobs, articleDecorator],
};
export const DefaultArticle = () => (
<Article
{...commonProps}
isBookmarked={boolean('isBookmarked', false)}
article={object('article', article)}
currentTag={text('currentTag', 'javascript')}
/>
);
DefaultArticle.story = {
name: 'default',
};
export const IsFeatured = () => (
<Article
{...commonProps}
isBookmarked={boolean('isBookmarked', false)}
isFeatured={boolean('isFeatured', true)}
article={object('article', featuredArticle)}
currentTag={text('currentTag', 'javascript')}
/>
);
IsFeatured.story = {
name: 'is featured',
};
export const WithOrganization = () => (
<Article
{...commonProps}
isBookmarked={boolean('isBookmarked', false)}
article={object('article', articleWithOrganization)}
currentTag={text('currentTag', 'javascript')}
/>
);
WithOrganization.story = {
name: 'with organization',
};
export const WithFlareTag = () => (
<Article
{...commonProps}
isBookmarked={boolean('isBookmarked', false)}
article={object('article', article)}
currentTag={text('currentTag')}
/>
);
WithFlareTag.story = {
name: 'with flare tag',
};
export const WithSnippetResult = () => (
<Article
{...commonProps}
isBookmarked={boolean('isBookmarked', false)}
article={object('article', articleWithSnippetResult)}
currentTag={text('currentTag')}
/>
);
WithSnippetResult.story = {
name: 'with snippet result',
};
export const WithReactions = () => (
<Article
{...commonProps}
isBookmarked={boolean('isBookmarked', false)}
article={object('article', articleWithReactions)}
currentTag={text('currentTag')}
/>
);
WithReactions.story = {
name: 'with reactions',
};
export const WithComments = () => (
<Article
{...commonProps}
isBookmarked={boolean('isBookmarked', false)}
article={object('article', articleWithComments)}
currentTag={text('currentTag')}
/>
);
WithComments.story = {
name: 'with comments',
};
export const OnReadingList = () => (
<Article
{...commonProps}
isBookmarked={boolean('isBookmarked', true)}
article={object('article', articleWithComments)}
currentTag={text('currentTag')}
/>
);
OnReadingList.story = {
name: 'on reading list',
};