mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-22 16:26:08 +08:00
35 lines
960 B
Plaintext
35 lines
960 B
Plaintext
|
{React, Actions} = require 'nylas-exports'
|
||
|
{ParticipantsTextField} = require 'nylas-component-kit'
|
||
|
Identity = require './identity'
|
||
|
_ = require 'underscore'
|
||
|
|
||
|
module.exports =
|
||
|
class EmailPopover extends React.Component
|
||
|
constructor: ->
|
||
|
@state = {to: [], cc: [], bcc: []}
|
||
|
|
||
|
@propTypes:
|
||
|
profile: React.PropTypes.instanceOf(Identity).isRequired
|
||
|
|
||
|
render: ->
|
||
|
participants = @state
|
||
|
|
||
|
<div className="keybase-import-popover">
|
||
|
<span className="title">
|
||
|
Associate Emails with Key
|
||
|
</span>
|
||
|
<ParticipantsTextField
|
||
|
field="to"
|
||
|
className="keybase-participant-field"
|
||
|
participants={ participants }
|
||
|
change={ @_onRecipientFieldChange } />
|
||
|
<button className="btn btn-toolbar" onClick={ @_onDone }>Done</button>
|
||
|
</div>
|
||
|
|
||
|
_onRecipientFieldChange: (contacts) =>
|
||
|
@setState(contacts)
|
||
|
|
||
|
_onDone: =>
|
||
|
@props.onPopoverDone(_.pluck(@state.to, 'email'), @props.profile)
|
||
|
Actions.closePopover()
|