From 7e6733d59146c2acfd58b33af5ab83c2da6a12c6 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Tue, 2 Jun 2020 18:08:13 -0700 Subject: [PATCH] fix: Only show examples if there are examples to show --- src/templates/ReferenceTemplate.js | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/templates/ReferenceTemplate.js b/src/templates/ReferenceTemplate.js index 064149e12..805c3cb8f 100644 --- a/src/templates/ReferenceTemplate.js +++ b/src/templates/ReferenceTemplate.js @@ -46,18 +46,20 @@ const ReferenceTemplate = ({ data }) => {
-
-

Examples

-
- {examples.map((example, i) => ( - - ))} -
-
+ {examples.length > 0 && ( +
+

Examples

+
+ {examples.map((example, i) => ( + + ))} +
+
+ )} )}