Skip to content

Commit 907a379

Browse files
committed
Issue #4 ongoing
1 parent f382be0 commit 907a379

2 files changed

Lines changed: 40 additions & 2 deletions

File tree

‎front/src/pods/trainer/components/session.component.tsx‎

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,24 @@ import React from 'react';
22
import * as classes from './session.styles';
33
// Material UI ~ components
44
import TextareaAutosize from '@material-ui/core/TextareaAutosize';
5+
import Button from '@material-ui/core/Button';
56

67
interface Props {
78
log: string;
89
}
910

11+
const handleSetSessionContent = (sessionContent: string) => {
12+
const sessionTextArea: HTMLInputElement = document.getElementById("session") as HTMLInputElement;
13+
sessionTextArea ? sessionTextArea.value=sessionContent : undefined;
14+
}
15+
1016
export const SessionComponent: React.FC<Props> = props => {
1117
const { log } = props;
12-
const { labelTextarea, studentBoard } = classes;
18+
const { labelTextarea, studentBoard, sendBtn, undoBtn } = classes;
19+
20+
React.useEffect(()=>{
21+
handleSetSessionContent(log);
22+
}, [log]);
1323

1424
return (
1525
<div>
@@ -21,8 +31,27 @@ export const SessionComponent: React.FC<Props> = props => {
2131
rowsMax={20}
2232
rowsMin={20}
2333
className={studentBoard}
24-
value={log}
34+
disabled={false}
35+
// onChange={(e)=>modifyLog="adiso"}
2536
/>
37+
<Button
38+
variant="contained"
39+
color="secondary"
40+
className={undoBtn}
41+
onClick={() => handleSetSessionContent(log)}
42+
// disabled={!trainerText}
43+
>
44+
Undo
45+
</Button>
46+
<Button
47+
variant="contained"
48+
color="primary"
49+
className={sendBtn}
50+
// onClick={() => handleAppendTrainerTextInternal()}
51+
// disabled={!trainerText}
52+
>
53+
Send
54+
</Button>
2655
</div>
2756
);
2857
};

‎front/src/pods/trainer/components/session.styles.ts‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,12 @@ export const studentBoard = css`
2121
export const labelTextarea = css`
2222
font-family: ${typography.fontFamily};
2323
`;
24+
25+
export const sendBtn = css`
26+
width: 50%;
27+
`;
28+
29+
export const undoBtn = css`
30+
width: 50%;
31+
color: red;
32+
`;

0 commit comments

Comments
 (0)