From 4f768afe543bbf9e1857c41d03804f8e37ab3512 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Fri, 29 Sep 2023 21:29:45 +0200 Subject: refactor(components): rewrite List component * change `items` prop to children * replace `kind` prop with `isHierarchical`, `isOrdered` & `isInline` props * add `hideMarker` prop * add `spacing` prop to control item spacing * move lists styles to Sass placeholders to avoid repeats because of headless WordPress --- src/pages/cv.tsx | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'src/pages/cv.tsx') diff --git a/src/pages/cv.tsx b/src/pages/cv.tsx index 3910d61..5882ff6 100644 --- a/src/pages/cv.tsx +++ b/src/pages/cv.tsx @@ -19,6 +19,7 @@ import { PageLayout, SocialMedia, type MetaData, + ListItem, } from '../components'; import CVContent, { data, meta } from '../content/pages/cv.mdx'; import styles from '../styles/pages/cv.module.scss'; @@ -96,6 +97,24 @@ const H6 = ({ ); +const OrderedList = ({ + children, + ...props +}: HTMLAttributes) => ( + + {children} + +); + +const UnorderedList = ({ + children, + ...props +}: HTMLAttributes) => ( + + {children} + +); + const components: MDXComponents = { a: ExternalLink, h1: H1, @@ -104,8 +123,10 @@ const components: MDXComponents = { h4: H4, h5: H5, h6: H6, + li: ListItem, Link, - List, + ol: OrderedList, + ul: UnorderedList, }; /** -- cgit v1.2.3