<commit_before>import React, { PropTypes } from 'react';
import { Link } from 'react-router';

const propTypes = {
  children: PropTypes.element,
};

class SettingsForm extends React.Component {
  constructor(props) {
    super(props);

    this.state = {
      email: "",
      name: "",
      slug: ""
    };
  }

  componentDidMount() {
    console.log("mount")

    var database = firebase.database
    firebase.database().ref('users/' + this.props.user.uid).once('value').then(function(snapshot) {
      this.setState({
        name: snapshot.val().name,
        email: snapshot.val().email,
        slug: snapshot.val().slug
      });
    }.bind(this));
  }

  render() {
    return (
      <form>
        <div className="form-group">
          <label>Name</label>
          <input value={this.state.name} className="form-control" type="text" />
          <small className="form-text text-muted">Como te llamas?</small>
        </div>
        <div className="form-group">
          <label>Email</label>
          <input value={this.state.email} className="form-control" type="text" />
          <small className="form-text text-muted">An email address so we can let you know if your lost items are found</small>
        </div>
        <div className="form-group">
          <label>Your Link</label>
          <div className="input-group">
            <span className="input-group-addon" >www.lost-item.com/</span>
            <input value={this.state.slug} className="form-control" type="text" />
          </div>
          <small className="form-text text-muted">This is the link you'll label your stuff with</small>
        </div>
        <button disabled className="btn btn-primary">Update Settings</button>
      </form>
    );
  }
}

class Settings extends React.Component {
  constructor(props) {
    super(props);
  }

  render() {
    if (this.props.user === null) {
      return (
        <div><h2>You must be logged in to view this page</h2></div>
      );
    } else {
      return (
        <div>
          <div className="row">
            <div className="col-md-6">
              <h2>Settings</h2>
              <p>For {this.props.user.email}</p>
              <br />
              <SettingsForm user={this.props.user} />
            </div>
          </div><commit_msg>Treat link as a semi-permanent field<commit_after>import React, { PropTypes } from 'react';
import { Link } from 'react-router';

const propTypes = {
  children: PropTypes.element,
};

class SettingsForm extends React.Component {
  constructor(props) {
    super(props);

    this.state = {
      email: "",
      name: "",
      slug: ""
    };
  }

  componentDidMount() {
    console.log("mount")

    var database = firebase.database
    firebase.database().ref('users/' + this.props.user.uid).once('value').then(function(snapshot) {
      this.setState({
        name: snapshot.val().name,
        email: snapshot.val().email,
        slug: snapshot.val().slug
      });
    }.bind(this));
  }
  specialtyLinkClickHandler() {
    alert("Feature not yet implemented.");
  }

  render() {
    return (
      <div>
        <div className="row">
          <div className="col-md-12">
            <div className="pull-left">
              <label>Your Link</label>: <strong>www.lost-item.com/{this.state.slug}</strong>
              <small className="form-text text-muted">This is the link you'll label your stuff with</small>
            </div>
            <div className="pull-right"><button onClick={this.specialtyLinkClickHandler} className="btn btn-success">Buy a specialty link</button></div>
          </div>
        </div>
        <br />
        <form>
          <div className="form-group">
            <label>Name</label>
            <input value={this.state.name} className="form-control" type="text" />
            <small className="form-text text-muted">Como te llamas?</small>
          </div>
          <div className="form-group">
            <label>Email</label>
            <input value={this.state.email} className="form-control" type="text" />
            <small className="form-text text-muted">An email address so we can let you know if your lost items are found</small>
          </div>
          <button disabled className="btn btn-primary">Update Settings</button>
        </form>
      </div>
    );
  }
}

class Settings extends React.Component {
  constructor(props) {
    super(props);
  }

  render() {
    if (this.props.user === null) {
      return (
        <div><h2>You must be logged in to view this page</h2></div>
      );
    } else {
      return (
        <div>
          <div className="row">
            <div className="col-md-6">
              <h2>Settings</h2>
              <br />
              <SettingsForm user={this.props.user} />
            </div>
          </div>
{'fraction_non_alphanumeric': 0.15341382181515403, 'fraction_numerical': 0.002497918401332223, 'mean_word_length': 2.1323337679269883, 'pattern_counts': {'":': 0, '<': 97, '<?xml version=': 0, '>': 97, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '81321', 'n_tokens_mistral': 1419, 'n_tokens_neox': 1410, 'n_words': 307}