diff --git a/src/reactComponents/CodeDisplay.tsx b/src/reactComponents/CodeDisplay.tsx index 563620d3..13ee5494 100644 --- a/src/reactComponents/CodeDisplay.tsx +++ b/src/reactComponents/CodeDisplay.tsx @@ -38,12 +38,6 @@ interface CodeDisplayProps { setAlertErrorMessage: StringFunction; } -/** Full dimensions style for the syntax highlighter. */ -const FULL_SIZE_STYLE = { - width: '100%', - height: '100%', -}; - /** Success message for copy operation. */ const COPY_SUCCESS_MESSAGE = 'Copy completed successfully.'; @@ -86,13 +80,15 @@ export default function CodeDisplay(props: CodeDisplayProps): React.JSX.Element /** Creates the custom style object for the syntax highlighter. */ const getSyntaxHighlighterStyle = (): React.CSSProperties => ({ backgroundColor: token.colorBgContainer, - ...FULL_SIZE_STYLE, + width: '100%', + overflowX: 'hidden', + overflowY: 'auto', }); /** Renders the header section with title and copy button. */ const renderHeader = (): React.JSX.Element => ( - - {t("CODE")} + + {t("CODE")} } @@ -115,7 +111,7 @@ export default function CodeDisplay(props: CodeDisplayProps): React.JSX.Element ); return ( - + {renderHeader()} {renderCodeBlock()}