Mailspring/internal_packages/calendar-bar/lib/calendar-bar-item.cjsx
Ben Gotow dfcb15c79e feat(starred): Replace FocusedContentStore with FocusedMailViewStore, allows for starred
Summary:
This diff fixes T3389 and makes it possible to define mail views which are not based on a category and focus them in the app.

I think that we need to create a new index on the starred attribute to make sure the query runs fast.

More tests WIP

Test Plan: Run tests, more coming soon!

Reviewers: dillon, evan

Reviewed By: evan

Maniphest Tasks: T3389

Differential Revision: https://phab.nylas.com/D1979
2015-09-04 12:23:15 -07:00

37 lines
976 B
CoffeeScript

React = require 'react'
{Actions} = require("nylas-exports")
moment = require 'moment'
# TODO: This file is out of date!
return
class CalendarBarItem extends React.Component
render: =>
style =
left: @props.item.xPercent
top: @props.item.yPercent
width: @props.item.wPercent
height: @props.item.hPercent
zIndex: @props.item.z
<div className="event" style={style} id={@props.item.event.id}>
<span className="title">{@props.item.event.title}</span>
<span className="time">{@_time()}</span>
</div>
_time: =>
w = @props.item.event.when
if w.start_time
return moment.unix(w.start_time).format('h:mm a')
else if w.time
return moment.unix(w.time).format('h:mm a')
else if w.start_date
return moment.unix(w.start_date).format('MMMM Do')
else
return ""
_onClick: (event) =>
event.preventDefault()
Actions.focusMailView(@props.tag)
module.exports = CalendarBarItem