<commit_before>import React from 'react';

import Menu from './Menu';
import Liabilities from './Liabilities';
import Assets from './Assets';
import Totals from './Totals';

import Flickity from 'react-flickity-component/src/index';

class AppContainer extends React.Component {
  constructor(props, context){
    const p = JSON.parse(JSON.stringify(props));
    p.selectedMenuIndex = localStorage && localStorage.getItem('selectedTab') || 0;
    super(props, context);
    this.state = p;
    this.onMenuSelect = this.onMenuSelect.bind(this);
  }

  componentWillReceiveProps(nextProps){
    //console.log('--- got new props');
    //const props = JSON.parse(JSON.stringify(nextProps));
    //props.selectedMenuIndex = localStorage && localStorage.getItem('selectedTab') || 0;
    this.setState(nextProps);
  }

  onMenuSelect(index){
    localStorage.setItem('selectedTab', index);
    this.setState({selectedMenuIndex: index});
  }

  render () {
    //console.log('--- render');
    const props = this.state;
    
    const flickityOptions = {
      // options
      initialIndex: this.state.selectedMenuIndex || 0,
      setGallerySize: false,
      dragThreshold: 50,
      prevNextButtons: false,
      pageDots: false,
      wrapAround: true,
      draggable: true,
      percentPosition: true
    }
    
    return (
      <div>
        <Menu
          items={['Debts', 'Totals', 'Assets']}
          selected={this.state.selectedMenuIndex}
          onSelect={this.onMenuSelect}
        />
        <Flickity
          className={ 'main-carousel' } 
          elementType={ 'div' } // default 'div' 
          options={ flickityOptions } // takes flickity options {} 
          disableImagesLoaded={ true } // default false
          reloadOnUpdate={false}
          onSwipe={this.onMenuSelect}
        >
            <Liabilities liabilities={this.state.liabilities}/>
            <Totals totals={this.state.totals}/>
            <Assets assets={this.state.assets}/>
        </Flickity>
      </div>
    );
  }
}

AppContainer.propTypes = {};

export default AppContainer;<commit_msg>react fragment, no parent element<commit_after>import React from 'react';

import Menu from './Menu';
import Liabilities from './Liabilities';
import Assets from './Assets';
import Totals from './Totals';

import Flickity from 'react-flickity-component/src/index';

class AppContainer extends React.Component {
  constructor(props, context){
    const p = JSON.parse(JSON.stringify(props));
    p.selectedMenuIndex = localStorage && localStorage.getItem('selectedTab') || 0;
    super(props, context);
    this.state = p;
    this.onMenuSelect = this.onMenuSelect.bind(this);
  }

  componentWillReceiveProps(nextProps){
    //console.log('--- got new props');
    //const props = JSON.parse(JSON.stringify(nextProps));
    //props.selectedMenuIndex = localStorage && localStorage.getItem('selectedTab') || 0;
    this.setState(nextProps);
  }

  onMenuSelect(index){
    localStorage.setItem('selectedTab', index);
    this.setState({selectedMenuIndex: index});
  }

  render () {
    //console.log('--- render');
    const props = this.state;
    
    const flickityOptions = {
      // options
      initialIndex: this.state.selectedMenuIndex || 0,
      setGallerySize: false,
      dragThreshold: 50,
      prevNextButtons: false,
      pageDots: false,
      wrapAround: true,
      draggable: true,
      percentPosition: true
    }
    
    return (
      <React.Fragment>
        <Menu
          items={['Debts', 'Totals', 'Assets']}
          selected={this.state.selectedMenuIndex}
          onSelect={this.onMenuSelect}
        />
        <Flickity
          className={ 'main-carousel' } 
          elementType={ 'div' } // default 'div' 
          options={ flickityOptions } // takes flickity options {} 
          disableImagesLoaded={ true } // default false
          reloadOnUpdate={false}
          onSwipe={this.onMenuSelect}
        >
            <Liabilities liabilities={this.state.liabilities}/>
            <Totals totals={this.state.totals}/>
            <Assets assets={this.state.assets}/>
        </Flickity>
      </React.Fragment>
    );
  }
}

AppContainer.propTypes = {};

export default AppContainer;
{'fraction_non_alphanumeric': 0.13315988647114474, 'fraction_numerical': 0.0023651844843897824, 'mean_word_length': 2.6741963509991313, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '4321967', 'n_tokens_mistral': 1244, 'n_tokens_neox': 1216, 'n_words': 253}