<commit_before>EC.PremiumBannerBuilder = React.createClass({

  stateSpecificComponents: function() {
    if (this.props.state === null){
      return <EC.LoadingIndicator/>;
    }
    else if (this.props.state == 'none'){
        return(<EC.FreeTrialBanner/>);
    }
    else if (this.props.daysLeft == 30){
      return(<EC.NewSignUpBanner/>);
    }
    else if ((this.props.state == 'trial') || (this.props.state == 'locked')){
        return(<EC.FreeTrialStatus status={this.props.state} data={this.props.daysLeft}/>);
    }
  },

  stateSpecificBackGroundColor: function() {
    if (this.props.daysLeft == 30){
      return('#d0ffc6');
    } else {
      return('#ffe7c0');
    }
  },

  stateSpecificBackGroundImage: function() {
    if (this.props.daysLeft == 30){
      return('none');
    } else {
      return('url(/images/star_pattern_5.png)');
    }
  },

  render: function() {
    var color = this.stateSpecificBackGroundColor();
    var img = this.stateSpecificBackGroundImage();
    var divStyle = {
      backgroundColor: color,
      backgroundImage: img
    };
    return (
      <div id='premium-banner' style={divStyle}>
        <div className='container'>
          {this.stateSpecificComponents()}
        </div>
      </div>
    );
  }

});<commit_msg>adds exception for when user already has premium<commit_after>EC.PremiumBannerBuilder = React.createClass({

  stateSpecificComponents: function() {
    if (this.props.state === null){
      return <EC.LoadingIndicator/>;
    }
    else if (this.props.state == 'none'){
        return(<EC.FreeTrialBanner/>);
    }
    else if (this.props.daysLeft == 30){
      return(<EC.NewSignUpBanner/>);
    }
    else if ((this.props.state == 'trial') || (this.props.state == 'locked')){
        return(<EC.FreeTrialStatus status={this.props.state} data={this.props.daysLeft}/>);
    }
  },

  stateSpecificBackGroundColor: function() {
    if (this.props.daysLeft == 30){
      return('#d0ffc6');
    } else {
      return('#ffe7c0');
    }
  },

  stateSpecificBackGroundImage: function() {
    if (this.props.daysLeft == 30){
      return('none');
    } else {
      return('url(/images/star_pattern_5.png)');
    }
  },

  hasPremium: function() {
  if ((this.props.state === 'school') || (this.props.state === 'paid')) {
    return (<span/>);
  } else {
    var color = this.stateSpecificBackGroundColor();
    var img = this.stateSpecificBackGroundImage();
    var divStyle = {
      backgroundColor: color,
      backgroundImage: img
    };
    return (
      <div id='premium-banner' style={divStyle}>
        <div className='container'>
          {this.stateSpecificComponents()}
        </div>
      </div>
    );
  }
},

  render: function() {
    return (this.hasPremium());

  }

});
{'fraction_non_alphanumeric': 0.16871832005792903, 'fraction_numerical': 0.007965242577842143, 'mean_word_length': 2.759183673469388, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 20, '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': '6818566', 'n_tokens_mistral': 933, 'n_tokens_neox': 881, 'n_words': 153}