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 {
3838  setAlertErrorMessage : StringFunction ; 
3939} 
4040
41- /** Full dimensions style for the syntax highlighter. */ 
42- const  FULL_SIZE_STYLE  =  { 
43-   width : '100%' , 
44-   height : '100%' , 
45- } ; 
46- 
4741/** Success message for copy operation. */ 
4842const  COPY_SUCCESS_MESSAGE  =  'Copy completed successfully.' ; 
4943
@@ -86,13 +80,15 @@ export default function CodeDisplay(props: CodeDisplayProps): React.JSX.Element
8680  /** Creates the custom style object for the syntax highlighter. */ 
8781  const  getSyntaxHighlighterStyle  =  ( ) : React . CSSProperties  =>  ( { 
8882    backgroundColor : token . colorBgContainer , 
89-     ...FULL_SIZE_STYLE , 
83+     width : '100%' , 
84+     overflowX : 'hidden' , 
85+     overflowY : 'auto' , 
9086  } ) ; 
9187
9288  /** Renders the header section with title and copy button. */ 
9389  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 > 
9692      < Antd . Tooltip  title = { t ( "COPY" ) } > 
9793        < Antd . Button 
9894          icon = { < CopyIcon  /> } 
@@ -115,7 +111,7 @@ export default function CodeDisplay(props: CodeDisplayProps): React.JSX.Element
115111  ) ; 
116112
117113  return  ( 
118-     < Antd . Flex  vertical  gap = "small" > 
114+     < Antd . Flex  vertical  gap = "small"   style = { {   height :  '100%'   } } > 
119115      { renderHeader ( ) } 
120116      { renderCodeBlock ( ) } 
121117    </ Antd . Flex > 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments