Mailspring/internal_packages/calendar-bar/lib/calendar-bar-item.cjsx
Evan Morikawa 3954289cf4 WIP: This is the initial diff for new folders & labels.
Summary:
There are now two objects, Folders & Labels. These inherit from `Category`
(that's what Eben said they were using on the backend).

There are two separate tasks.

1. MoveToFolderTask
2. ApplyLabelsTask

It turns out that the semantics between the two are quite different.
The reverse operation for moving to a folder is a bit tricky.

As of 7-8-15, the Tasks are pretty much complete. I need to write tests
for them still and do some manual testing in the client.

Test Plan: Writing specs

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D1724
2015-07-16 11:54:20 -04:00

35 lines
934 B
CoffeeScript

React = require 'react'
{Actions} = require("nylas-exports")
moment = require 'moment'
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.focusCategory(@props.tag)
module.exports = CalendarBarItem