Add a pane to render the AST.

This commit is contained in:
Tom Alexander 2024-01-12 22:07:59 -05:00
parent b6f74c9a6e
commit a1b1e9e5c5
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
4 changed files with 25 additions and 6 deletions

View File

@ -1,5 +1,7 @@
.App {
text-align: center;
height: 100vh;
width: 100%;
}
.App-logo {

View File

@ -1,14 +1,10 @@
import React from 'react';
import logo from './logo.svg';
import './App.css';
import Editor from './Editor';
function App() {
return (
<div className="App">
<header className="App-header">
<Editor />
</header>
<Editor />
</div>
);
}

16
src/Editor.css Normal file
View 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;
}

View File

@ -1,10 +1,15 @@
import './Editor.css';
function Editor() {
function handleChange(event: React.ChangeEvent<HTMLTextAreaElement>) {
console.log(event.target.value);
}
return (
<textarea onChange={handleChange}></textarea>
<div className="Editor">
<textarea onChange={handleChange} className="Editor-textarea"></textarea>
<div className="Editor-ast"></div>
</div>
);
}