diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-01-06 18:15:18 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-01-06 18:15:18 +0100 |
| commit | c3b438a5252e8c8897c868cdda8377e3162fdd69 (patch) | |
| tree | d0b730c1b3cc971a7ceae02312988071577a368a /src/components | |
| parent | b9c1953c79688fc3f536b7927692309c9780b5da (diff) | |
refactor: reuse PostHeader for all pages except homepage
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/PostHeader/PostHeader.tsx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/components/PostHeader/PostHeader.tsx b/src/components/PostHeader/PostHeader.tsx index e445b58..2cdc39e 100644 --- a/src/components/PostHeader/PostHeader.tsx +++ b/src/components/PostHeader/PostHeader.tsx @@ -11,7 +11,7 @@ const PostHeader = ({ meta, }: { cover?: Cover; - intro: string; + intro?: string; meta?: ArticleMeta; title: string; }) => { @@ -27,10 +27,12 @@ const PostHeader = ({ {title} </h1> {meta && <PostMeta mode="single" meta={meta} />} - <div - className={styles.intro} - dangerouslySetInnerHTML={{ __html: intro }} - ></div> + {intro && ( + <div + className={styles.intro} + dangerouslySetInnerHTML={{ __html: intro }} + ></div> + )} </div> </header> ); |
