File tree Expand file tree Collapse file tree 2 files changed +7
-20
lines changed
Expand file tree Collapse file tree 2 files changed +7
-20
lines changed Original file line number Diff line number Diff line change @@ -16,12 +16,14 @@ body {
1616}
1717
1818.App-editor {
19- height : 220 px ;
19+ height : 260 px ;
2020 overflow : auto;
21+ margin-top : 50px !important ;
2122}
2223
2324.App-tools {
2425 margin-top : 5px ;
26+ margin-bottom : 50px !important ;
2527}
2628
2729.App-tools ,
Original file line number Diff line number Diff line change @@ -8,23 +8,8 @@ import TextareaCodeEditor from '../';
88import MDStr from '../README.md' ;
99import './App.css' ;
1010
11- const codeStr = `import React from "react";
12- import CodeEditor from '@uiw/react-textarea-code-editor';
13- import ReactDOM from "react-dom";
14-
15- function App() {
16- return (
17- <CodeEditor
18- value="console.log('Hello World')"
19- language="js"
20- />
21- );
22- }
23-
24- ReactDOM.render(<App />, document.getElementById("root"));` ;
25-
2611const App : React . FC = ( ) => {
27- const [ value , setValue ] = useState ( codeStr ) ;
12+ const [ value , setValue ] = useState ( '' ) ;
2813 const [ language , setLanguage ] = useState ( 'jsx' ) ;
2914 useEffect ( ( ) => {
3015 if ( language ) {
@@ -43,10 +28,10 @@ const App: React.FC = () => {
4328 < h1 className = "App-title" > React Textarea Code Editor</ h1 >
4429 < div className = "App-editor" >
4530 < TextareaCodeEditor
46- language = { language }
47- value = { value }
48- style = { { backgroundColor : '#fafafa' , outline : 0 } }
4931 autoFocus
32+ value = { value }
33+ language = { language }
34+ style = { { backgroundColor : '#fafafa' , outline : 0 , fontSize : 14 } }
5035 onChange = { ( evn ) => setValue ( evn . target . value ) }
5136 />
5237 </ div >
You can’t perform that action at this time.
0 commit comments