<commit_before>import CampaignController from '../campaign/Controller';
import CampaignSignupCard from './CampaignSignupCard';

const React = require('react');

/**
 * CampaignSlide Component
 * <CampaignSlide />
 */
class CampaignSlide extends React.Component {
  constructor(props) {
    super(props);

    this.controller = new CampaignController();
    this.campaigns = [];
  }

  componentDidMount() {
    const args = {
      'isStaffPick': true,
      'removeDuplicateResults': true,
      'sortByRelevance': true,
      'removeSignups': true
    };

    this.controller.getCampaigns(args).then(campaigns => {
      this.campaigns = campaigns.splice(0, 3); // Grab the first 3 campaigns returned
      this.forceUpdate();
    });
  }

  render() {
    return (
      <div className={`slideshow__slide ${this.props.isActive ? '-active fade-in': ''}`}>
        <div className="container">
          <div className="wrapper">
            {this.renderHeader()}

            <div className="gallery -triad">
              {this.campaigns.map(campaign => {
                // Fix for local files / data missing by preventing null error
                const image_uri = campaign.cover_image.default != null ? campaign.cover_image.default.sizes.landscape.uri : '';

                const props = {
                  id: campaign.id,
                  image_uri: image_uri,
                  tagline: campaign.tagline,
                  title: campaign.title,
                  signup: this.controller.signup.bind(this.controller)
                }

                return <CampaignSignupCard {...props} key={campaign.id} />
              })}
            </div>
          </div>
        </div>
      </div>
    )
  }

  renderHeader() {
    return (
      <div className="container__block">
        <h2 className="heading -gamma">Woohoo! You're signed up.</h2>
        <p>As a DoSomething.org member, you're part of something bigger. You're part of a global movement for good.</p>

        <p>You'll get all the tools you need to create impact. You've already joined {this.props.campaign.title}. Now sign up for other popular campaigns!</p><commit_msg>Appends campaigns array to state<commit_after>import CampaignController from '../campaign/Controller';
import CampaignSignupCard from './CampaignSignupCard';

const React = require('react');

/**
 * CampaignSlide Component
 * <CampaignSlide />
 */
class CampaignSlide extends React.Component {
  constructor(props) {
    super(props);

    this.setState({
      campaigns: []
    });

    this.controller = new CampaignController();
    this.campaigns = [];
  }

  componentDidMount() {
    const args = {
      'isStaffPick': true,
      'removeDuplicateResults': true,
      'sortByRelevance': true,
      'removeSignups': true
    };

    this.controller.getCampaigns(args).then(campaigns => {
      this.setState({
        campaigns: campaigns.splice(0, 3) // Grab the first 3 campaigns returned
      });
    });
  }

  render() {
    return (
      <div className={`slideshow__slide ${this.props.isActive ? '-active fade-in': ''}`}>
        <div className="container">
          <div className="wrapper">
            {this.renderHeader()}

            <div className="gallery -triad">
              {this.state.campaigns.map(campaign => {
                // Fix for local files / data missing by preventing null error
                const image_uri = campaign.cover_image.default != null ? campaign.cover_image.default.sizes.landscape.uri : '';

                const props = {
                  id: campaign.id,
                  image_uri: image_uri,
                  tagline: campaign.tagline,
                  title: campaign.title,
                  signup: this.controller.signup.bind(this.controller)
                }

                return <CampaignSignupCard {...props} key={campaign.id} />
              })}
            </div>
          </div>
        </div>
      </div>
    )
  }

  renderHeader() {
    return (
      <div className="container__block">
        <h2 className="heading -gamma">Woohoo! You're signed up.</h2>
        <p>As a DoSomething.org member, you're part of something bigger. You're part of a global movement for good.</p>

        <p>You'll get all the tools you need to create impact. You've already joined {this.props.campaign.title}. Now sign up for other popular campaigns!</p>
{'fraction_non_alphanumeric': 0.12337217272104181, 'fraction_numerical': 0.002284669865204478, 'mean_word_length': 2.184, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 41, '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': '3405036', 'n_tokens_mistral': 1246, 'n_tokens_neox': 1175, 'n_words': 295}