import React from 'react'; import Fields from './fields'; import {Actions} from 'nylas-exports'; import {RetinaImg} from 'nylas-component-kit'; export default class ComposerHeaderActions extends React.Component { static displayName = 'ComposerHeaderActions'; static propTypes = { draftClientId: React.PropTypes.string.isRequired, enabledFields: React.PropTypes.array.isRequired, participantsFocused: React.PropTypes.bool, onShowAndFocusField: React.PropTypes.func.isRequired, } _onPopoutComposer = () => { Actions.composePopoutDraft(this.props.draftClientId); } render() { const items = []; if (this.props.participantsFocused) { if (!this.props.enabledFields.includes(Fields.Cc)) { items.push( this.props.onShowAndFocusField(Fields.Cc)} >Cc ); } if (!this.props.enabledFields.includes(Fields.Bcc)) { items.push( this.props.onShowAndFocusField(Fields.Bcc)} >Bcc ); } } if (!this.props.enabledFields.includes(Fields.Subject)) { items.push( this.props.onShowAndFocusField(Fields.Subject)} >Subject ); } if (!NylasEnv.isComposerWindow()) { items.push( ); } return (
{items}
); } }