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

Close side menu clicking on another button #245

Open
@IronTony

Description

@IronTony

Hi all,

I have read these issues, but I didn't find an answer to my question.
I am using this component, that made my day, and I am using this with Router Flux.
So in my App.js as you can see I have the sidemenu and the router:

<ScrollView>
   <SideMenu
    menu={menu}
    isOpen={this.state.isOpen}
    onChange={(isOpen) => this.updateMenuState(isOpen)}
    menuPosition={'right'}
    scrollsToTop={false}
    openMenuOffset={Dimensions.get('window').width * 0.85}
    > 
 <View style={{marginTop:20, height: 40, backgroundColor: 'white'}}>
      <Button style={styles.button} onPress={() => this.toggle()}>
        <Icon name="menu" />
      </Button>
    </View>
    <View style={styles.containerNoPad}>
      <Router hideNavBar={true}>
        <Scene key='root'>
          <Scene key='homepage' component={HomePage} title='Homepage' initial={true} />
          ..........
        </Scene>
      </Router>
    </View>
  </SideMenu>
</ScrollView>

Then in Menu.js I have the render() of the menu. I'd like that clicking on a menu item, the menu will be closed automatically with its effect. Unfortunately I am not able to do this. Any help?

This is my menu item:

<View>
  <Button onPress={() =>  {
      Actions.anotherPage({hideNavBar: true, type: 'reset'})
    }}>
    <View>
      <Icon name="paging" />
    </View>
    <View>
      <Text>Another page</Text>
    </View>
  </Button>
</View>

Sorry for the indentation problem.....

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions