diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-03-01 22:08:56 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-03-01 22:08:56 +0100 |
| commit | 80d54805e26a6a6971c5ad214b02456dcc226628 (patch) | |
| tree | 9b81e0cd3ff881b2cbeb81f9f96b52b510d67646 /src/components/PostHeader/PostHeader.tsx | |
| parent | 99ae0a9d3a923ca1e998dc9b504dad607fdfd768 (diff) | |
| parent | 8bd9784acdee6871ad70e86d0d7120299bf76969 (diff) | |
refactor: various refactoring
Improve maintenance (meta splitting) and try to
improve performance (dynamic imports).
Diffstat (limited to 'src/components/PostHeader/PostHeader.tsx')
| -rw-r--r-- | src/components/PostHeader/PostHeader.tsx | 16 |
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> |
