From 67e958fdd6d4476eb75efa378e36f6123ec3398d Mon Sep 17 00:00:00 2001 From: lijianan <574980606@qq.com> Date: Fri, 6 Jan 2023 09:46:47 +0800 Subject: [PATCH] fix: find the missing code (#40047) --- .dumi/theme/builtins/Previewer/index.tsx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.dumi/theme/builtins/Previewer/index.tsx b/.dumi/theme/builtins/Previewer/index.tsx index bf3b471c42..36731e2e21 100644 --- a/.dumi/theme/builtins/Previewer/index.tsx +++ b/.dumi/theme/builtins/Previewer/index.tsx @@ -303,9 +303,18 @@ const Demo: React.FC = (props) => { if (suffix === 'tsx') { stackblitzPrefillConfig.files['tsconfig.json'] = tsconfig; } - let codeBox: React.ReactNode = ( + + const backgroundGrey = theme.includes('dark') ? '#303030' : '#f0f2f5'; + + const codeBoxDemoStyle: React.CSSProperties = { + padding: meta.iframe || meta.compact ? 0 : undefined, + overflow: meta.iframe || meta.compact ? 'hidden' : undefined, + backgroundColor: meta.background === 'grey' ? backgroundGrey : undefined, + }; + + const codeBox: React.ReactNode = (
-
+
{liveDemo.current} @@ -455,7 +464,7 @@ const Demo: React.FC = (props) => { ); if (meta.version) { - codeBox = ( + return ( {codeBox}