Skip to content

fix: adjust editor layout #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/vscode-codicons@0.0.17/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,15 +8,13 @@
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);

useEffect(() => {
const consoleProxy = console.log;

Check warning on line 16 in src/components/App/App.tsx

View workflow job for this annotation

GitHub Actions / check

Unexpected console statement
console.log = msg => {

Check warning on line 17 in src/components/App/App.tsx

View workflow job for this annotation

GitHub Actions / check

Unexpected console statement
dispatch({ type: AppAactions.CODE_RUN_SUCCESS, payload: msg });
consoleProxy(msg);
};
Expand All @@ -28,36 +26,34 @@
setPosition({ top: pageY, left: pageX });
};

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>

<About />

<JsonView />

<ContextMenu
position={position}
onClose={() => setPosition(null)}
onClick={() => {
dispatch({ type: AppAactions.TOGGLE_JSON_VIEW, payload: 'block' });
setPosition(null);
}}
/>
</div>
);

Check warning on line 56 in src/components/App/App.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
};

Check warning on line 57 in src/components/App/App.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

export default App;
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
Loading