<commit_before>var React = require('react');
var ReactDOM = require('react-dom');
var PropTypes = require('prop-types');
var createReactClass = require('create-react-class');
var NavActions = require('../actions/NavActions');
var Toggle = require('react-toggle').default;
var CopticCalendar = require('../lib/CopticCalendar.js');
var SingleDatePicker = require('react-dates').SingleDatePicker;
var NavStore = require('../stores/NavStore');
var NavActions = require('../actions/NavActions');
var SectionActions = require('../actions/SectionActions');

var classNames = require('classnames');

var NavSubMenuItem = createReactClass({

  propTypes: {
    navMenuItemId: PropTypes.string.isRequired,
    attributes: PropTypes.object.isRequired
  },

  getInitialState: function () {
    var year = this.props.attributes.year;
    var day = this.props.attributes.day;
    var monthIndex = this.props.attributes.monthIndex;
    return {
      inputDate: this.props.attributes.todayDate,
      inputCopticDate: CopticCalendar.getCopticDateString(year, monthIndex, day)
    }
  },

  render: function () {
    var year = this.props.attributes.year;
    var day = this.props.attributes.day;
    var monthIndex = this.props.attributes.monthIndex;
    var navMenuItemId = this.props.navMenuItemId;
    var thisState = this;
    //var inputCopticDate = CopticCalendar.getCopticDateString(year, monthIndex, day);
    switch (navMenuItemId) {
      case "date":
        return (
          <div className="nav-sub-menu-item date">
            <div>
              <label>{this.state.inputCopticDate}</label>
            </div>
            <div>
              <SingleDatePicker
                date={thisState.state.inputDate} // momentPropTypes.momentObj or null
                onDateChange={function (date) { thisState.handleDateInput(date) }} // PropTypes.func.isRequired
                focused={thisState.state.focused} // PropTypes.bool
                onFocusChange={function (objFocused) {
                  // if side menu is open on mobile, close it
                  if (!NavStore.getToggleState()) {
                    NavActions.toggleMenu();
                  }
                  thisState.setState({focused: objFocused.focused});
                }
                } // PropTypes.func.isRequired
                enableOutsideDays={true}
                isOutsideRange={function () { false }}
                numberOfMonths={1}
                withPortal={true}
              />
            </div>
          </div>
        );
      case "theme":
        return (
          <div className="nav-sub-menu-item">
            <div className="checkbox">
              <Toggle defaultChecked={this.props.attributes.lightThemeCheckbox}
                onChange={this.handleLightThemeCheckbox} aria-label="..." />
              <label>Light Theme</label>
            </div>
          </div>
        );
      case "mode":
        return (
          <div className="nav-sub-menu-item">
            <div className="checkbox">
              <Toggle defaultChecked={this.props.attributes.presentationModeCheckbox}
                onChange={this.handlePresentationModeCheckbox} aria-label="..." />
              <label>{this.props.attributes.presentationModeCheckbox ? "On" : "Off"}</label>
            </div>
          </div>
        );<commit_msg>revert code change that caused Coptic date not to be changed<commit_after>var React = require('react');
var ReactDOM = require('react-dom');
var PropTypes = require('prop-types');
var createReactClass = require('create-react-class');
var NavActions = require('../actions/NavActions');
var Toggle = require('react-toggle').default;
var CopticCalendar = require('../lib/CopticCalendar.js');
var SingleDatePicker = require('react-dates').SingleDatePicker;
var NavStore = require('../stores/NavStore');
var NavActions = require('../actions/NavActions');
var SectionActions = require('../actions/SectionActions');

var classNames = require('classnames');

var NavSubMenuItem = createReactClass({

  propTypes: {
    navMenuItemId: PropTypes.string.isRequired,
    attributes: PropTypes.object.isRequired
  },

  getInitialState: function () {
    var year = this.props.attributes.year;
    var day = this.props.attributes.day;
    var monthIndex = this.props.attributes.monthIndex;
    return {
      inputDate: this.props.attributes.todayDate,
      inputCopticDate: CopticCalendar.getCopticDateString(year, monthIndex, day)
    }
  },

  render: function () {
    var year = this.props.attributes.year;
    var day = this.props.attributes.day;
    var monthIndex = this.props.attributes.monthIndex;
    var navMenuItemId = this.props.navMenuItemId;
    var thisState = this;
    var inputCopticDate = CopticCalendar.getCopticDateString(year, monthIndex, day);
    switch (navMenuItemId) {
      case "date":
        return (
          <div className="nav-sub-menu-item date">
            <div>
              <label>{inputCopticDate}</label>
            </div>
            <div>
              <SingleDatePicker
                date={thisState.state.inputDate}
                onDateChange={function (date) { thisState.handleDateInput(date) }}
                focused={thisState.state.focused}
                onFocusChange={function (objFocused) {
                  // if side menu is open on mobile, close it
                  if (!NavStore.getToggleState()) {
                    NavActions.toggleMenu();
                  }
                  thisState.setState({focused: objFocused.focused});
                  }
                }
                enableOutsideDays={true}
                isOutsideRange={function () { false }}
                numberOfMonths={1}
                withPortal={true}
              />
            </div>
          </div>
        );
      case "theme":
        return (
          <div className="nav-sub-menu-item">
            <div className="checkbox">
              <Toggle defaultChecked={this.props.attributes.lightThemeCheckbox}
                onChange={this.handleLightThemeCheckbox} aria-label="..." />
              <label>Light Theme</label>
            </div>
          </div>
        );
      case "mode":
        return (
          <div className="nav-sub-menu-item">
            <div className="checkbox">
              <Toggle defaultChecked={this.props.attributes.presentationModeCheckbox}
                onChange={this.handlePresentationModeCheckbox} aria-label="..." />
              <label>{this.props.attributes.presentationModeCheckbox ? "On" : "Off"}</label>
            </div>
          </div>
        );
{'fraction_non_alphanumeric': 0.12448762714437528, 'fraction_numerical': 0.0003036283588887202, 'mean_word_length': 2.2089624939113492, 'pattern_counts': {'":': 6, '<': 49, '<?xml version=': 0, '>': 49, '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': '4538301', 'n_tokens_mistral': 1776, 'n_tokens_neox': 1721, 'n_words': 328}