This repository was archived by the owner on Feb 15, 2019. It is now read-only.
Accept 2 new props for DrawerItems (disabled, handlesDrawerToggle)#220
Open
cooperka wants to merge 4 commits intoexpo:masterfrom
Open
Accept 2 new props for DrawerItems (disabled, handlesDrawerToggle)#220cooperka wants to merge 4 commits intoexpo:masterfrom
cooperka wants to merge 4 commits intoexpo:masterfrom
Conversation
For items that will handle closing the drawer (or not) themselves after being pressed.
|
I'm in favour of being able to disable items. However I don't think that headings should be implemented that way (they shouldn't be wrapped in a touchable area at all), non-navigation chunks should be supported explicitly #227. |
Author
|
I agree @dantman, a more extensive change like you're proposing would make things like this a lot easier. I'd be interested in helping work on that once this is merged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
New props:
disabled: Passed though to TouchableWithoutFeedback, as well as to render functions such asrenderTitle.handlesDrawerToggle: For items that will handle closing the drawer (or not) themselves after being pressed. If this prop is truthy, these items will not cause the drawer to close automatically.Reason for adding:
I have "section headers" in my drawer that help visually group a few related items together. They shouldn't respond to touch events, and are thus disabled.
I also currently have a drawer item called "Check Updates" that simply shows a spinner while checking for updates. No route is pushed, and the drawer should not be closed.
Screenshot of my app using the new props:
Misc.
Also minorly updates the README with a relevant link to source for
DrawerNavigationItem, and gitignores a directory that's auto-generated by IntelliJ.Please let me know if there's any testing or linting you'd like me to do before merging this!
Thanks 🌵