summaryrefslogtreecommitdiffstats
path: root/src/components/PostHeader/PostHeader.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-03-01 22:05:08 +0100
committerArmand Philippot <git@armandphilippot.com>2022-03-01 22:05:08 +0100
commit8bd9784acdee6871ad70e86d0d7120299bf76969 (patch)
tree9b81e0cd3ff881b2cbeb81f9f96b52b510d67646 /src/components/PostHeader/PostHeader.tsx
parent21c228600a7a69cfea3b7d8af6838bcfda1d7399 (diff)
refactor: split posts meta into smaller components
Diffstat (limited to 'src/components/PostHeader/PostHeader.tsx')
-rw-r--r--src/components/PostHeader/PostHeader.tsx16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/components/PostHeader/PostHeader.tsx b/src/components/PostHeader/PostHeader.tsx
index f070583..c0a6b68 100644
--- a/src/components/PostHeader/PostHeader.tsx
+++ b/src/components/PostHeader/PostHeader.tsx
@@ -16,19 +16,6 @@ const PostHeader = ({
meta?: ArticleMeta;
title: string;
}) => {
- const hasMeta = () => {
- return (
- meta?.author ||
- meta?.commentCount ||
- meta?.dates ||
- meta?.readingTime ||
- meta?.results ||
- meta?.thematics ||
- meta?.website ||
- meta?.wordsCount
- );
- };
-
const getIntro = () => {
if (React.isValidElement(intro)) {
const Intro = () => intro;
@@ -38,6 +25,7 @@ const PostHeader = ({
</div>
);
}
+
return (
intro && (
<div
@@ -59,7 +47,7 @@ const PostHeader = ({
)}
{title}
</h1>
- {meta && hasMeta() && <PostMeta mode="single" meta={meta} />}
+ {meta && <PostMeta kind="article" meta={meta} />}
{getIntro()}
</div>
</header>