Skip to content

Commit 466c07c

Browse files
committed
fix: copy button padding
1 parent c4446c2 commit 466c07c

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/components/SyntaxHighlighter/YDBSyntaxHighlighter.tsx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,20 @@ export function YDBSyntaxHighlighter({
8888
return null;
8989
};
9090

91+
let paddingStyles = {};
92+
93+
if (
94+
withClipboardButton &&
95+
typeof withClipboardButton === 'object' &&
96+
withClipboardButton.alwaysVisible
97+
) {
98+
if (withClipboardButton.withLabel) {
99+
paddingStyles = {paddingRight: 80};
100+
} else {
101+
paddingStyles = {paddingRight: 40};
102+
}
103+
}
104+
91105
return (
92106
<div className={b(null, className)}>
93107
{renderCopyButton()}
@@ -96,7 +110,7 @@ export function YDBSyntaxHighlighter({
96110
key={highlighterKey}
97111
language={language}
98112
style={style}
99-
customStyle={{height: '100%'}}
113+
customStyle={{height: '100%', ...paddingStyles}}
100114
>
101115
{text}
102116
</ReactSyntaxHighlighter>

0 commit comments

Comments
 (0)