<commit_before>var React = require('react-native');
var TwoSideMenus = require('react-native-2-side-menus');
var Scene = require('scene-router');

var {
  Component,
  AppRegistry,
  StyleSheet,
  Text,
  View,
} = React;

async function wait(delay) {
  return new Promise((resolve) => {
    setTimeout(resolve, delay);
  });
}

class Content extends Component {
  constructor(props) {
    super(props);
  }

  render() {
    return (
      <View style={{ flex: 1, backgroundColor: this.props.color, justifyContent: 'center', alignItems: 'center' }}/>
    );
  }
}

class Menu extends Component {
  constructor(props) {
    super(props);
  }

  menuMightOpen() {
    console.log('menu might open');
  }

  menuDidOpen() {
    console.log('menu did open');
  }

  menuDidClose() {
    console.log('menu did close');
  }

  render() {
    return (
      <Content {...this.props}/>
    );
  }
}

class Login extends Component {
  constructor(props) {
    super(props);
  }

  render() {
    return <Content color="blue"/>
  }
}

class App extends Component {
  constructor(props) {
    super(props);
  }

  componentDidMount() {
    const { menu, leftMenu, rightMenu } = this.refs;
    menu.moreLifeCycles(leftMenu, rightMenu);
  }

  render() {
    return (
      <TwoSideMenus
        ref="menu"
        leftMenu={<Menu ref="leftMenu" color="yellow"/>}
        rightMenu={<Menu ref="rightMenu" color="red"/>}>
        {this.props.children}
      </TwoSideMenus>
    );
  }
}

class Intro extends Component {
  constructor(props) {
    super(props);
  }

  render() {
    return (
      <Content color="black"/>
    );
  }
}

class Faq extends Component {
  constructor(props) {
    super(props);
  }

  render() {
    return (
      <Content color="brown"/>
    );
  }
}

class Main extends Component {
  constructor(props) {
    super(props);
  }

  async componentDidMount() {
    const { scene } = this.refs;

    await wait(2000);
    scene.goto('/home/info', { side:'right', withAnimation: true });

    await wait(2000);
    scene.goto('/home/faq', { side:'right', withAnimation: true });
  }

  render() {
    return (
      <Scene ref="scene" initialPath="/login">
        <Scene path="login" component={Login}/>
        <Scene path="home" component={App} fresh={true}>
          <Scene path="info" component={Intro}/>
          <Scene path="faq" component={Faq}/>
        </Scene>
      </Scene>
    );
  }
}

AppRegistry.registerComponent('ExampleWith2SideMenus', () => Main);
<commit_msg>fixed #5 - incorporated 2 side menus example<commit_after>var React = require('react-native');
var TwoSideMenus = require('react-native-2-side-menus');
var Scene = require('scene-router');

var {
  Component,
  AppRegistry,
  StyleSheet,
  Text,
  View,
} = React;

async function wait(delay) {
  return new Promise((resolve) => {
    setTimeout(resolve, delay);
  });
}

class Content extends Component {
  constructor(props) {
    super(props);
  }

  render() {
    return (
      <View style={{ flex: 1, opacity:this.props.opacity, backgroundColor: this.props.color, justifyContent: 'center', alignItems: 'center' }}/>
    );
  }
}

Content.defaultProps = {
  opacity: 1
};

class Menu extends Component {
  constructor(props) {
    super(props);
  }

  menuMightOpen() {
    console.log('menu might open');
  }

  menuDidOpen() {
    console.log('menu did open');
  }

  menuDidClose() {
    console.log('menu did close');
  }

  render() {
    return (
      <Content {...this.props}/>
    );
  }
}

class Login extends Component {
  constructor(props) {
    super(props);
  }

  render() {
    return <Content color="blue" opacity={1}/>
  }
}

class Intro extends Component {
  constructor(props) {
    super(props);
  }

  render() {
    return (
      <Content color="black"/>
    );
  }
}

class Faq extends Component {
  constructor(props) {
    super(props);
  }

  render() {
    return (
      <Content color="brown"/>
    );
  }
}

class App extends Component {
  constructor(props) {
    super(props);
  }

  async componentDidMount() {
    const { menu, leftMenu, rightMenu, scene } = this.refs;

    menu.moreLifeCycles(leftMenu, rightMenu);

    await wait(2000);
    scene.goto('/home/info', { side:'right', withAnimation: true });

    await wait(2000);
    scene.goto('/home/faq', { side:'right', withAnimation: true });
  }

  render() {
    return (
      <TwoSideMenus
        ref="menu"
        leftMenu={<Menu ref="leftMenu" color="yellow"/>}
        rightMenu={<Menu ref="rightMenu" color="red"/>}>
        <Scene ref="scene" initialPath="/login">
          <Scene path="login" component={Login}/>
          <Scene path="home" component={App} flatten={true}>
            <Scene path="info" component={Intro}/>
            <Scene path="faq" component={Faq}/>
          </Scene>
        </Scene>
      </TwoSideMenus>
    );
  }
}

AppRegistry.registerComponent('ExampleWith2SideMenus', () => App);

{'fraction_non_alphanumeric': 0.16108064188502946, 'fraction_numerical': 0.005281332520820638, 'mean_word_length': 2.837879968823071, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '922633', 'n_tokens_mistral': 1625, 'n_tokens_neox': 1575, 'n_words': 329}