mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-07 09:26:06 +08:00
fix: find the missing code (#40047)
This commit is contained in:
parent
e597fe8ec6
commit
67e958fdd6
@ -303,9 +303,18 @@ const Demo: React.FC<DemoProps> = (props) => {
|
|||||||
if (suffix === 'tsx') {
|
if (suffix === 'tsx') {
|
||||||
stackblitzPrefillConfig.files['tsconfig.json'] = tsconfig;
|
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 = (
|
||||||
<section className={codeBoxClass} id={meta.id}>
|
<section className={codeBoxClass} id={meta.id}>
|
||||||
<section className="code-box-demo" data-compact={meta.compact}>
|
<section className="code-box-demo" style={codeBoxDemoStyle}>
|
||||||
<ErrorBoundary>
|
<ErrorBoundary>
|
||||||
<React.StrictMode>{liveDemo.current}</React.StrictMode>
|
<React.StrictMode>{liveDemo.current}</React.StrictMode>
|
||||||
</ErrorBoundary>
|
</ErrorBoundary>
|
||||||
@ -455,7 +464,7 @@ const Demo: React.FC<DemoProps> = (props) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (meta.version) {
|
if (meta.version) {
|
||||||
codeBox = (
|
return (
|
||||||
<Badge.Ribbon text={meta.version} color={meta.version.includes('<') ? 'red' : null}>
|
<Badge.Ribbon text={meta.version} color={meta.version.includes('<') ? 'red' : null}>
|
||||||
{codeBox}
|
{codeBox}
|
||||||
</Badge.Ribbon>
|
</Badge.Ribbon>
|
||||||
|
Loading…
Reference in New Issue
Block a user