Skip to content
This repository has been archived by the owner on Feb 15, 2019. It is now read-only.

Accept 2 new props for DrawerItems (disabled, handlesDrawerToggle) #220

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

cooperka
Copy link

@cooperka cooperka commented Nov 2, 2016

New props:

  • disabled: Passed though to TouchableWithoutFeedback, as well as to render functions such as renderTitle.

  • 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:

screenshot of drawer

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 🌵

@dantman
Copy link

dantman commented Nov 8, 2016

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.

@cooperka
Copy link
Author

cooperka commented Nov 8, 2016

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants