@@ -5,29 +5,58 @@ import { Container, Stack, Spinner } from 'react-bootstrap'
5
5
const CodeSpace = ( { handleEditorChange, loading, code, language, output, isError } ) => {
6
6
return (
7
7
8
- < Stack gap = { 3 } className = 'h-100' >
8
+ < Stack gap = { 3 } className = 'h-100' style = { { height : '100vh' } } >
9
+ { /* Editor Section (60% of viewport) */ }
10
+ < div style = { { borderRadius : '0.5rem' , overflow : 'hidden' , height : '60vh' } } >
9
11
< Editor
10
- height = '400px'
12
+ height = "100%" // Make the editor fill the container
11
13
defaultLanguage = "python"
12
14
language = { language }
13
15
value = { code }
14
16
onChange = { handleEditorChange }
15
- theme = 'vs-dark'
17
+ theme = "vs-dark"
18
+ options = { {
19
+ fontSize : 14 // Set font size here, adjust as needed
20
+ } }
16
21
/>
17
- < Container style = { { height : '225px' , border : '1px solid #ccc' , borderRadius : '0.5rem' , padding : '1rem' , backgroundColor : '#f8f9fa' , padding : '20px' } } >
18
- < h4 > Output</ h4 >
19
- { loading ? (
20
- < div className = "d-flex justify-content-center align-items-center" style = { { height : '100%' } } >
22
+ </ div >
23
+
24
+ { /* Output Section (40% of viewport) */ }
25
+ < Container
26
+ style = { {
27
+ height : '30vh' , // Occupies 40% of viewport height
28
+ border : '1px solid #ccc' ,
29
+ borderRadius : '0.5rem' ,
30
+ padding : '1rem' ,
31
+ backgroundColor : '#f8f9fa' ,
32
+ } }
33
+ >
34
+ < p > Output</ p >
35
+ { loading ? (
36
+ < div className = "d-flex justify-content-center align-items-center" style = { { height : '100%' } } >
21
37
< Spinner animation = "border" variant = "primary" />
22
38
< span className = "ms-1" > Running...</ span >
23
- </ div >
24
- ) : (
25
- < div style = { { height : '150px' , maxHeight : '150px' , overflowY : 'auto' , fontFamily : 'monospace' , whiteSpace : 'pre-wrap' , border : '1px solid rgba(0, 0, 0, 0.2)' , borderRadius : '0.5rem' } } >
39
+ </ div >
40
+ ) : (
41
+ < div
42
+ style = { {
43
+ height : '90%' ,
44
+ overflowY : 'auto' ,
45
+ fontFamily : 'monospace' ,
46
+ whiteSpace : 'pre-wrap' ,
47
+ border : '1px solid rgba(0, 0, 0, 0.2)' ,
48
+ borderRadius : '0.5rem' ,
49
+ paddingLeft : '5px' ,
50
+ paddingLeft : '10px' ,
51
+ fontSize : '16'
52
+ } }
53
+ >
26
54
< p style = { { color : isError ? 'red' : '#212529' } } > { output } </ p >
27
- </ div >
28
- ) }
29
- </ Container >
30
- </ Stack >
55
+ </ div >
56
+ ) }
57
+ </ Container >
58
+ </ Stack >
59
+
31
60
32
61
)
33
62
}
0 commit comments