From c9c1c90b30e243563bb4f731da15b3fe657556d2 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Mon, 6 Nov 2023 18:08:04 +0100 Subject: refactor(components): replace Summary component with PostPreview * rename component to PostPreview because Summary is an HTML element and it could lead to confusion * replace `title` and `titleLevel` with `heading` and `headingLvl` because `title` is a native attribute * rename `intro` prop to `excerpt` * extract `cover` from `meta` prop * rewrite meta type * extract meta logic into a new component --- .../organisms/layout/summary.stories.tsx | 107 --------------------- 1 file changed, 107 deletions(-) delete mode 100644 src/components/organisms/layout/summary.stories.tsx (limited to 'src/components/organisms/layout/summary.stories.tsx') diff --git a/src/components/organisms/layout/summary.stories.tsx b/src/components/organisms/layout/summary.stories.tsx deleted file mode 100644 index fe8b704..0000000 --- a/src/components/organisms/layout/summary.stories.tsx +++ /dev/null @@ -1,107 +0,0 @@ -import { ComponentMeta, ComponentStory } from '@storybook/react'; -import { Summary } from './summary'; -import { cover, intro, meta } from './summary.fixture'; - -/** - * Summary - Storybook Meta - */ -export default { - title: 'Organisms/Layout/Summary', - component: Summary, - args: { - titleLevel: 2, - }, - argTypes: { - cover: { - description: 'The cover data.', - table: { - category: 'Options', - }, - type: { - name: 'object', - required: false, - value: {}, - }, - }, - excerpt: { - control: { - type: 'text', - }, - description: 'The page excerpt.', - type: { - name: 'string', - required: true, - }, - }, - meta: { - description: 'The page metadata.', - type: { - name: 'object', - required: true, - value: {}, - }, - }, - title: { - control: { - type: 'text', - }, - description: 'The page title', - type: { - name: 'string', - required: true, - }, - }, - titleLevel: { - control: { - type: 'number', - min: 1, - max: 6, - }, - description: 'The page title level (hn)', - table: { - category: 'Options', - defaultValue: { summary: 2 }, - }, - type: { - name: 'number', - required: false, - }, - }, - url: { - control: { - type: 'text', - }, - description: 'The page url.', - type: { - name: 'string', - required: true, - }, - }, - }, -} as ComponentMeta; - -const Template: ComponentStory = (args) => ( - -); - -/** - * Summary Stories - Default - */ -export const Default = Template.bind({}); -Default.args = { - intro, - meta, - title: 'Odio odit necessitatibus', - url: '#', -}; - -/** - * Summary Stories - With cover - */ -export const WithCover = Template.bind({}); -WithCover.args = { - intro, - meta: { ...meta, cover }, - title: 'Odio odit necessitatibus', - url: '#', -}; -- cgit v1.2.3