-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathNotes.tsx
58 lines (55 loc) · 1.4 KB
/
Notes.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import { highlight, languages } from 'prismjs';
import 'prismjs/components/prism-markdown';
import * as React from 'react';
import Editor from 'react-simple-code-editor';
import styled from 'styled-components';
import { useStore } from '../store';
import { ctrlColor, inputBg } from '../styles';
import GuiWindow from './GuiWindow';
const CustomTextArea = styled(Editor)`
border-radius: 5px;
background: ${inputBg};
border-color: transparent;
resize: vertical;
:focus {
outline: ${ctrlColor} solid 2px;
}
`;
interface Props {}
const Notes: React.FC<Props> = () => {
const { notes, setNotes } = useStore();
return (
<GuiWindow>
<p
style={{
fontSize: '17.5px',
padding: 0,
margin: 0,
marginBottom: '10px',
width: '100%',
textAlign: 'center',
}}
>
Notes
</p>
<label className={'sr-only'} htmlFor={`notes-input`}>
Notes
</label>
<CustomTextArea
textareaId={'notes-input'}
value={notes}
className={'userInput'}
highlight={(code) => highlight(code, languages.markdown, 'md')}
onValueChange={(code) => setNotes(code)}
name="notes"
padding={10}
id="notes"
style={{
fontFamily: '"Fira code", "Fira Mono", monospace',
fontSize: 12,
}}
/>
</GuiWindow>
);
};
export default Notes;