<commit_before>import React from 'react';
import { Link } from 'routes';
import CompoundMenu from 'components/ui/CompoundMenu';
import Carousel from 'components/ui/Carousel';
import { getPartners } from 'redactions/partners';
import { initStore } from 'store';
import withRedux from 'next-redux-wrapper';

const data = [
  { name: 'Data' },
  { name: 'Explore Datasets', route: 'explore' },
  { name: 'Dashboards', route: 'dashboards' },
  { name: 'Planet Pulse', route: 'pulse' }
];

const about = [
  { name: 'About', route: 'about' },
  { name: 'Partners', route: 'about_partners' }
];

const insights = [
  { name: 'Insights', route: 'insights' },
  { name: 'Recent insights' },
  { name: 'Highlighted insights' }
];

const getInvolved = [
  { name: 'Get involved', route: 'get_involved' },
  { name: 'Submit an insight', route: 'get_involved_detail', params: { id: 'submit-an-insight' } },
  { name: 'Contribute data', route: 'get_involved_detail', params: { id: 'contribute-data' } },
  { name: 'Join the community', route: 'get_involved_detail', params: { id: 'join-community' } }
];

class Footer extends React.Component {

  componentWillMount() {
    this.props.getPartners();
  }

  setPartnersList() {
    const featured = this.props.list.filter(p => p.attributes.featured);
    const baseURL = process.env.CMS_API_URL.slice(0, process.env.CMS_API_URL.length - 4);

    return featured.map(p => (
      <div key={p.id} className="item">
        <Link route="partner" params={{ id: p.id }}>
          <a>
            <img className="-img" src={`${baseURL}${p.attributes.logo.thumb}`} alt={p.attributes.name} />
          </a>
        </Link>
      </div>
    ));
  }

  render() {
    const menuData = [data, about, insights, getInvolved];
    const items = this.setPartnersList();

    return (
      <footer className="c-footer">
        <div className="footer-intro">
          <h1 className="title"><Link to="/about/partners"><a>Partners</a></Link></h1>
          <div className="partners row">
            <div className="column small-12">
              {items.length ? <Carousel items={items} /> : ''}
            </div>
          </div>
        </div>

        <div className="footer-main">
          <CompoundMenu items={menuData} />
        </div>

        <div className="footer-terms">
          <div className="l-container">
            <div className="terms">
              <p>Terms of Service — Privacy</p>
              <p>© 2017 - Resource Watch</p>
            </div>
          </div>
        </div>
      </footer>
    );
  }
}

Footer.propTypes = {
  getPartners: React.PropTypes.func,
  list: React.PropTypes.array
};

const mapStateToProps = state => ({
  list: state.partners.list
});

const mapDispatchToProps = dispatch => ({
  getPartners: () => { dispatch(getPartners()); }
});

export default withRedux(initStore, mapStateToProps, mapDispatchToProps)(Footer);<commit_msg>fixing footer layout<commit_after>import React from 'react';
import { Link } from 'routes';
import CompoundMenu from 'components/ui/CompoundMenu';
import Carousel from 'components/ui/Carousel';
import { getPartners } from 'redactions/partners';
import { initStore } from 'store';
import withRedux from 'next-redux-wrapper';

const data = [
  { name: 'Data' },
  { name: 'Explore Datasets', route: 'explore' },
  { name: 'Dashboards', route: 'dashboards' },
  { name: 'Planet Pulse', route: 'pulse' }
];

const about = [
  { name: 'About', route: 'about' },
  { name: 'Partners', route: 'about_partners' }
];

const insights = [
  { name: 'Insights', route: 'insights' },
  { name: 'Recent insights' },
  { name: 'Highlighted insights' }
];

const getInvolved = [
  { name: 'Get involved', route: 'get_involved' },
  { name: 'Submit an insight', route: 'get_involved_detail', params: { id: 'submit-an-insight' } },
  { name: 'Contribute data', route: 'get_involved_detail', params: { id: 'contribute-data' } },
  { name: 'Join the community', route: 'get_involved_detail', params: { id: 'join-community' } }
];

class Footer extends React.Component {

  componentWillMount() {
    this.props.getPartners();
  }

  setPartnersList() {
    const featured = this.props.list.filter(p => p.attributes.featured);
    const baseURL = process.env.CMS_API_URL.slice(0, process.env.CMS_API_URL.length - 4);

    return featured.map(p => (
      <div key={p.id} className="item">
        <Link route="partner" params={{ id: p.id }}>
          <a>
            <img className="-img" src={`${baseURL}${p.attributes.logo.thumb}`} alt={p.attributes.name} />
          </a>
        </Link>
      </div>
    ));
  }

  render() {
    const menuData = [data, about, insights, getInvolved];
    const items = this.setPartnersList();

    return (
      <footer className="c-footer">
        <div className="footer-intro">
          <h1 className="title"><Link to="/about/partners"><a>Partners</a></Link></h1>
          <div className="partners row">
            <div className="column small-12">
              {items.length ? <Carousel items={items} /> : ''}
            </div>
          </div>
        </div>

        <div className="footer-main">
          <CompoundMenu items={menuData} />
        </div>

        <div className="footer-terms">
          <div className="l-container">
            <div className="l-row">
              <div className="terms column">
                <p>Terms of Service — Privacy</p>
                <p>© 2017 - Resource Watch</p>
              </div>
            </div>
          </div>
        </div>
      </footer>
    );
  }
}

Footer.propTypes = {
  getPartners: React.PropTypes.func,
  list: React.PropTypes.array
};

const mapStateToProps = state => ({
  list: state.partners.list
});

const mapDispatchToProps = dispatch => ({
  getPartners: () => { dispatch(getPartners()); }
});

export default withRedux(initStore, mapStateToProps, mapDispatchToProps)(Footer);
{'fraction_non_alphanumeric': 0.16810856658184903, 'fraction_numerical': 0.0033927056827820186, 'mean_word_length': 2.876397107166338, 'pattern_counts': {'":': 0, '<': 75, '<?xml version=': 0, '>': 85, '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': '6251143', 'n_tokens_mistral': 1939, 'n_tokens_neox': 1883, 'n_words': 423}