<commit_before>import React from 'react';
import Card from 'material-ui/lib/card/card';
import CardActions from 'material-ui/lib/card/card-actions';
import CardHeader from 'material-ui/lib/card/card-header';
import FlatButton from 'material-ui/lib/flat-button';
import CardText from 'material-ui/lib/card/card-text';
import Divider from 'material-ui/lib/divider';
import ProfilePic from './ProfilePic.react';
import { Link } from 'react-router'
import ProfileVisitorActions from '../../../actions/ProfileVisitorActions';
import VisitorStore from '../../../stores/VisitorStore';

const tabstyle = {
  marginTop: 30,
  marginLeft: 50,
  marginReft: 50
};


const Profile = React.createClass({
  getInitialState: function() {
    return {
      firstname: VisitorStore.getuserdata().firstname,
      lastname: VisitorStore.getuserdata().lastname,
      country: VisitorStore.getuserdata().country
    }
  },
  componentDidMount: function() {
    var username = "tiffany";
    VisitorStore.addChangeListener(this._onChange);
    ProfileVisitorActions.loadprofiledata(username);
  },
  componentWillUnmount: function() {

  },
  _onChange: function() {
    this.setState({
      firstname: VisitorStore.getuserdata().firstname,
      lastname: VisitorStore.getuserdata().lastname,
      country: VisitorStore.getuserdata().country  <commit_msg>Extract username to display profiles<commit_after>import React from 'react';
import Card from 'material-ui/lib/card/card';
import CardActions from 'material-ui/lib/card/card-actions';
import CardHeader from 'material-ui/lib/card/card-header';
import FlatButton from 'material-ui/lib/flat-button';
import CardText from 'material-ui/lib/card/card-text';
import Divider from 'material-ui/lib/divider';
import ProfilePic from './ProfilePic.react';
import { Link } from 'react-router'
import ProfileVisitorActions from '../../../actions/ProfileVisitorActions';
import VisitorStore from '../../../stores/VisitorStore';

const tabstyle = {
  marginTop: 30,
  marginLeft: 50,
  marginReft: 50
};


const Profile = React.createClass({
  getInitialState: function() {
    return {
      firstname: VisitorStore.getuserdata().firstname,
      lastname: VisitorStore.getuserdata().lastname,
      country: VisitorStore.getuserdata().country
    }
  },
  componentDidMount: function() {
    let str = window.location.hash;
    let username = str.split(/[\/?]/)[1];
    VisitorStore.addChangeListener(this._onChange);
    ProfileVisitorActions.loadprofiledata(username);
  },
  componentWillUnmount: function() {

  },
  _onChange: function() {
    this.setState({
      firstname: VisitorStore.getuserdata().firstname,
      lastname: VisitorStore.getuserdata().lastname,
      country: VisitorStore.getuserdata().country  
{'fraction_non_alphanumeric': 0.1316842488177519, 'fraction_numerical': 0.004728992360858494, 'mean_word_length': 4.288461538461538, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2270597', 'n_tokens_mistral': 830, 'n_tokens_neox': 808, 'n_words': 171}