From d73f91150855a97b8dc830a83572cbaaf1d95356 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Tue, 22 Feb 2022 15:06:09 +0100
Subject: chore(homepage): use next/image for images and specify width/height

---
 src/pages/index.tsx | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

(limited to 'src/pages/index.tsx')

diff --git a/src/pages/index.tsx b/src/pages/index.tsx
index 0045996..513df69 100644
--- a/src/pages/index.tsx
+++ b/src/pages/index.tsx
@@ -2,14 +2,16 @@ import FeedIcon from '@assets/images/icon-feed.svg';
 import { ButtonLink } from '@components/Buttons';
 import { ContactIcon } from '@components/Icons';
 import Layout from '@components/Layouts/Layout';
+import { ResponsiveImage } from '@components/MDX';
 import { RecentPosts } from '@components/Widgets';
 import HomePageContent from '@content/pages/homepage.mdx';
 import { getPublishedPosts } from '@services/graphql/queries';
 import styles from '@styles/pages/Home.module.scss';
-import { NextPageWithLayout } from '@ts/types/app';
+import { NextPageWithLayout, ResponsiveImageProps } from '@ts/types/app';
 import { PostsList } from '@ts/types/blog';
 import { settings } from '@utils/config';
 import { loadTranslation } from '@utils/helpers/i18n';
+import { NestedMDXComponents } from 'mdx/types';
 import { GetStaticProps, GetStaticPropsContext } from 'next';
 import Head from 'next/head';
 import Script from 'next/script';
@@ -141,9 +143,10 @@ const Home: NextPageWithLayout<HomePageProps> = ({
     return <RecentPosts posts={recentPosts} />;
   };
 
-  const components = {
+  const components: NestedMDXComponents = {
     CodingLinks: CodingLinks,
     ColdarkRepos: ColdarkRepos,
+    Image: (props: ResponsiveImageProps) => ResponsiveImage({ ...props }),
     LibreLinks: LibreLinks,
     MoreLinks: MoreLinks,
     RecentPosts: getRecentPosts,
-- 
cgit v1.2.3

