Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a first draft for #34 to have your opinion on what's happening so far.
I believe I chose the configuration that would be the simplest and cleanest (though a bit messy for my taste)…
So I propose to introduce a nested
MainStack
that can show the Notes List at the left of its Screens if there's enough space. An advantage is that by default it doesn't break the actual behavior of the app. An inconvenient is that there's a lot of small file changes because of the types (otherwise most files would be untouched).The code as it is kinda works and is not polished:
Notebook Selection
The notebook selection is not implemented. We can't use the URL to change the notebook. This makes the navigator navigate to Home, so the screen on the right doesn't stay open. Plus it's a weird behavior to have the URL change when only the list changes.
It is also difficult to send data from the Drawer to the Notes List Screen. We could use a Context but that's seems exaggerated just for this.
A solution could be to have the Notebook selection as a dropdown when clicking the title in the Header Bar: we don't need to involve the URL as it's already part of the screen.
Selection
Of course the selected (open) note should be highlighted in the Notes List.
Header Bar
The header bar style is not consistent between React Native Paper and React Navigation but it can easily be fixed.
Right Action
The
RightAction
component seems to create a loop if I include it in the Header so the page never finishes to render. I didn't investigate this for now.I mostly want to know if it's worth pursuing that direction.