/** @babel */ import _ from 'underscore' import React from 'react' import {shell} from 'electron' import {DOMUtils, Utils} from 'nylas-exports' import {RetinaImg} from 'nylas-component-kit' import ParticipantProfileStore from './participant-profile-store' export default class SidebarParticipantProfile extends React.Component { static displayName = "SidebarParticipantProfile"; static propTypes = { contact: React.PropTypes.object, contactThreads: React.PropTypes.array, } constructor(props) { super(props); /* We expect ParticipantProfileStore.dataForContact to return the * following schema: * { * profilePhotoUrl: string * bio: string * location: string * currentTitle: string * currentEmployer: string * socialProfiles: hash keyed by type: ('twitter', 'facebook' etc) * url: string * handle: string * } */ this.state = ParticipantProfileStore.dataForContact(props.contact) } componentDidMount() { this.usub = ParticipantProfileStore.listen(() => { this.setState(ParticipantProfileStore.dataForContact(this.props.contact)) }) } componentWillUnmount() { this.usub() } static containerStyles = { order: 0, } _renderProfilePhoto() { if (this.state.profilePhotoUrl) { return (
{title}{this.state.employer}
) } _renderBio() { if (!this.state.bio) { return false; } return ({this.state.bio}
) } _renderLocation() { if (!this.state.location) { return false; } return (