/** @jsx React.DOM */

// For testing
var React;
if (typeof module !== 'undefined') {
    React = require('react');
    Authenticate = require('./gebo/Authenticate');
}

/**
 * Interface
 */
var Interface = React.createClass({

    /**
     * componentDidMount
     */
    getInitialState: function() {
        return {
            email: 'You haven\'t signed in',
        };
    },

    /**
     * componentDidMount
     */
//    componentDidMount: function() {
//        if (this.props.friendo) {
//          this.setState({
//              friendo: this.props.friendo,
//            });
//        }
//    },

    /**
     * Called whenever the user's authentication status changes
     *
     * @param object
     */
    authenticate: function(user) {
                    console.log('authenticated', user);
        if (user.verified) {
          this.setState(user);
        }
        else {
          this.setState(this.getInitialState());
        }
    },

    /**
     * Render the component
     */
    render: function() {
        return(
            <div className='interface'>
                <Authenticate ref='authenticated' update={this.authenticate} />
                <h1>Client ID: {this.state.email}</h1>
            </div>
        );
    }
});

if (typeof module !== 'undefined') {
  module.exports = Interface;
}
else {
  React.renderComponent(
      <Interface />, document.getElementById('interface')
  );
}

@@ -381,236 +381,8 @@
 %7D,%0A%0A
-    /**%0A     * componentDidMount%0A     */%0A//    componentDidMount: function() %7B%0A//        if (this.props.friendo) %7B%0A//          this.setState(%7B%0A//              friendo: this.props.friendo,%0A//            %7D);%0A//        %7D%0A//    %7D,%0A%0A
     
@@ -449,16 +449,16 @@
 changes%0A
+
      *%0A 
@@ -524,64 +524,8 @@
 ) %7B%0A
-                    console.log('authenticated', user);%0A
     
@@ -895,17 +895,17 @@
       %3Ch
-1
+3
 %3EClient 
@@ -933,9 +933,9 @@
 %7D%3C/h
-1
+3
 %3E%0A  

Put feedback in smaller header