diff options
Diffstat (limited to 'src/components/organisms/comment')
5 files changed, 92 insertions, 165 deletions
diff --git a/src/components/organisms/comment/approved-comment/approved-comment.stories.ts b/src/components/organisms/comment/approved-comment/approved-comment.stories.ts new file mode 100644 index 0000000..ac24463 --- /dev/null +++ b/src/components/organisms/comment/approved-comment/approved-comment.stories.ts @@ -0,0 +1,65 @@ +import type { Meta, StoryObj } from '@storybook/react'; +import { ApprovedComment } from './approved-comment'; + +const meta = { + component: ApprovedComment, + title: 'Organisms/Comment/Approved', +} satisfies Meta<typeof ApprovedComment>; + +export default meta; + +type Story = StoryObj<typeof meta>; + +export const Example: Story = { + args: { + author: { + name: 'Kameron.Conn', + }, + content: + 'Quia est eos deserunt qui perferendis est pariatur eaque. Deserunt omnis quis consectetur ea quam a cupiditate. Velit laboriosam rem nihil numquam quia.', + id: 1, + publicationDate: '2023-11-06', + }, +}; + +export const WithAvatar: Story = { + args: { + author: { + avatar: { + alt: 'Kameron.Conn avatar', + src: 'https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/82.jpg', + }, + name: 'Kameron.Conn', + }, + content: + 'Quia est eos deserunt qui perferendis est pariatur eaque. Deserunt omnis quis consectetur ea quam a cupiditate. Velit laboriosam rem nihil numquam quia.', + id: 2, + publicationDate: '2023-11-06', + }, +}; + +export const WithWebsite: Story = { + args: { + author: { + name: 'Kameron.Conn', + website: 'https://www.armandphilippot.com/', + }, + content: + 'Quia est eos deserunt qui perferendis est pariatur eaque. Deserunt omnis quis consectetur ea quam a cupiditate. Velit laboriosam rem nihil numquam quia.', + id: 3, + publicationDate: '2023-11-06', + }, +}; + +export const WithReplyBtn: Story = { + args: { + author: { + name: 'Kameron.Conn', + }, + content: + 'Quia est eos deserunt qui perferendis est pariatur eaque. Deserunt omnis quis consectetur ea quam a cupiditate. Velit laboriosam rem nihil numquam quia.', + id: 4, + publicationDate: '2023-11-06', + replyBtn: 'Reply', + }, +}; diff --git a/src/components/organisms/comment/approved-comment/approved-comment.stories.tsx b/src/components/organisms/comment/approved-comment/approved-comment.stories.tsx deleted file mode 100644 index 36afa6b..0000000 --- a/src/components/organisms/comment/approved-comment/approved-comment.stories.tsx +++ /dev/null @@ -1,126 +0,0 @@ -import type { ComponentMeta, ComponentStory } from '@storybook/react'; -import { ApprovedComment } from './approved-comment'; - -/** - * ApprovedComment - Storybook Meta - */ -export default { - title: 'Organisms/Comment/ApprovedComment', - component: ApprovedComment, - argTypes: { - author: { - description: 'The author data.', - type: { - name: 'object', - required: true, - value: {}, - }, - }, - content: { - control: { - type: 'text', - }, - description: 'The comment body.', - type: { - name: 'string', - required: true, - }, - }, - id: { - control: { - type: 'string', - }, - description: 'The comment id.', - type: { - name: 'string', - required: true, - }, - }, - publicationDate: { - control: { - type: 'text', - }, - description: 'The publication date.', - type: { - name: 'string', - required: true, - }, - }, - replyBtn: { - control: { - type: null, - }, - description: 'Add a reply button.', - type: { - name: 'function', - required: false, - }, - }, - }, -} as ComponentMeta<typeof ApprovedComment>; - -const Template: ComponentStory<typeof ApprovedComment> = (args) => ( - <ApprovedComment {...args} /> -); - -/** - * ApprovedComment Stories - Default - */ -export const Default = Template.bind({}); -Default.args = { - author: { - name: 'Kameron.Conn', - }, - content: - 'Quia est eos deserunt qui perferendis est pariatur eaque. Deserunt omnis quis consectetur ea quam a cupiditate. Velit laboriosam rem nihil numquam quia.', - id: 1, - publicationDate: '2023-11-06', -}; - -/** - * ApprovedComment Stories - WithAvatar - */ -export const WithAvatar = Template.bind({}); -WithAvatar.args = { - author: { - avatar: { - alt: 'Kameron.Conn avatar', - src: 'https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/82.jpg', - }, - name: 'Kameron.Conn', - }, - content: - 'Quia est eos deserunt qui perferendis est pariatur eaque. Deserunt omnis quis consectetur ea quam a cupiditate. Velit laboriosam rem nihil numquam quia.', - id: 2, - publicationDate: '2023-11-06', -}; - -/** - * ApprovedComment Stories - WithWebsite - */ -export const WithWebsite = Template.bind({}); -WithWebsite.args = { - author: { - name: 'Kameron.Conn', - website: 'https://www.armandphilippot.com/', - }, - content: - 'Quia est eos deserunt qui perferendis est pariatur eaque. Deserunt omnis quis consectetur ea quam a cupiditate. Velit laboriosam rem nihil numquam quia.', - id: 3, - publicationDate: '2023-11-06', -}; - -/** - * ApprovedComment Stories - WithReplyBtn - */ -export const WithReplyBtn = Template.bind({}); -WithReplyBtn.args = { - author: { - name: 'Kameron.Conn', - }, - content: - 'Quia est eos deserunt qui perferendis est pariatur eaque. Deserunt omnis quis consectetur ea quam a cupiditate. Velit laboriosam rem nihil numquam quia.', - id: 4, - publicationDate: '2023-11-06', - replyBtn: 'Reply', -}; diff --git a/src/components/organisms/comment/pending-comment/pending-comment.stories.ts b/src/components/organisms/comment/pending-comment/pending-comment.stories.ts new file mode 100644 index 0000000..d823082 --- /dev/null +++ b/src/components/organisms/comment/pending-comment/pending-comment.stories.ts @@ -0,0 +1,15 @@ +import type { Meta, StoryObj } from '@storybook/react'; +import { PendingComment } from './pending-comment'; + +const meta = { + component: PendingComment, + title: 'Organisms/Comment/Pending', +} satisfies Meta<typeof PendingComment>; + +export default meta; + +type Story = StoryObj<typeof meta>; + +export const Example: Story = { + args: {}, +}; diff --git a/src/components/organisms/comment/pending-comment/pending-comment.stories.tsx b/src/components/organisms/comment/pending-comment/pending-comment.stories.tsx deleted file mode 100644 index 1b6e1d9..0000000 --- a/src/components/organisms/comment/pending-comment/pending-comment.stories.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import type { ComponentMeta, ComponentStory } from '@storybook/react'; -import { PendingComment } from './pending-comment'; - -/** - * PendingComment - Storybook Meta - */ -export default { - title: 'Organisms/Comment/PendingComment', - component: PendingComment, - argTypes: {}, -} as ComponentMeta<typeof PendingComment>; - -const Template: ComponentStory<typeof PendingComment> = (args) => ( - <PendingComment {...args} /> -); - -/** - * PendingComment Stories - Default - */ -export const Default = Template.bind({}); -Default.args = {}; diff --git a/src/components/organisms/comment/reply-comment-form/reply-comment-form.stories.tsx b/src/components/organisms/comment/reply-comment-form/reply-comment-form.stories.tsx index 57174ea..1638e15 100644 --- a/src/components/organisms/comment/reply-comment-form/reply-comment-form.stories.tsx +++ b/src/components/organisms/comment/reply-comment-form/reply-comment-form.stories.tsx @@ -1,25 +1,19 @@ -import type { ComponentMeta, ComponentStory } from '@storybook/react'; +import type { Meta, StoryObj } from '@storybook/react'; import { Heading } from '../../../atoms'; import { ReplyCommentForm } from './reply-comment-form'; -/** - * ReplyCommentForm - Storybook Meta - */ -export default { - title: 'Organisms/Comment/ReplyCommentForm', +const meta = { component: ReplyCommentForm, - argTypes: {}, -} as ComponentMeta<typeof ReplyCommentForm>; + title: 'Organisms/Comment/Reply Form', +} satisfies Meta<typeof ReplyCommentForm>; -const Template: ComponentStory<typeof ReplyCommentForm> = (args) => ( - <ReplyCommentForm {...args} /> -); +export default meta; -/** - * ReplyCommentForm Stories - Default - */ -export const Default = Template.bind({}); -Default.args = { - commentId: 5, - heading: <Heading level={2}>Reply to comment 5</Heading>, +type Story = StoryObj<typeof meta>; + +export const Example: Story = { + args: { + commentId: 5, + heading: <Heading level={2}>Reply to comment 5</Heading>, + }, }; |
