<commit_before>/* global window */

import React, { Component } from 'react';

import store from '../redux/store';
import i18n from '../config/i18n';
import { language, theme } from '../redux/action/showtime';
import amClass from './../util/amClass';

class Setting extends Component {
  constructor(props) {
    const state = store.getState();

    super(props);
    this.state = {
      language: state.language,
      theme: state.theme,
    };
  }

  componentDidMount() {
    this.unsubscribe = store.subscribe(() => {
      const state = store.getState();
      this.setState({ language: state.language, theme: state.theme });
    });
  }

  componentWillUnmount() {
    this.unsubscribe();
  }

  changeLanguage() {
    language(this.state.language === 'en' ? 'am' : 'en');
  }

  changeTheme() {
    theme(this.state.theme === 'night' ? 'light' : 'night');
  }

  open(url) {
    if (window.cordova && window.cordova.InAppBrowser) {
      window.cordova.InAppBrowser.open(encodeURI(url), '_system');
    }
  }

  render() {
    return (
      <div className="view-setting">
        <i className="icon-setting" />
        <button
          onClick={() => this.changeLanguage()}
          className={`btn ${amClass(this.state.language)}`}
        >
          { i18n[this.state.language].CHANGE_LANGUAGE }
        </button>
        <button
          onClick={() => this.changeTheme()}
          className={`btn ${amClass(this.state.language)}`}
        >
          { i18n[this.state.language].CHANGE_THEME }
        </button>
        <button
          onClick={() => this.open('mailto:<EMAIL>?subject=Feedback')}
          className={`btn btn-sm ${amClass(this.state.language)}`}
          style={{ marginTop: '2em' }}
        >
          { i18n[this.state.language].CONTACT }
        </button>
        <button
          onClick={() => this.open('https://github.com/moe-szyslak/showtime')}
          className={`btn btn-sm ${amClass(this.state.language)}`}
        >
          { i18n[this.state.language].SHOW_ME }
        </button>
      </div>
    );
  }
}

module.exports = Setting;<commit_msg>if they got mail, they got mail<commit_after>/* global window */

import React, { Component } from 'react';

import store from '../redux/store';
import i18n from '../config/i18n';
import { language, theme } from '../redux/action/showtime';
import amClass from './../util/amClass';

class Setting extends Component {
  constructor(props) {
    const state = store.getState();

    super(props);
    this.state = {
      language: state.language,
      theme: state.theme,
    };
  }

  componentDidMount() {
    this.unsubscribe = store.subscribe(() => {
      const state = store.getState();
      this.setState({ language: state.language, theme: state.theme });
    });
  }

  componentWillUnmount() {
    this.unsubscribe();
  }

  changeLanguage() {
    language(this.state.language === 'en' ? 'am' : 'en');
  }

  changeTheme() {
    theme(this.state.theme === 'night' ? 'light' : 'night');
  }

  open(url) {
    if (window.cordova && window.cordova.InAppBrowser) {
      window.cordova.InAppBrowser.open(encodeURI(url), '_system');
    }
  }

  render() {
    return (
      <div className="view-setting">
        <i className="icon-setting" />
        <button
          onClick={() => this.changeLanguage()}
          className={`btn ${amClass(this.state.language)}`}
        >
          { i18n[this.state.language].CHANGE_LANGUAGE }
        </button>
        <button
          onClick={() => this.changeTheme()}
          className={`btn ${amClass(this.state.language)}`}
        >
          { i18n[this.state.language].CHANGE_THEME }
        </button>
        <button
          onClick={() => this.open('mailto:<EMAIL>?subject=Feedback')}
          className={`btn ${amClass(this.state.language)}`}
          style={{ marginTop: '2em' }}
        >
          { i18n[this.state.language].CONTACT }
        </button>
      </div>
    );
  }
}

module.exports = Setting;
{'fraction_non_alphanumeric': 0.1719889363842092, 'fraction_numerical': 0.0060346995222529546, 'mean_word_length': 2.4145922746781117, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 34, 'https://': 1, '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': '2542967', 'n_tokens_mistral': 1254, 'n_tokens_neox': 1255, 'n_words': 216}