<commit_before>import React, { PropTypes } from 'react';
import Path from 'path';
import shell from 'shell';

import './ProductPage.css';
import Background from '../../Background';
import BrandTitle from '../../BrandTitle';
import Placemat from '../../Placemat';
import ProfileSummary from '../../ProfileSummary';
import Navigation from '../../Navigation';
import ContentText from '../../Text/ContentText';
import TitleText from '../../Text/TitleText';
import ErrorText from '../../Text/ErrorText';
import PageContent from '../../PageContent';
import ProductCard from '../ProductCard';
import ProductActionButtons from '../ProductActionButtons';

import ContentListItem from './ContentListItem/ContentListItem'
import StoreService from '../../../services/StoreService';

import InstallerStore from '../../../stores/InstallerStore';
import InstallerService from '../../../services/InstallerService';
import NotificationStore from '../../../stores/NotificationStore';
import StoreStore from '../../../stores/StoreStore';
import StateStore from '../../../stores/StateStore';
import StateService from '../../../services/StateService';
import ProductActions from '../../../actions/ProductActions';
import ProductStore from '../../../stores/ProductStore';

var State = require('react-router').State;

import mui from 'material-ui';
var ThemeManager = new mui.Styles.ThemeManager();
var List = mui.List;
var ListItem = mui.ListItem;
var CircularProgress = mui.CircularProgress;
var Card = mui.Card;
var CardHeader = mui.CardHeader;
var CardMedia = mui.CardMedia;
var CardTitle = mui.CardTitle;
var CardText = mui.CardText;
var RaisedButton = mui.RaisedButton;
var Paper = mui.Paper;
var LinearProgress = mui.LinearProgress;

const BYTES_PER_MB = 1048576;

export default class ProductPage extends React.Component {
  static mixins = [ State ];

  constructor(props) {
    super(props);

    this.props.id = props.params.id;

    ProductActions.loadProduct(this.props.id);

    this.state =
    {
      isBusy: false,
      error: this._getErrorMessage(),
    };
  }

  _getErrorMessage() {
    return NotificationStore.hasProductError();
  }

  _onChange() {
  }

  componentDidMount() {
    this.changeListener = this._onChange.bind(this);
    NotificationStore.addChangeListener(this.changeListener);
    StateStore.addChangeListener(this.changeListener);
    InstallerStore.addChangeListener(this.changeListener);
    ProductStore.addChangeListener(this.changeListener);
  }

  componentWillUnmount() {
    NotificationStore.removeChangeListener(this.changeListener);
    StateStore.removeChangeListener(this.changeListener);
    InstallerStore.removeChangeListener(this.changeListener);
    ProductStore.removeChangeListener(this.changeListener);
  }

  static childContextTypes = {
    muiTheme: React.PropTypes.object
  }

  getChildContext() {
    return {
      muiTheme: ThemeManager.getCurrentTheme()
    };
  }

  render() {
    const contentStyle = {
      height: this.state.height + "px"
    }

    const cardStyle = {
      height: this.props.cardHeight + "px",
      width: this.props.cardWidth + "px"
    }

    return (
      <div>
        <Background animate={false} />
        <Navigation currentPage='product' />
        <PageContent width={80} className="ProductPage">
          <div className="ProductPage-error">
            <ErrorText text={NotificationStore.productError} />
          </div>
          <div className="ProductPage-title">
            <TitleText text={ProductStore.product.name} size={6} level={2} className="ProductPage-h1"/>
            <TitleText text={ProductStore.publisher.name} link={ProductStore.publisher.externalUrl} level={3} className="ProductPage-h2 ProductPage-link"/>
          </div>
          <div className="ProductPage-content">
            <div className="ProductPage-contentLeft">
              <ProductCard imgSrc={ProductStore.product.imageUrl} width={this.props.cardWidth} height={this.props.cardHeight} />
            </div>
            <div className="ProductPage-contentSpacer" />
            <div className="ProductPage-contentRight">
              <ProductActionButtons />
              <Placemat width={this.props.buttonWidth} className="ProductPage-descriptionContainer">
                <div className="ProductPage-description">
                  <ContentText enableMarkdown={true} text={ProductStore.product.description} />
                </div>
              </Placemat>
            </div>
          </div>
        </PageContent>
      </div>
    );
  }
}

