From d5ade2359539648845a5854ed353b29367961d74 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Mon, 20 Nov 2023 11:02:20 +0100 Subject: refactor(components): extract MetaItem from MetaList * replace `items` prop on MetaList with `children` prop: it was too restrictive and the global options was not really useful. It is better too give control to the consumers. --- .../molecules/layout/page-header.stories.tsx | 83 ++++++++++++++-------- 1 file changed, 55 insertions(+), 28 deletions(-) (limited to 'src/components/molecules/layout/page-header.stories.tsx') diff --git a/src/components/molecules/layout/page-header.stories.tsx b/src/components/molecules/layout/page-header.stories.tsx index 54d5fe8..97eae5a 100644 --- a/src/components/molecules/layout/page-header.stories.tsx +++ b/src/components/molecules/layout/page-header.stories.tsx @@ -1,4 +1,5 @@ import type { ComponentMeta, ComponentStory } from '@storybook/react'; +import { MetaItem, MetaList } from '../meta-list'; import { PageHeader } from './page-header'; /** @@ -62,32 +63,6 @@ const Template: ComponentStory = (args) => ( ); -const meta = [ - { id: 'publication-date', label: 'Published on:', value: '2022-04-09' }, - { - id: 'thematics', - label: 'Thematics:', - value: [ - { - id: 'cat-1', - value: ( - - Category 1 - - ), - }, - { - id: 'cat-2', - value: ( - - Category 2 - - ), - }, - ], - }, -]; - /** * Page Header Stories - Default */ @@ -111,7 +86,33 @@ WithIntro.args = { */ export const WithMeta = Template.bind({}); WithMeta.args = { - meta, + meta: ( + + + + Category 1 + + ), + }, + { + id: 'cat-2', + value: ( + + Category 2 + + ), + }, + ]} + /> + + ), title: 'Excepturi nesciunt illum', }; @@ -122,6 +123,32 @@ export const WithIntroAndMeta = Template.bind({}); WithIntroAndMeta.args = { intro: 'Minima dolor nihil. Velit atque odit totam enim. Quisquam reprehenderit ut et inventore et nihil libero exercitationem. Cumque similique magni placeat et. Et sed est cumque labore. Et quia similique.', - meta, + meta: ( + + + + Category 1 + + ), + }, + { + id: 'cat-2', + value: ( + + Category 2 + + ), + }, + ]} + /> + + ), title: 'Excepturi nesciunt illum', }; -- cgit v1.2.3