From fa6adedc42e9c6ec39cc30df16b54900c220b094 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Mon, 20 Dec 2021 00:15:20 +0100 Subject: refactor: rewrite types and services I was repeating myself a lot in services. So I rewrited the different functions to improve readability and I extracted some formatting functions to put them in utils. I also rewrited/reorganized some types to keep consistent names. --- src/components/PostHeader/PostHeader.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/components/PostHeader') diff --git a/src/components/PostHeader/PostHeader.tsx b/src/components/PostHeader/PostHeader.tsx index 5c5aff4..3ee6705 100644 --- a/src/components/PostHeader/PostHeader.tsx +++ b/src/components/PostHeader/PostHeader.tsx @@ -1,5 +1,6 @@ import { t } from '@lingui/macro'; -import { ArticleAuthor, ArticleDates } from '@ts/types/articles'; +import { Dates } from '@ts/types/app'; +import { ArticleAuthor } from '@ts/types/articles'; import { ThematicPreview } from '@ts/types/taxonomies'; import Link from 'next/link'; import { useRouter } from 'next/router'; @@ -7,13 +8,13 @@ import styles from './PostHeader.module.scss'; const PostHeader = ({ author, - date, + dates, intro, title, thematics, }: { author: ArticleAuthor; - date: ArticleDates; + dates: Dates; intro: string; title: string; thematics: ThematicPreview[]; @@ -52,9 +53,9 @@ const PostHeader = ({

{title}