Skip to content

Commit e589f34

Browse files
fix: codesnippet without copy button (#4741)
1 parent 6efecbf commit e589f34

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/shared/components/CodeSnippet.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
border-radius: $cf-radius;
88
overflow: hidden;
99
border: $cf-border solid $cf-grey-15;
10-
background-color: $cf-grey-15;
1110
margin-bottom: $cf-space-2xs;
1211
}
1312

@@ -48,6 +47,7 @@
4847
justify-content: space-between;
4948
padding: $cf-space-2xs $cf-space-s;
5049
border-top: $cf-border solid $cf-grey-15;
50+
background-color: $cf-grey-15;
5151
}
5252

5353
.code-snippet--label {

src/shared/components/CodeSnippet.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,12 @@ const CodeSnippet: FC<Props> = ({
130130
)}
131131
</div>
132132
</DapperScrollbars>
133-
<div className="code-snippet--footer">
134-
{showCopyControl && <CopyButton text={_text} onCopy={handleCopy} />}
135-
{label && <label className="code-snippet--label">{label}</label>}
136-
</div>
133+
{(showCopyControl || label) && (
134+
<div className="code-snippet--footer">
135+
{showCopyControl && <CopyButton text={_text} onCopy={handleCopy} />}
136+
{label && <label className="code-snippet--label">{label}</label>}
137+
</div>
138+
)}
137139
</div>
138140
)
139141
}

0 commit comments

Comments
 (0)