mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-14 21:57:55 +08:00
4619871e8d
Summary: Fixes: T1334 remove final InboxApp references move out all underscore-plus methods Mass find and replace of underscore-plus sed -i '' -- 's/underscore-plus/underscore/g' **/*.coffee sed -i '' -- 's/underscore-plus/underscore/g' **/*.cjsx Test Plan: edgehill --test Reviewers: bengotow Reviewed By: bengotow Differential Revision: https://phab.nylas.com/D1534
44 lines
1.1 KiB
CoffeeScript
44 lines
1.1 KiB
CoffeeScript
React = require "react"
|
|
_ = require "underscore"
|
|
ContactChip = require './ContactChip'
|
|
|
|
{NamespaceStore} = require "nylas-exports"
|
|
|
|
# Parameters
|
|
# clickable (optional) - is this currently clickable?
|
|
# thread (optional) - thread context for sorting
|
|
# passed into the ParticipantChip
|
|
# - 'primary'
|
|
# - 'list'
|
|
|
|
class Participants extends React.Component
|
|
@displayName: "Participants"
|
|
|
|
@containerRequired: false
|
|
|
|
render: =>
|
|
chips = @getParticipants().map (p) =>
|
|
<ContactChip key={p.nameEmail()} clickable={@props.clickable} participant={p} />
|
|
|
|
<div displayName="div.participants" className="participants">
|
|
{chips}
|
|
</div>
|
|
|
|
getParticipants: =>
|
|
myEmail = NamespaceStore.current().emailAddress
|
|
list = @props.participants
|
|
|
|
# Remove 'Me' if there is more than one participant
|
|
if list.length > 1
|
|
list = _.reject list, (p) -> p.email is myEmail
|
|
|
|
list.forEach (p) ->
|
|
p.id = p.name+p.email
|
|
|
|
list
|
|
|
|
shouldComponentUpdate: (newProps, newState) =>
|
|
!_.isEqual(newProps.participants, @props.participants)
|
|
|
|
|
|
module.exports = Participants
|