ProductPage.propTypes = {<commit_msg>show content description isntead of product<commit_after>import React, { PropTypes } from 'react';
import Path from 'path';
import shell from 'shell';

import './ProductPage.css';
import Background from '../../Background';
import BrandTitle from '../../BrandTitle';
import Placemat from '../../Placemat';
import ProfileSummary from '../../ProfileSummary';
import Navigation from '../../Navigation';
import ContentText from '../../Text/ContentText';
import TitleText from '../../Text/TitleText';
import ErrorText from '../../Text/ErrorText';
import PageContent from '../../PageContent';
import ProductCard from '../ProductCard';
import ProductActionButtons from '../ProductActionButtons';

import ContentListItem from './ContentListItem/ContentListItem'
import StoreService from '../../../services/StoreService';

import InstallerStore from '../../../stores/InstallerStore';
import InstallerService from '../../../services/InstallerService';
import NotificationStore from '../../../stores/NotificationStore';
import StoreStore from '../../../stores/StoreStore';
import StateStore from '../../../stores/StateStore';
import StateService from '../../../services/StateService';
import ProductActions from '../../../actions/ProductActions';
import ProductStore from '../../../stores/ProductStore';

var State = require('react-router').State;

import mui from 'material-ui';
var ThemeManager = new mui.Styles.ThemeManager();
var List = mui.List;
var ListItem = mui.ListItem;
var CircularProgress = mui.CircularProgress;
var Card = mui.Card;
var CardHeader = mui.CardHeader;
var CardMedia = mui.CardMedia;
var CardTitle = mui.CardTitle;
var CardText = mui.CardText;
var RaisedButton = mui.RaisedButton;
var Paper = mui.Paper;
var LinearProgress = mui.LinearProgress;

const BYTES_PER_MB = 1048576;

export default class ProductPage extends React.Component {
  static mixins = [ State ];

  constructor(props) {
    super(props);

    this.props.id = props.params.id;

    ProductActions.loadProduct(this.props.id);

    this.state =
    {
      isBusy: false,
      error: this._getErrorMessage(),
    };
  }

  _getErrorMessage() {
    return NotificationStore.hasProductError();
  }

  _onChange() {
  }

  componentDidMount() {
    this.changeListener = this._onChange.bind(this);
    NotificationStore.addChangeListener(this.changeListener);
    StateStore.addChangeListener(this.changeListener);
    InstallerStore.addChangeListener(this.changeListener);
    ProductStore.addChangeListener(this.changeListener);
  }

  componentWillUnmount() {
    NotificationStore.removeChangeListener(this.changeListener);
    StateStore.removeChangeListener(this.changeListener);
    InstallerStore.removeChangeListener(this.changeListener);
    ProductStore.removeChangeListener(this.changeListener);
  }

  static childContextTypes = {
    muiTheme: React.PropTypes.object
  }

  getChildContext() {
    return {
      muiTheme: ThemeManager.getCurrentTheme()
    };
  }

  render() {
    const contentStyle = {
      height: this.state.height + "px"
    }

    const cardStyle = {
      height: this.props.cardHeight + "px",
      width: this.props.cardWidth + "px"
    }

    return (
      <div>
        <Background animate={false} />
        <Navigation currentPage='product' />
        <PageContent width={80} className="ProductPage">
          <div className="ProductPage-error">
            <ErrorText text={NotificationStore.productError} />
          </div>
          <div className="ProductPage-title">
            <TitleText text={ProductStore.product.name} size={6} level={2} className="ProductPage-h1"/>
            <TitleText text={ProductStore.publisher.name} link={ProductStore.publisher.externalUrl} level={3} className="ProductPage-h2 ProductPage-link"/>
          </div>
          <div className="ProductPage-content">
            <div className="ProductPage-contentLeft">
              <ProductCard imgSrc={ProductStore.product.imageUrl} width={this.props.cardWidth} height={this.props.cardHeight} />
            </div>
            <div className="ProductPage-contentSpacer" />
            <div className="ProductPage-contentRight">
              <ProductActionButtons />
              <Placemat width={this.props.buttonWidth} className="ProductPage-descriptionContainer">
                <div className="ProductPage-description">
                  <ContentText enableMarkdown={true} text={ProductStore.content.description} />
                </div>
              </Placemat>
            </div>
          </div>
        </PageContent>
      </div>
    );
  }
}

ProductPage.propTypes = {
{'fraction_non_alphanumeric': 0.13761467889908258, 'fraction_numerical': 0.0030581039755351682, 'mean_word_length': 3.2198156682027648, 'pattern_counts': {'":': 0, '<': 57, '<?xml version=': 0, '>': 57, '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': '1684886', 'n_tokens_mistral': 2488, 'n_tokens_neox': 2469, 'n_words': 525}