From ed7c6300f28cc451b12dc3243b38946ca6f08d32 Mon Sep 17 00:00:00 2001 From: Adam Veldhousen Date: Fri, 17 Jan 2020 10:15:09 -0600 Subject: [PATCH] switching to electron because no clipboard support and flex box doesn't work properly --- config.example.json | 4 + frontend/package.json | 1 + frontend/src/App.js | 1 + .../EditableNoteArea/EditableNoteArea.css | 21 ++++- .../EditableNoteArea/EditableNoteArea.js | 13 +-- frontend/src/components/NoteContent.css | 8 +- frontend/src/components/NoteList/NoteList.css | 19 ++-- frontend/src/components/NoteList/NoteList.js | 9 +- frontend/src/state.js | 90 ++++++++++++++++++- frontend/yarn.lock | 5 ++ go.mod | 1 + go.sum | 21 +++++ main.go | 53 +++++++++-- makefile | 2 +- 14 files changed, 220 insertions(+), 28 deletions(-) create mode 100644 config.example.json diff --git a/config.example.json b/config.example.json new file mode 100644 index 0000000..231b456 --- /dev/null +++ b/config.example.json @@ -0,0 +1,4 @@ +{ + "orientation": "vertical", + "noteDirectory": "~/.xnv/notes" +} diff --git a/frontend/package.json b/frontend/package.json index 312c6a3..5341409 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -7,6 +7,7 @@ "@testing-library/react": "^9.3.2", "@testing-library/user-event": "^7.1.2", "date-fns": "^2.9.0", + "lodash.debounce": "^4.0.8", "react": "^16.12.0", "react-dom": "^16.12.0", "react-markdown": "^4.3.1", diff --git a/frontend/src/App.js b/frontend/src/App.js index 682e6b6..21edaee 100644 --- a/frontend/src/App.js +++ b/frontend/src/App.js @@ -84,6 +84,7 @@ class App extends PureComponent { notes={notes} onSelect={this.handleSelectNote} onTagUpdate={this.handleTagUpdate} + selectedNote={selectedNote} /> - setNewContent(target.value || newContent); + const updateContent = ({ target: { value } }) => { + onSave(value); + }; return (
{!preview ? ( -