From 7ad682d9da23f09d3b7d78f7322fe48e7555e398 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Wed, 3 Jun 2020 12:30:34 -0700 Subject: [PATCH] feat: Only render editor if the component is live otherwise render code snippet --- src/components/ComponentExample.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/ComponentExample.js b/src/components/ComponentExample.js index cbfe4e359..aa29eea43 100644 --- a/src/components/ComponentExample.js +++ b/src/components/ComponentExample.js @@ -99,6 +99,7 @@ const ComponentExample = ({ }) => { const [stylesLoaded, setStylesLoaded] = useState(false); const ToastManager = window.__NR1_SDK__.ToastManager; + const { live } = example.options; let formattedCode; try { @@ -120,9 +121,9 @@ const ComponentExample = ({ }} code={formattedCode} theme={github} - disabled={!example.options.live} + disabled={!live} > - {example.options.live && ( + {live && ( )} - + {live && } );