aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/organisms/layout/summary.stories.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2023-11-06 18:08:04 +0100
committerArmand Philippot <git@armandphilippot.com>2023-11-11 18:15:27 +0100
commitc9c1c90b30e243563bb4f731da15b3fe657556d2 (patch)
tree8263c176b4096e2893b9d9319bfa7edb01fce188 /src/components/organisms/layout/summary.stories.tsx
parent2771de88f40a5f4ed7480bd8614532dda72deeda (diff)
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
Diffstat (limited to 'src/components/organisms/layout/summary.stories.tsx')
-rw-r--r--src/components/organisms/layout/summary.stories.tsx107
1 files changed, 0 insertions, 107 deletions
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<typeof Summary>;
-
-const Template: ComponentStory<typeof Summary> = (args) => (
- <Summary {...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: '#',
-};