var React = require('react') var Markdown = require('markdown.jsx') var Link = require('react-router').Link var Icon = require('icon.jsx') module.exports = function(boards){ return React.createClass({ getInitialState: function(){ return { name: '...', boards: [] } }, componentDidMount: function(){ console.log('About to ask for profile for',this.props.params.userid) var ee = boards.getEventEmitter() ee.on('boards for '+this.props.params.userid,l => { if(!this.isMounted()) return true this.setState({ boards: l }) }) boards.getProfile(this.props.params.userid,(err,res) => { if(!this.isMounted()) return true if(err){ this.setState({ name: , description: err }) } else { this.setState({ name: res.name, description: res.description }) } }) }, linkToEditor: function(){ if(this.props.params.userid === boards.id){ return
This is your profile

} return '' }, render: function(){ return (
{this.linkToEditor()}

{this.state.name}


@{this.props.params.userid}
{this.state.boards.map(n => { return
# {n.name}
})}
) } }) }