Skip to content

Commit

Permalink
fix: adjust editor layout (#28)
Browse files Browse the repository at this point in the history
Fix the editor layout and move the console from the right of the screen to the bottom of the screen
  • Loading branch information
abolkog authored Oct 17, 2024
1 parent 7df79fb commit 8ce1da4
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 19 deletions.
12 changes: 10 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<link rel="shortcut icon" href="favicon.ico" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<link rel="shortcut icon" href="favicon.ico" />
<link
href="https://stackpath.bootstrapcdn.com/bootswatch/4.1.3/slate/bootstrap.min.css"
rel="stylesheet"
Expand All @@ -22,6 +25,11 @@
href="https://cdnjs.cloudflare.com/ajax/libs/github-fork-ribbon-css/0.2.3/gh-fork-ribbon.min.css"
/>

<link
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/codicon.min.css"
rel="stylesheet"
/>

<title>JS Playground | A.B.O.L.K.O.G</title>
</head>
<body>
Expand Down
14 changes: 5 additions & 9 deletions src/components/App/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import JsonView from 'components/JsonView';
import CodeEditor from 'components/CodeEditor';
import Console from 'components/Console';

const width = 1400;

const App: React.FC = () => {
const { dispatch } = useContext(AppContext);
const [position, setPosition] = useState<MenuPosition | null>(null);
Expand All @@ -29,18 +27,16 @@ const App: React.FC = () => {
};

return (
<div className="mainContainer">
<div className="flex flexColumn">
<Header />

<div className="appConainer">
<div style={{ width }}>
<div className="flex flexColumn">
<div className="editorContainer">
<CodeEditor />
</div>

<div style={{ width: window.innerWidth - width - 20 }}>
<div style={{ height: '100%' }} onContextMenu={handleContextMenu}>
<Console />
</div>
<div className=" consoleContainer" onContextMenu={handleContextMenu}>
<Console />
</div>
</div>

Expand Down
26 changes: 18 additions & 8 deletions src/styles/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,31 @@ body {
display: flex;
flex: 1;
height: 100%;


}

.mainContainer {
.flex {
display: flex;
flex: 1;
}

.flexColumn {
flex-direction: column;
overflow: hidden;
}

.appConainer {
.editorContainer {
height: 70vh;
}

.consoleContainer {
height: 20vh;
display: flex;
flex: 1;
flex: 1
}


.monaco-editor,
.overflow-guard {
width: 100% !important;
Expand All @@ -33,16 +44,15 @@ body {
word-break: break-all;
font-size: large;
font-family: sans-serif;
padding: 20px;
overflow-y: auto;
width: 100%;
height: 100vh;
padding: 20px 20px 120px 20px;
overflow-y: scroll;

}

.console-light {
background-color: #fff;
color: #3a3f44;
color: #3a3f44;
border-top: 1px solid #3a3f44;
}

.error {
Expand Down

0 comments on commit 8ce1da4

Please sign in to comment.