From 03331c44276ec56e9f235e4d5ee75030455a753f Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Tue, 19 Sep 2023 15:47:08 +0200 Subject: build(deps): bump all dependencies * MDX type has changed so some components props had to be updated * Since Storybook now supports TS, I renamed the main/preview files --- src/pages/cv.tsx | 92 +++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 71 insertions(+), 21 deletions(-) (limited to 'src/pages/cv.tsx') diff --git a/src/pages/cv.tsx b/src/pages/cv.tsx index 16b83f0..9e01e2f 100644 --- a/src/pages/cv.tsx +++ b/src/pages/cv.tsx @@ -1,12 +1,12 @@ -import { NestedMDXComponents } from 'mdx/types'; +import { MDXComponents } from 'mdx/types'; import { GetStaticProps } from 'next'; import Head from 'next/head'; import { useRouter } from 'next/router'; import Script from 'next/script'; -import React, { ReactNode } from 'react'; +import React, { AnchorHTMLAttributes, HTMLAttributes, ReactNode } from 'react'; import { useIntl } from 'react-intl'; -import Heading, { HeadingProps } from '../components/atoms/headings/heading'; -import Link, { LinkProps } from '../components/atoms/links/link'; +import Heading from '../components/atoms/headings/heading'; +import Link from '../components/atoms/links/link'; import List from '../components/atoms/lists/list'; import ImageWidget from '../components/organisms/widgets/image-widget'; import SocialMedia from '../components/organisms/widgets/social-media'; @@ -26,30 +26,80 @@ import { import useBreadcrumb from '../utils/hooks/use-breadcrumb'; import useSettings from '../utils/hooks/use-settings'; -const ExternalLink = (props: LinkProps) => ; - -const H1 = (props: Omit) => { - return ; +const ExternalLink = ({ + children = '', + href = '', + ...props +}: AnchorHTMLAttributes) => ( + + {children} + +); + +const H1 = ({ + children = '', + ...props +}: HTMLAttributes) => { + return ( + + {children} + + ); }; -const H2 = (props: Omit) => { - return ; +const H2 = ({ + children = '', + ...props +}: HTMLAttributes) => { + return ( + + {children} + + ); }; -const H3 = (props: Omit) => { - return ; +const H3 = ({ + children = '', + ...props +}: HTMLAttributes) => { + return ( + + {children} + + ); }; -const H4 = (props: Omit) => { - return ; +const H4 = ({ + children = '', + ...props +}: HTMLAttributes) => { + return ( + + {children} + + ); }; -const H5 = (props: Omit) => { - return ; +const H5 = ({ + children = '', + ...props +}: HTMLAttributes) => { + return ( + + {children} + + ); }; -const H6 = (props: Omit) => { - return ; +const H6 = ({ + children = '', + ...props +}: HTMLAttributes) => { + return ( + + {children} + + ); }; /** @@ -147,7 +197,7 @@ const CVPage: NextPageWithLayout = () => { }); const schemaJsonLd = getSchemaJson([webpageSchema, cvSchema]); - const components: NestedMDXComponents = { + const components: MDXComponents = { a: ExternalLink, h1: H1, h2: H2, @@ -155,8 +205,8 @@ const CVPage: NextPageWithLayout = () => { h4: H4, h5: H5, h6: H6, - Link: Link, - List: List, + Link, + List, }; return ( -- cgit v1.2.3