Skip to content

Commit d223356

Browse files
committed
chore: Use proper code styleing/formatting
Update code editor to use proper yaml formatting output
1 parent 40b3f61 commit d223356

File tree

2 files changed

+27
-13
lines changed

2 files changed

+27
-13
lines changed

src/components/ComposeWizard/index.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React, { useState, useCallback, useMemo } from 'react';
22
import clsx from 'clsx';
3+
import CodeBlock from '@theme/CodeBlock';
34
import {
45
DEPLOYMENT_TYPES,
56
WIZARD_SECTIONS,
@@ -305,9 +306,13 @@ const LivePreview = ({ code, filename, envCode }) => {
305306
</div>
306307
</div>
307308
<div className={styles.previewContent}>
308-
<pre className={styles.codeBlock}>
309-
<code>{activeTab === 'compose' ? code : envCode}</code>
310-
</pre>
309+
<CodeBlock
310+
language={activeTab === 'compose' ? 'yaml' : 'bash'}
311+
className={styles.codeBlock}
312+
showLineNumbers
313+
>
314+
{activeTab === 'compose' ? code : envCode}
315+
</CodeBlock>
311316
</div>
312317
</div>
313318
);

src/components/ComposeWizard/styles.module.css

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -393,18 +393,27 @@
393393
min-height: 0;
394394
}
395395

396+
/* CodeBlock wrapper styling */
396397
.codeBlock {
397-
margin: 0;
398-
padding: 1rem;
399-
background: #0f172a;
400-
color: #e2e8f0;
401-
font-size: 0.8rem;
402-
line-height: 1.5;
398+
margin: 0 !important;
399+
border-radius: 0 !important;
403400
min-height: 100%;
404-
white-space: pre;
405-
word-break: keep-all;
406-
overflow-wrap: normal;
407-
font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
401+
}
402+
403+
.codeBlock pre {
404+
margin: 0 !important;
405+
border-radius: 0 !important;
406+
font-size: 0.8rem !important;
407+
line-height: 1.6 !important;
408+
}
409+
410+
.codeBlock code {
411+
font-family: 'Fira Code', 'JetBrains Mono', 'Consolas', 'Monaco', monospace !important;
412+
}
413+
414+
/* Hide the default copy button since we have our own */
415+
.codeBlock button[class*="copyButton"] {
416+
display: none !important;
408417
}
409418

410419
/* Quick Start */

0 commit comments

Comments
 (0)