From 00f147a7a687d5772bcc538bc606cfff972178cd Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Thu, 12 Oct 2023 17:24:13 +0200 Subject: feat(components): add a Time component Instead of using helpers functions to format the date each time we need to use a time element, it makes more sense to create a new component dedicated to this task. --- src/pages/index.tsx | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'src/pages/index.tsx') diff --git a/src/pages/index.tsx b/src/pages/index.tsx index cdc51c5..fb6ba9a 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -21,17 +21,14 @@ import { type SectionProps, Heading, Figure, + Time, } from '../components'; import HomePageContent from '../content/pages/homepage.mdx'; import { getArticlesCard } from '../services/graphql'; import styles from '../styles/pages/home.module.scss'; import type { ArticleCard, NextPageWithLayout } from '../types'; import { PERSONAL_LINKS, ROUTES } from '../utils/constants'; -import { - getFormattedDate, - getSchemaJson, - getWebPageSchema, -} from '../utils/helpers'; +import { getSchemaJson, getWebPageSchema } from '../utils/helpers'; import { loadTranslation, type Messages } from '../utils/helpers/server'; import { useBreadcrumb, useSettings } from '../utils/hooks'; @@ -301,8 +298,6 @@ const HomePage: NextPageWithLayout = ({ recentPosts }) => { */ const getRecentPosts = (): JSX.Element => { const posts: CardsListItem[] = recentPosts.map((post) => { - const isoDate = new Date(`${post.dates.publication}`).toISOString(); - return { cover: post.cover, id: post.slug, @@ -310,11 +305,7 @@ const HomePage: NextPageWithLayout = ({ recentPosts }) => { { id: 'publication-date', label: publicationDate, - value: ( - - ), + value: