From aa83b7811b1608400c6e7275513cfac030f155eb Mon Sep 17 00:00:00 2001 From: Yulia Avramenko Date: Wed, 10 Jan 2024 16:08:57 +0300 Subject: [PATCH] #180-enhancement-add-storybooks-to-reviewsBlock --- .../ui/CardReview/CardReview.stories.tsx | 26 +++++++++++++++++++ .../ui/ButtonDots/ButtonDots.stories.tsx | 2 +- src/shared/ui/Heading/Heading.stories.tsx | 2 +- src/shared/ui/Paragraph/Paragraph.stories.tsx | 2 +- .../ui/Subheading/Subheading.stories.tsx | 2 +- .../ui/ReviewsBlock/ReviewsBlock.stories.tsx | 24 +++++++++++++++++ 6 files changed, 54 insertions(+), 4 deletions(-) create mode 100644 src/entities/CardReview/ui/CardReview/CardReview.stories.tsx create mode 100644 src/widgets/ReviewsBlock/ui/ReviewsBlock/ReviewsBlock.stories.tsx diff --git a/src/entities/CardReview/ui/CardReview/CardReview.stories.tsx b/src/entities/CardReview/ui/CardReview/CardReview.stories.tsx new file mode 100644 index 00000000..c45fa99b --- /dev/null +++ b/src/entities/CardReview/ui/CardReview/CardReview.stories.tsx @@ -0,0 +1,26 @@ +import type { Meta, StoryObj } from '@storybook/react' +import CardReview from './CardReview' + +const meta = { + title: 'entities/CardReview', + component: CardReview, + parameters: { + layout: 'centered' + }, + tags: ['autodocs'] +} satisfies Meta + +export default meta +type Story = StoryObj + +export const Default: Story = { + args: { + review: { + id: 1, + name: 'Рейтинг нашего магазина', + score: '4.3', + text: 'Мы очень ним гордимся, это результат упорного труда в течении длительного времени и сейчас наша команда ежедневно работает над улучшением сервиса.', + date: '' + } + } +} diff --git a/src/shared/ui/ButtonDots/ButtonDots.stories.tsx b/src/shared/ui/ButtonDots/ButtonDots.stories.tsx index 49c476ad..b77b1c7d 100644 --- a/src/shared/ui/ButtonDots/ButtonDots.stories.tsx +++ b/src/shared/ui/ButtonDots/ButtonDots.stories.tsx @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react' import ButtonDots from './ButtonDots' const meta = { - title: 'ButtonDots', + title: 'shared/ButtonDots', component: ButtonDots, parameters: { layout: 'centered' diff --git a/src/shared/ui/Heading/Heading.stories.tsx b/src/shared/ui/Heading/Heading.stories.tsx index 9c84dd48..c0eca174 100644 --- a/src/shared/ui/Heading/Heading.stories.tsx +++ b/src/shared/ui/Heading/Heading.stories.tsx @@ -3,7 +3,7 @@ import type { Meta, StoryObj } from '@storybook/react' import Heading, { HeadingType } from './Heading' const meta = { - title: 'Heading', + title: 'shared/Heading', component: Heading, parameters: { layout: 'centered' diff --git a/src/shared/ui/Paragraph/Paragraph.stories.tsx b/src/shared/ui/Paragraph/Paragraph.stories.tsx index ac7d2c3f..a9472858 100644 --- a/src/shared/ui/Paragraph/Paragraph.stories.tsx +++ b/src/shared/ui/Paragraph/Paragraph.stories.tsx @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react' import Paragraph, { ParagraphTheme } from './Paragraph' const meta = { - title: 'Paragraph', + title: 'shared/Paragraph', component: Paragraph, parameters: { layout: 'centered' diff --git a/src/shared/ui/Subheading/Subheading.stories.tsx b/src/shared/ui/Subheading/Subheading.stories.tsx index bf05731c..c3aa132b 100644 --- a/src/shared/ui/Subheading/Subheading.stories.tsx +++ b/src/shared/ui/Subheading/Subheading.stories.tsx @@ -3,7 +3,7 @@ import type { Meta, StoryObj } from '@storybook/react' import Subheading from './Subheading' const meta = { - title: 'Subheading', + title: 'shared/Subheading', component: Subheading, parameters: { layout: 'centered' diff --git a/src/widgets/ReviewsBlock/ui/ReviewsBlock/ReviewsBlock.stories.tsx b/src/widgets/ReviewsBlock/ui/ReviewsBlock/ReviewsBlock.stories.tsx new file mode 100644 index 00000000..82c25356 --- /dev/null +++ b/src/widgets/ReviewsBlock/ui/ReviewsBlock/ReviewsBlock.stories.tsx @@ -0,0 +1,24 @@ +import type { Meta, StoryObj } from '@storybook/react' +import ReviewsBlock from './ReviewsBlock' +import { reviewsData } from '@/mockData/reviews.Data' +import { LINK_REVIEWS_ALL, TEXT_CUSTOMERS_ABOUT_US } from '@/shared/constants/constants' + +const meta = { + title: 'widgets/ReviewsBlock', + component: ReviewsBlock, + parameters: { + layout: 'centered' + }, + tags: ['autodocs'] +} satisfies Meta + +export default meta +type Story = StoryObj + +export const Default: Story = { + args: { + title: TEXT_CUSTOMERS_ABOUT_US, + reviews: reviewsData, + linkText: LINK_REVIEWS_ALL + } +}