mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-11 18:32:20 +08:00
26fe05153c
Summary: The TaskQueue does it's own throttling and has it's own processQueue retry timeout, no need for longPollConnected Remove dead code (OfflineError) Rename long connection state to status so we don't ask for `state.state` Remove long poll actions related to online/offline in favor of exposing connection state through NylasSyncStatusStore Consoliate notifications and account-error-heaer into a single package and organize files into sidebar vs. header. Update the DeveloperBarStore to query the sync status store for long poll statuses Test Plan: All existing tests pass Reviewers: juan, evan Reviewed By: evan Differential Revision: https://phab.nylas.com/D2835
39 lines
1.3 KiB
CoffeeScript
39 lines
1.3 KiB
CoffeeScript
React = require 'react'
|
|
{Actions} = require 'nylas-exports'
|
|
|
|
class NotificationsItem extends React.Component
|
|
@displayName: "NotificationsItem"
|
|
|
|
render: =>
|
|
notif = @props.notification
|
|
iconClass = if notif.icon then "fa #{notif.icon}" else ""
|
|
actionDefault = null
|
|
actionComponents = notif.actions?.map (action) =>
|
|
classname = "action "
|
|
if action.default
|
|
actionDefault = action
|
|
classname += "default"
|
|
|
|
actionClick = (event) =>
|
|
@_fireItemAction(notif, action)
|
|
event.stopPropagation()
|
|
event.preventDefault()
|
|
|
|
<a className={classname} key={action.label} onClick={actionClick}>
|
|
{action.label}
|
|
</a>
|
|
|
|
if actionDefault
|
|
<div className={"notifications-sticky-item notification-#{notif.type} has-default-action"}
|
|
onClick={=> @_fireItemAction(notif, actionDefault)}>
|
|
<i className={iconClass}></i><div className="message">{notif.message}</div>{actionComponents}
|
|
</div>
|
|
else
|
|
<div className={"notifications-sticky-item notification-#{notif.type}"}>
|
|
<i className={iconClass}></i><div className="message">{notif.message}</div>{actionComponents}
|
|
</div>
|
|
|
|
_fireItemAction: (notification, action) =>
|
|
Actions.notificationActionTaken({notification, action})
|
|
|
|
module.exports = NotificationsItem
|