Skip to content
This repository has been archived by the owner on Sep 7, 2020. It is now read-only.

Commit

Permalink
website: avoid warnings for page without body (showcase)
Browse files Browse the repository at this point in the history
  • Loading branch information
MoOx committed Dec 5, 2018
1 parent 6f3233c commit 79b2de8
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions website/components/MarkdownGenerated.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,20 @@ const cleanAllHref = (node?: Node, filenameSource: string) => {

const MarkdownGenerated = (props: {| body: Node, filename: string |}) => (
<div className="phenomic-Markdown">
<BodyRenderer
components={{
h1: MarkdownHeading.H1,
h2: MarkdownHeading.H2,
h3: MarkdownHeading.H3,
h4: MarkdownHeading.H4,
h5: MarkdownHeading.H5,
h6: MarkdownHeading.H6,
}}
>
{cleanAllHref(props.body, props.filename)}
</BodyRenderer>
{props.body && (
<BodyRenderer
components={{
h1: MarkdownHeading.H1,
h2: MarkdownHeading.H2,
h3: MarkdownHeading.H3,
h4: MarkdownHeading.H4,
h5: MarkdownHeading.H5,
h6: MarkdownHeading.H6,
}}
>
{cleanAllHref(props.body, props.filename)}
</BodyRenderer>
)}
</div>
);

Expand Down

0 comments on commit 79b2de8

Please sign in to comment.