<commit_before>import React, { Component } from 'react';
import { Link } from 'react-router'
import auth from './Auth';
import '../css/app.css';
class App extends Component {

	constructor(props) {
		super(props);
		this.state = {
			isAuthenticated: false,
			user: {},
			isAdmin: false
		};
		// this.getProfileData= this.getProfileData.bind(this);
	}

	componentWillMount() {
		auth.getUserData((data) => {
			this.setState({
				'isAuthenticated': data.isAuthenticated,
				'user': data.user,
				'isAdmin': data.isAdmin
			})
		});
	}

	renderAdminLink() {

		if (this.state.isAdmin) {

			return (
				<div className="col-xs-3">
					<Link to="/admin/product">Add Product</Link>
				</div>
			);
		}
		return '';
	}



	render() {
		let adminLink = this.renderAdminLink();
		let  dat= this;
		var children = React.Children.map(this.props.children, function (child) {
			return React.cloneElement(child, {
				userData: dat.state.user 
			});
		});
		return (
			<div className="wrapper container-fluid">
				<div className="row nav">
					<div className="col-xs-9">
						<h1 id="main-title">iStore</h1>
					</div>
					<div className="col-xs-1">
						{this.state.isAuthenticated ? <Link to="/basket">Basket</Link> : ''}
					</div>
					<div className="col-xs-1">
						{!this.state.isAuthenticated ? <Link to="/register">Register</Link> : <Link to="/profile">Profile</Link>}
					</div>
					<div className="col-xs-1">
						{!this.state.isAuthenticated ? <Link to="/login">Login</Link> : <Link to="/logout">Logout</Link>}
					</div>
					<div className="col-xs-3">
						<Link to="/products/phones">Phones</Link>
					</div>
					<div className="col-xs-3">
						<Link to="/products/tv">TV</Link>
					</div>
					<div className="col-xs-3">
						<Link to="/products/laptops">Laptops</Link>
					</div>

					{adminLink}
				</div>
				{children}
			</div>
		);
	}
}

export default App;<commit_msg>add render image function<commit_after>import React, { Component } from 'react';
import { Link } from 'react-router'
import auth from './Auth';
import ajax from 'superagent';
import '../css/app.css';
class App extends Component {

	constructor(props) {
		super(props);
		this.state = {
			isAuthenticated: false,
			user: {},
			isAdmin: false
		};
	}

	componentWillMount() {
		auth.getUserData((data) => {
			this.setState({
				'isAuthenticated': data.isAuthenticated,
				'user': data.user,
				'isAdmin': data.isAdmin
			})
		});
	}

	renderImage() {

	}

	renderAdminLink() {

		if (this.state.isAdmin) {

			return (
				<div className="col-xs-3">
					<Link to="/admin/product">Add Product</Link>
				</div>
			);
		}
		return '';
	}

	render() {
		let adminLink = this.renderAdminLink();
		let  dat= this;
		var children = React.Children.map(this.props.children, function (child) {
			return React.cloneElement(child, {
				userData: dat.state.user 
			});
		});
		return (
			<div className="wrapper container-fluid">
				<div className="row nav">
					<div className="col-xs-9">
						<h1 id="main-title">
							<Link to="/">
								iStore
							</Link>
						</h1>
					</div>
					<div className="col-xs-1">
						{this.state.isAuthenticated ? <Link to="/basket">Basket</Link> : ''}
					</div>
					<div className="col-xs-1">
						{!this.state.isAuthenticated ? <Link to="/register">Register</Link> : <Link to="/profile">Profile</Link>}
					</div>
					<div className="col-xs-1">
						{!this.state.isAuthenticated ? <Link to="/login">Login</Link> : <Link to="/logout">Logout</Link>}
					</div>
					<div className="col-xs-3">
						<Link to="/products/phones">Phones</Link>
					</div>
					<div className="col-xs-3">
						<Link to="/products/tv">TV</Link>
					</div>
					<div className="col-xs-3">
						<Link to="/products/laptops">Laptops</Link>
					</div>

					{adminLink}
				</div>
				{children}
				{this.renderImage()}
			</div>
		);
	}
}

export default App;
{'fraction_non_alphanumeric': 0.18791602662570406, 'fraction_numerical': 0.005120327700972862, 'mean_word_length': 2.8154296875, 'pattern_counts': {'":': 0, '<': 85, '<?xml version=': 0, '>': 87, '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': '7620980', 'n_tokens_mistral': 1735, 'n_tokens_neox': 1363, 'n_words': 253}