<commit_before>import React, {Component, PropTypes} from 'react'
import {connect} from 'react-redux'
import Card from '../containers/Card'
import {getPageTitle, getPageIngress} from '../../lib/regionUtil'
//import * as ImdiPropTypes from '../proptypes/ImdiPropTypes'

class FactsPage extends Component {
  static propTypes = {
    region: PropTypes.object,
    cardsPages: PropTypes.object,
    cardPagesData: PropTypes.object
  };

  static contextTypes = {
    linkTo: PropTypes.func,
    goTo: PropTypes.func
  };

  render() {
    const {region, cardsPages} = this.props

    const regionPageLink = this.context.linkTo('/tall-og-statistikk/steder/:region/', {region: region.prefixedCode})

    return (
      <div>
        <div className="page__content page__content--section">
          <div className="wrapper">
            <div className="row">
              <div className="col--main-wide">
                <header id="page-header" className="t-no-focus" tabIndex="-1">
                  <h1>{getPageTitle(region, 'Faktaark for')}</h1>
                  <p className="ingress">{getPageIngress(region)}</p>
                  <p className="t-margin-bottom--large t-hide-on-print">
                    <a href={regionPageLink} className="button button--secondary">
                      <i className="icon__arrow-left" /> Tilbake til oppsummering
                    </a>
                  </p>
                </header>
              </div>
            </div>
          </div>
        </div>

        <div className="page__section">
          <div className="wrapper">
            <div className="row">
              <div className="col--main">
                {cardsPages.map(cardsPage => {
                  return (
                    <div key={cardsPage.name}>
                      <h2 className="feature__section-title">{cardsPage.title} i {region.name}</h2>
                      <ul className="t-no-list-styles">
                        {cardsPage.cards.map(card => {
                          return (
                            <li key={card.name}>
                              <div className="toggle-list">
                                <h3 className="toggle-list__button-title">{card.title}</h3>
                                <Card
                                  region={region}
                                  card={card}
                                  cardsPageName={cardsPage.name}
                                  printable
                                />
                              </div>
                            </li>
                          )
                        })}
                      </ul>
                    </div>
                  )
                })}
              </div>
            </div>
          </div>
        </div>
      </div>
    )
  }
}

function mapStateToProps(state) {

  return {
    cardsPages: state.allCardsPages,
    region: state.currentRegion
  }
}

export default connect(mapStateToProps)(FactsPage)
<commit_msg>Minor fix: Updated invalid proptype on factspage<commit_after>import React, {Component, PropTypes} from 'react'
import {connect} from 'react-redux'
import Card from '../containers/Card'
import {getPageTitle, getPageIngress} from '../../lib/regionUtil'
//import * as ImdiPropTypes from '../proptypes/ImdiPropTypes'

class FactsPage extends Component {
  static propTypes = {
    region: PropTypes.object,
    cardsPages: PropTypes.array,
    cardPagesData: PropTypes.object
  };

  static contextTypes = {
    linkTo: PropTypes.func,
    goTo: PropTypes.func
  };

  render() {
    const {region, cardsPages} = this.props

    const regionPageLink = this.context.linkTo('/tall-og-statistikk/steder/:region/', {region: region.prefixedCode})

    return (
      <div>
        <div className="page__content page__content--section">
          <div className="wrapper">
            <div className="row">
              <div className="col--main-wide">
                <header id="page-header" className="t-no-focus" tabIndex="-1">
                  <h1>{getPageTitle(region, 'Faktaark for')}</h1>
                  <p className="ingress">{getPageIngress(region)}</p>
                  <p className="t-margin-bottom--large t-hide-on-print">
                    <a href={regionPageLink} className="button button--secondary">
                      <i className="icon__arrow-left" /> Tilbake til oppsummering
                    </a>
                  </p>
                </header>
              </div>
            </div>
          </div>
        </div>

        <div className="page__section">
          <div className="wrapper">
            <div className="row">
              <div className="col--main">
                {cardsPages.map(cardsPage => {
                  return (
                    <div key={cardsPage.name}>
                      <h2 className="feature__section-title">{cardsPage.title} i {region.name}</h2>
                      <ul className="t-no-list-styles">
                        {cardsPage.cards.map(card => {
                          return (
                            <li key={card.name}>
                              <div className="toggle-list">
                                <h3 className="toggle-list__button-title">{card.title}</h3>
                                <Card
                                  region={region}
                                  card={card}
                                  cardsPageName={cardsPage.name}
                                  printable
                                />
                              </div>
                            </li>
                          )
                        })}
                      </ul>
                    </div>
                  )
                })}
              </div>
            </div>
          </div>
        </div>
      </div>
    )
  }
}

function mapStateToProps(state) {

  return {
    cardsPages: state.allCardsPages,
    region: state.currentRegion
  }
}

export default connect(mapStateToProps)(FactsPage)

{'fraction_non_alphanumeric': 0.12073534282875124, 'fraction_numerical': 0.0023186485591255384, 'mean_word_length': 1.297071129707113, 'pattern_counts': {'":': 0, '<': 87, '<?xml version=': 0, '>': 91, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3196775', 'n_tokens_mistral': 1595, 'n_tokens_neox': 1538, 'n_words': 288}