diff options
| author | Armand Philippot <git@armandphilippot.com> | 2023-10-09 18:26:23 +0200 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2023-11-11 18:14:41 +0100 |
| commit | 15522ec9146f6f1956620355c44dea2a6a75b67c (patch) | |
| tree | 7be0c4ca96cb3e59d2ee989785a6b6a286e6169d /src/pages/mentions-legales.tsx | |
| parent | 891441a76173c708c6604fa203b175aefa222333 (diff) | |
refactor(components): replace ResponsiveImage with Figure component
The styles applied to ResponsiveImage are related to the figure and
figcaption elements. Those elements could be use with other contents
than images. So I extracted them in a Figure component. The
ResponsiveImage component is no longer useful: the consumer should use
the Image component from `next` and wrap it in a link if needed.
Diffstat (limited to 'src/pages/mentions-legales.tsx')
| -rw-r--r-- | src/pages/mentions-legales.tsx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/pages/mentions-legales.tsx b/src/pages/mentions-legales.tsx index 9b0cc98..810d9ec 100644 --- a/src/pages/mentions-legales.tsx +++ b/src/pages/mentions-legales.tsx @@ -1,14 +1,15 @@ import type { MDXComponents } from 'mdx/types'; import type { GetStaticProps } from 'next'; import Head from 'next/head'; +import NextImage, { type ImageProps as NextImageProps } from 'next/image'; import { useRouter } from 'next/router'; import Script from 'next/script'; import { getLayout, Link, PageLayout, - ResponsiveImage, type MetaData, + Figure, } from '../components'; import LegalNoticeContent, { meta } from '../content/pages/legal-notice.mdx'; import type { NextPageWithLayout } from '../types'; @@ -21,6 +22,12 @@ import { import { loadTranslation } from '../utils/helpers/server'; import { useBreadcrumb, useSettings } from '../utils/hooks'; +const ResponsiveImage = (props: NextImageProps) => ( + <Figure> + <NextImage {...props} /> + </Figure> +); + const components: MDXComponents = { Image: ResponsiveImage, Link, |
