<commit_before>import React, { Component } from 'react';
import {
  HashRouter,
  Route,
} from 'react-router-dom';
import { Helmet } from 'react-helmet';

import { Confirmer } from './utils/getUserConfirmation';

import HomePage from './containers/HomePage';
import AboutPage from './containers/AboutPage';
import VisitPage from './containers/VisitPage';

import Footer from './components/Footer';
import Header from './components/Header';

// LOCALIZATION
import { getTextForLanguage } from './utils/getTextForLanguage';

// Change HashRouter tags below to Router tags to turn off hash routing; only used to be compatible with GitHub Pages
class App extends Component {
  constructor (props) {
    super(props);
    this.state = { langCode: 'en', snippets: getTextForLanguage('en') };
  }

  setLanguage = (inputProps) => {
    var snippets = getTextForLanguage(inputProps.value);
    this.setState({ language: inputProps.value, snippets: snippets });
  };

  render () {
    var { langCode, snippets } = this.state;

    // Confirms user navigation
    var confirmer = new Confirmer();

    return (
      <div id='App'>
        <Helmet>
          <html lang={ langCode } />
        </Helmet>

        <HashRouter getUserConfirmation={ confirmer.getConfirmation }>
          <div id='HashRouter'>
            <Route
              path="/:rest+"
              component={ (props) => {
                return (
                  <Header
                    { ...props }
                    snippets={{ ...snippets.header, langCode: snippets.langCode }} />);
              } } />
            <Route
              exact
              path="/"
              component={ (props) => {
                return (
                  <HomePage
                    { ...props }
                    snippets={{ ...snippets.homePage, langCode: snippets.langCode }} />);
              } } />
            <Route
              path="/about"
              component={ (props) => {
                return (
                  <AboutPage
                    { ...props }
                    snippets={{ ...snippets.aboutPage, langCode: snippets.langCode }} />);
              } } />
            <Route
              path="/visit/:clientId/:visitId"
              component={ (props) => {
                return (
                  <VisitPage
                    { ...props }
                    confirmer = { confirmer }
                    snippets  = {{ ...snippets.visitPage, langCode: snippets.langCode }} />);
              } } />
            <Route
              path="/visit/load"
              component={ (props) => {
                return (
                  <VisitPage
                    { ...props }
                    confirmer = { confirmer }
                    snippets  = {{ ...snippets.visitPage, langCode: snippets.langCode }} />);
              } } />
            <Route
              path="/load"
              component={ (props) => {
                return (
                  <VisitPage
                    { ...props }
                    confirmer = { confirmer }
                    snippets  = {{ ...snippets.visitPage, langCode: snippets.langCode }} />);
              } } />
              
            {/* Currently only works on published build */}
            <Route
              path="/docs"
              component={
                <iframe
                  id="docsFrame"
                  title="Cliff Effects Docs"
                  src="/docs/index.html" />
              } />
          </div>
        </HashRouter>
        <Footer snippets={{ ...snippets.footer, langCode: snippets.langCode }} />
      </div>
    );
  }
}

export default App;<commit_msg>Change component of Route to a function to elminiate warning<commit_after>import React, { Component } from 'react';
import {
  HashRouter,
  Route,
} from 'react-router-dom';
import { Helmet } from 'react-helmet';

import { Confirmer } from './utils/getUserConfirmation';

import HomePage from './containers/HomePage';
import AboutPage from './containers/AboutPage';
import VisitPage from './containers/VisitPage';

import Footer from './components/Footer';
import Header from './components/Header';

// LOCALIZATION
import { getTextForLanguage } from './utils/getTextForLanguage';

// Change HashRouter tags below to Router tags to turn off hash routing; only used to be compatible with GitHub Pages
class App extends Component {
  constructor (props) {
    super(props);
    this.state = { langCode: 'en', snippets: getTextForLanguage('en') };
  }

  setLanguage = (inputProps) => {
    var snippets = getTextForLanguage(inputProps.value);
    this.setState({ language: inputProps.value, snippets: snippets });
  };

  render () {
    var { langCode, snippets } = this.state;

    // Confirms user navigation
    var confirmer = new Confirmer();

    return (
      <div id='App'>
        <Helmet>
          <html lang={ langCode } />
        </Helmet>

        <HashRouter getUserConfirmation={ confirmer.getConfirmation }>
          <div id='HashRouter'>
            <Route
              path="/:rest+"
              component={ (props) => {
                return (
                  <Header
                    { ...props }
                    snippets={{ ...snippets.header, langCode: snippets.langCode }} />);
              } } />
            <Route
              exact
              path="/"
              component={ (props) => {
                return (
                  <HomePage
                    { ...props }
                    snippets={{ ...snippets.homePage, langCode: snippets.langCode }} />);
              } } />
            <Route
              path="/about"
              component={ (props) => {
                return (
                  <AboutPage
                    { ...props }
                    snippets={{ ...snippets.aboutPage, langCode: snippets.langCode }} />);
              } } />
            <Route
              path="/visit/:clientId/:visitId"
              component={ (props) => {
                return (
                  <VisitPage
                    { ...props }
                    confirmer = { confirmer }
                    snippets  = {{ ...snippets.visitPage, langCode: snippets.langCode }} />);
              } } />
            <Route
              path="/visit/load"
              component={ (props) => {
                return (
                  <VisitPage
                    { ...props }
                    confirmer = { confirmer }
                    snippets  = {{ ...snippets.visitPage, langCode: snippets.langCode }} />);
              } } />
            <Route
              path="/load"
              component={ (props) => {
                return (
                  <VisitPage
                    { ...props }
                    confirmer = { confirmer }
                    snippets  = {{ ...snippets.visitPage, langCode: snippets.langCode }} />);
              } } />

            {/* Currently only works on published build */}
            <Route
              path="/docs"
              component={ () => {
                return (
                  <iframe
                    id="docsFrame"
                    title="Cliff Effects Docs"
                    src="/docs/index.html" />);
              } } />
          </div>
        </HashRouter>
        <Footer snippets={{ ...snippets.footer, langCode: snippets.langCode }} />
      </div>
    );
  }
}

export default App;
{'fraction_non_alphanumeric': 0.12842926304464766, 'fraction_numerical': 0.0, 'mean_word_length': 1.3153798256537983, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 0, '>': 66, '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': '6012697', 'n_tokens_mistral': 1987, 'n_tokens_neox': 1853, 'n_words': 427}