Skip to content

Commit f6e7fac

Browse files
committed
css changes
1 parent 0fe1a61 commit f6e7fac

File tree

10 files changed

+145
-144
lines changed

10 files changed

+145
-144
lines changed

client/.eslintcache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[{"/home/tomarviii88/Desktop/remote-code-executor/client/src/components/header/Header.js":"1","/home/tomarviii88/Desktop/remote-code-executor/client/src/components/code-editor/CodeEditor.js":"2","/home/tomarviii88/Desktop/remote-code-executor/client/src/components/output/InputOutput.js":"3","/home/tomarviii88/Desktop/remote-code-executor/client/src/constants/global.js":"4","/home/tomarviii88/Desktop/remote-code-executor/client/src/components/code-editor/Submit.js":"5","/home/tomarviii88/Desktop/remote-code-executor/client/src/constants/theme.js":"6"},{"size":388,"mtime":1609839782860,"results":"7","hashOfConfig":"8"},{"size":2623,"mtime":1610192088920,"results":"9","hashOfConfig":"8"},{"size":1390,"mtime":1610190812112,"results":"10","hashOfConfig":"8"},{"size":514,"mtime":1610187681416,"results":"11","hashOfConfig":"8"},{"size":462,"mtime":1610189429376,"results":"12","hashOfConfig":"8"},{"size":285,"mtime":1610192356464,"results":"13","hashOfConfig":"8"},{"filePath":"14","messages":"15","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1ld0h7m",{"filePath":"16","messages":"17","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"18","messages":"19","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"20","messages":"21","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"22","messages":"23","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"24","messages":"25","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/home/tomarviii88/Desktop/remote-code-executor/client/src/components/header/Header.js",[],"/home/tomarviii88/Desktop/remote-code-executor/client/src/components/code-editor/CodeEditor.js",[],"/home/tomarviii88/Desktop/remote-code-executor/client/src/components/output/InputOutput.js",["26"],"/home/tomarviii88/Desktop/remote-code-executor/client/src/constants/global.js",[],"/home/tomarviii88/Desktop/remote-code-executor/client/src/components/code-editor/Submit.js",[],"/home/tomarviii88/Desktop/remote-code-executor/client/src/constants/theme.js",[],{"ruleId":"27","severity":1,"message":"28","line":32,"column":7,"nodeType":"29","messageId":"30","endLine":32,"endColumn":12},"no-unused-vars","'error' is assigned a value but never used.","Identifier","unusedVar"]
1+
[{"/home/tomarviii88/Desktop/remote-code-executor/client/src/components/code-editor/CodeEditor.js":"1","/home/tomarviii88/Desktop/remote-code-executor/client/src/components/code-editor/Submit.js":"2","/home/tomarviii88/Desktop/remote-code-executor/client/src/App.js":"3","/home/tomarviii88/Desktop/remote-code-executor/client/src/components/code-editor/InputOutput.js":"4","/home/tomarviii88/Desktop/remote-code-executor/client/src/components/code-editor/styledComponents.js":"5"},{"size":2165,"mtime":1610266384288,"results":"6","hashOfConfig":"7"},{"size":544,"mtime":1610264957288,"results":"8","hashOfConfig":"7"},{"size":798,"mtime":1610265109888,"results":"9","hashOfConfig":"7"},{"size":728,"mtime":1610266437116,"results":"10","hashOfConfig":"7"},{"size":470,"mtime":1610266418988,"results":"11","hashOfConfig":"7"},{"filePath":"12","messages":"13","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1ld0h7m",{"filePath":"14","messages":"15","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"16","messages":"17","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"18","messages":"19","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"20","messages":"21","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/home/tomarviii88/Desktop/remote-code-executor/client/src/components/code-editor/CodeEditor.js",[],"/home/tomarviii88/Desktop/remote-code-executor/client/src/components/code-editor/Submit.js",[],"/home/tomarviii88/Desktop/remote-code-executor/client/src/App.js",[],"/home/tomarviii88/Desktop/remote-code-executor/client/src/components/code-editor/InputOutput.js",["22"],"/home/tomarviii88/Desktop/remote-code-executor/client/src/components/code-editor/styledComponents.js",[],{"ruleId":"23","severity":1,"message":"24","line":8,"column":7,"nodeType":"25","messageId":"26","endLine":8,"endColumn":12},"no-unused-vars","'error' is assigned a value but never used.","Identifier","unusedVar"]

client/src/App.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { GlobalStyles } from './constants/global.js';
55
import { useDarkMode } from './utils/useDarkMode';
66
import Header from './components/header/Header.js';
77
import CodeEditor from './components/code-editor/CodeEditor.js';
8-
import InputOutput from './components/output/InputOutput.js';
98
import './App.css';
109

1110
const App = () => {

client/src/components/code-editor/CodeEditor.js

Lines changed: 15 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,10 @@ import React, { useRef, useState } from 'react';
22
import Editor from '@monaco-editor/react';
33
import { executeCode, setLoadingTrue } from '../../actions/code';
44
import { useDispatch, useSelector } from 'react-redux';
5-
import InputOutput from '../output/InputOutput';
5+
import InputOutput from './InputOutput';
66
import Submit from './Submit';
7-
import styled from 'styled-components';
8-
import './style.css';
9-
10-
const Row = styled.div`
11-
display: flex;
12-
flex-direction: row;
13-
`;
14-
15-
const Column = styled.div`
16-
display: flex;
17-
flex-direction: column;
18-
box-sizing: border-box;
19-
flex: 1;
20-
`;
21-
22-
const SubmitButton = styled.button`
23-
background-color: #3b8d47;
24-
color: white;
25-
margin-left: 10px;
26-
padding: 10px;
27-
box-sizing: border-box;
28-
border: none;
29-
outline: none;
30-
font-size: 16px;
31-
width: 100px;
32-
`;
33-
34-
const OutputWindow = styled.div`
35-
flex: 1;
36-
background-color: #eeeeee;
37-
margin: 20px;
38-
border-radius: 5px;
39-
padding: 10px;
40-
box-sizing: border-box;
41-
overflow: auto;
42-
color: ${props => (props.error ? 'red' : 'black')};
43-
`;
7+
import styles from './codeEditor.module.css';
8+
import { OutputWindow } from './styledComponents';
449

4510
const CodeEditor = ({ theme }) => {
4611
const loading = useSelector(state => state.code.isFetching);
@@ -70,26 +35,30 @@ const CodeEditor = ({ theme }) => {
7035

7136
return (
7237
<>
73-
<Row>
38+
<div className={styles.row}>
7439
<Editor
7540
height='70vh'
7641
width='50%'
7742
language={language}
7843
theme={theme === 'dark' ? 'vs-dark' : 'light'}
7944
editorDidMount={handleEditorDidMount}
8045
/>
81-
<Column>
82-
<Row style={{ marginLeft: 20 }}>
46+
<div className={styles.column}>
47+
<div className={styles.row} style={{ marginLeft: 20 }}>
8348
<Submit language={language} changeLanguage={changeLanguage} />
84-
<SubmitButton onClick={SubmitCode} disabled={!isEditorReady}>
49+
<button
50+
className={styles.submitButton}
51+
onClick={SubmitCode}
52+
disabled={!isEditorReady}
53+
>
8554
{loading ? 'Loading..' : 'Submit'}
86-
</SubmitButton>
87-
</Row>
55+
</button>
56+
</div>
8857
<OutputWindow error={error === '' ? false : true}>
8958
<pre>{output === '' ? error : output}</pre>
9059
</OutputWindow>
91-
</Column>
92-
</Row>
60+
</div>
61+
</div>
9362
<InputOutput input={input} setInput={setInput} theme={theme} />
9463
</>
9564
);
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import React, { useEffect } from 'react';
2+
import { TextInput } from './styledComponents';
3+
import { useSelector } from 'react-redux';
4+
import styles from './codeEditor.module.css';
5+
6+
const InputOutput = ({ input, setInput, theme }) => {
7+
let output = useSelector(state => state.code.output);
8+
let error = useSelector(state => state.code.error);
9+
10+
useEffect(() => {
11+
console.log(output);
12+
}, [output]);
13+
return (
14+
<div className={styles.inputWindow}>
15+
<TextInput
16+
theme={theme}
17+
value={input}
18+
onChange={e => {
19+
console.log(e.target.value);
20+
setInput(e.target.value);
21+
}}
22+
className={styles.textareaInput}
23+
/>
24+
</div>
25+
);
26+
};
27+
28+
export default InputOutput;

client/src/components/code-editor/Submit.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
import React from 'react';
2+
import styles from './codeEditor.module.css';
23

34
const Submit = ({ language, changeLanguage }) => {
45
return (
5-
<div className='sel-lang '>
6-
<select value={language} onChange={changeLanguage}>
6+
<div>
7+
<select
8+
className={styles.sellang}
9+
value={language}
10+
onChange={changeLanguage}
11+
>
712
<option value='c'>C</option>
813
<option value='cpp'>C++</option>
914
<option value='python'>Python</option>
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
.row {
2+
display: flex;
3+
flex-direction: row;
4+
}
5+
6+
.column {
7+
display: flex;
8+
flex-direction: column;
9+
box-sizing: border-box;
10+
flex: 1;
11+
}
12+
13+
.submitButton {
14+
background-color: #3b8d47;
15+
color: white;
16+
margin-left: 10px;
17+
padding: 10px;
18+
box-sizing: border-box;
19+
border: none;
20+
outline: none;
21+
font-size: 16px;
22+
width: 100px;
23+
}
24+
25+
.inputWindow {
26+
display: flex;
27+
flex-direction: row;
28+
justify-content: space-between;
29+
margin-top: 10px;
30+
flex: 1;
31+
height: 100%;
32+
flex: 1;
33+
box-sizing: border-box;
34+
margin: 20;
35+
background-color: '#eeeeee';
36+
overflow: scroll;
37+
outline: none;
38+
}
39+
40+
.inputField::-webkit-scrollbar {
41+
display: none;
42+
}
43+
44+
.sellang {
45+
display: block;
46+
font-size: 16px;
47+
font-family: sans-serif;
48+
font-weight: 700;
49+
color: #444;
50+
line-height: 1.3;
51+
padding: 10px;
52+
width: 100%;
53+
box-sizing: border-box;
54+
margin: 0;
55+
outline: none;
56+
border: none;
57+
background-color: white;
58+
}
59+
60+
.sellang > option {
61+
font-size: 16px;
62+
font-family: sans-serif;
63+
font-weight: 700;
64+
color: #444;
65+
line-height: 1.3;
66+
padding: 10px;
67+
display: block;
68+
}
69+
70+
.textareaInput {
71+
display: flex;
72+
outline: none;
73+
border-radius: 7px;
74+
padding: 5px;
75+
box-sizing: border-box;
76+
flex: 1;
77+
}

client/src/components/code-editor/style.css

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import styled from 'styled-components';
2+
3+
export const OutputWindow = styled.div`
4+
flex: 1;
5+
background-color: #eeeeee;
6+
margin: 20px;
7+
border-radius: 5px;
8+
padding: 10px;
9+
box-sizing: border-box;
10+
overflow: auto;
11+
color: ${props => (props.error ? 'red' : 'black')};
12+
`;
13+
14+
export const TextInput = styled.textarea`
15+
color: ${props => (props.theme === 'dark' ? 'white' : 'black')};
16+
background-color: ${props => (props.theme === 'dark' ? '#1e1e1e' : 'white')};
17+
`;

client/src/components/output/InputOutput.js

Lines changed: 0 additions & 57 deletions
This file was deleted.

client/src/components/output/style.css

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)