Skip to content
This repository has been archived by the owner on Sep 13, 2020. It is now read-only.

Open the menu with action? #205

Closed
satyagupta opened this issue Mar 21, 2016 · 5 comments
Closed

Open the menu with action? #205

satyagupta opened this issue Mar 21, 2016 · 5 comments

Comments

@satyagupta
Copy link

This is a great menu plugin but it lacks the option to open the menu with action? like with user clicks the menu button (in the title bar)?

Do we have that feature or somehow we can do this?

@esamattis
Copy link
Contributor

I'm using this branch to do it with props #175

It has some bugs thou.

@Kureev
Copy link
Owner

Kureev commented Mar 22, 2016

You can change your menu state by using isOpen prop (and it's in the master btw).
In the example/Basic folder you can find an example of the code.

@Kureev Kureev closed this as completed Mar 22, 2016
@satyagupta
Copy link
Author

Thanks but this does not helps since the main view is actually added inside the SideMenu component.
What if the component (content view) is added as a variable

  render: function() {
    // console.log(this.props.SideMenu);
    // console.log(SideMenu);
    var menu = <SideMenuView navigator={this.props.navigator}/>;
    var contentView = <HomePage navigator={this.props.navigator} menu={SideMenu} />;
    switch(this.props.component){
      case 'home':
        contentView = <HomePage navigator={this.props.navigator} menu={SideMenu} />;
        break;
      case 'checklist':
        contentView = <CheckList navigator={this.props.navigator} menu={SideMenu} />;
        break;
      case 'checklistnewitem':
        contentView = <CheckListNewItem navigator={this.props.navigator} menu={SideMenu} />;
        break;
      case 'profile':
        contentView = <ProfilePage myprofile={true} navigator={this.props.navigator} menu={SideMenu} />;
        break;
      default:
        contentView = <HomePage navigator={this.props.navigator} menu={SideMenu} />;
        break;
    }
    return (
      <SideMenu isOpen={false} onChange={ () => { console.log("Open action "+Date.now()); } } edgeHitWidth={30} openMenuOffset={(SCREEN_WIDTH*2)/3} menu={menu}  menuPosition="left" >
        {contentView}
      </SideMenu>
    );

@satyagupta
Copy link
Author

Sorry ignore the previous comment. I figured it out :) Thanks for point the example.

@Kureev
Copy link
Owner

Kureev commented Mar 22, 2016

👍

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

No branches or pull requests

3 participants