-
Notifications
You must be signed in to change notification settings - Fork 560
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
Update behavior and view when adding new note from trash #2618
Update behavior and view when adding new note from trash #2618
Conversation
lib/note-list/no-notes.tsx
Outdated
const getButton = () => { | ||
return searchQuery.length ? ( | ||
const getSearchButton = () => { | ||
return ( | ||
<button | ||
onClick={() => | ||
dispatch(actions.ui.createNote({ content: searchQuery })) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤨 nothing like deep coupling - how'd that get in there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. I'm not sure if my approach to this refactoring of the empty note list views is the best way to go. Any thoughts would be much appreciated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
best policy is to not change code styling in an unrelated PR so I wouldn't recommend doing anything differently. that being said I occasionally point out things in code review that are unrelated but which stand out to me. this is one of those because I saw dispatch
inside a UI component, which is something that sets off all the alarms in my head
lib/note-list/no-notes.tsx
Outdated
const getButton = () => { | ||
return searchQuery.length ? ( | ||
const getSearchButton = () => { | ||
return ( | ||
<button | ||
onClick={() => | ||
dispatch(actions.ui.createNote({ content: searchQuery })) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. I'm not sure if my approach to this refactoring of the empty note list views is the best way to go. Any thoughts would be much appreciated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good and works well!
One small request. Similar to iOS, I think the "Create your first note" text should be a link that creates a note.
Good catch, thanks @codebykat. I followed the designs, but that makes sense to have it as a link. I have it updated now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great 👍
d619c07
to
d8ad44a
Compare
Move new note button title back into jsx. Reenabling keyboard shortcut while in trash and refactoring the no notes views Update styling for empty note list views Updating the approach of setting the empty note screens based on feedback. Update create first note to be a link Moving type declaration to module global scope Restore package-lock.json file
d8ad44a
to
51cbb72
Compare
Fix
Currently when you are viewing the trash adding a new note is confusing.
This PR resolves #2612 by updating the view to all notes when adding a note from trash.
It also resolves #2627 by updating the views which appear when there are no notes in a list.
Test
Cmd or Ctrl + Shift + i
does create a new noteAdditional testing
Release