File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -38,12 +38,6 @@ interface CodeDisplayProps {
38
38
setAlertErrorMessage : StringFunction ;
39
39
}
40
40
41
- /** Full dimensions style for the syntax highlighter. */
42
- const FULL_SIZE_STYLE = {
43
- width : '100%' ,
44
- height : '100%' ,
45
- } ;
46
-
47
41
/** Success message for copy operation. */
48
42
const COPY_SUCCESS_MESSAGE = 'Copy completed successfully.' ;
49
43
@@ -86,13 +80,15 @@ export default function CodeDisplay(props: CodeDisplayProps): React.JSX.Element
86
80
/** Creates the custom style object for the syntax highlighter. */
87
81
const getSyntaxHighlighterStyle = ( ) : React . CSSProperties => ( {
88
82
backgroundColor : token . colorBgContainer ,
89
- ...FULL_SIZE_STYLE ,
83
+ width : '100%' ,
84
+ overflowX : 'hidden' ,
85
+ overflowY : 'auto' ,
90
86
} ) ;
91
87
92
88
/** Renders the header section with title and copy button. */
93
89
const renderHeader = ( ) : React . JSX . Element => (
94
- < Antd . Space >
95
- < Antd . Typography . Title level = { 3 } > { t ( "CODE" ) } </ Antd . Typography . Title >
90
+ < Antd . Space align = "center" >
91
+ < Antd . Typography . Title level = { 3 } style = { { margin : 0 } } > { t ( "CODE" ) } </ Antd . Typography . Title >
96
92
< Antd . Tooltip title = { t ( "COPY" ) } >
97
93
< Antd . Button
98
94
icon = { < CopyIcon /> }
@@ -115,7 +111,7 @@ export default function CodeDisplay(props: CodeDisplayProps): React.JSX.Element
115
111
) ;
116
112
117
113
return (
118
- < Antd . Flex vertical gap = "small" >
114
+ < Antd . Flex vertical gap = "small" style = { { height : '100%' } } >
119
115
{ renderHeader ( ) }
120
116
{ renderCodeBlock ( ) }
121
117
</ Antd . Flex >
You can’t perform that action at this time.
0 commit comments