diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-02-22 15:06:09 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-02-22 15:37:29 +0100 |
| commit | d73f91150855a97b8dc830a83572cbaaf1d95356 (patch) | |
| tree | 2c351a337dfad104a53d2dc313ff7b88d3ae9bbb /src/pages/index.tsx | |
| parent | 4c7ba0ac4b13fea4e6cb78481177ac7feca895ea (diff) | |
chore(homepage): use next/image for images and specify width/height
Diffstat (limited to 'src/pages/index.tsx')
| -rw-r--r-- | src/pages/index.tsx | 7 |
1 files changed, 5 insertions, 2 deletions
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, |
