Skip to content
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

WIP: Split view #106

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

WIP: Split view #106

wants to merge 1 commit into from

Conversation

zecakeh
Copy link
Contributor

@zecakeh zecakeh commented Jan 16, 2021

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.

Capture d’écran du 2021-01-16 18-43-34

@bobleeSwagger2
Copy link

I think you’re in the right direction Kévin...that POC looks great!

This was referenced Jan 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants