Add a pane to render the AST.
This commit is contained in:
parent
b6f74c9a6e
commit
a1b1e9e5c5
@ -1,5 +1,7 @@
|
|||||||
.App {
|
.App {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
height: 100vh;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.App-logo {
|
.App-logo {
|
||||||
|
@ -1,14 +1,10 @@
|
|||||||
import React from 'react';
|
|
||||||
import logo from './logo.svg';
|
|
||||||
import './App.css';
|
import './App.css';
|
||||||
import Editor from './Editor';
|
import Editor from './Editor';
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
return (
|
return (
|
||||||
<div className="App">
|
<div className="App">
|
||||||
<header className="App-header">
|
<Editor />
|
||||||
<Editor />
|
|
||||||
</header>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
16
src/Editor.css
Normal file
16
src/Editor.css
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
.Editor {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.Editor-textarea {
|
||||||
|
flex: 1;
|
||||||
|
flex-basis: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.Editor-ast {
|
||||||
|
flex: 1;
|
||||||
|
background: green;
|
||||||
|
}
|
@ -1,10 +1,15 @@
|
|||||||
|
import './Editor.css';
|
||||||
|
|
||||||
function Editor() {
|
function Editor() {
|
||||||
function handleChange(event: React.ChangeEvent<HTMLTextAreaElement>) {
|
function handleChange(event: React.ChangeEvent<HTMLTextAreaElement>) {
|
||||||
console.log(event.target.value);
|
console.log(event.target.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<textarea onChange={handleChange}></textarea>
|
<div className="Editor">
|
||||||
|
<textarea onChange={handleChange} className="Editor-textarea"></textarea>
|
||||||
|
<div className="Editor-ast"></div>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user