mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-12 12:40:08 +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
32 lines
711 B
CoffeeScript
32 lines
711 B
CoffeeScript
React = require 'react'
|
|
_ = require "underscore"
|
|
moment = require 'moment'
|
|
classNames = require 'classnames'
|
|
|
|
class TodayIcon extends React.Component
|
|
@displayName: 'TodayIcon'
|
|
|
|
constructor: (@props) ->
|
|
@state =
|
|
moment: moment()
|
|
|
|
componentDidMount: =>
|
|
@_setTimeState()
|
|
|
|
componentWillUnmount: =>
|
|
clearInterval(@_timer)
|
|
|
|
render: =>
|
|
classes = classNames
|
|
'today-icon': true
|
|
'selected': @props.selected
|
|
|
|
<div className={classes}>{@state.moment.format('D')}</div>
|
|
|
|
_setTimeState: =>
|
|
timeTillNextSecond = (60 - (new Date).getSeconds()) * 1000
|
|
@_timer = setTimeout(@_setTimeState, timeTillNextSecond)
|
|
@setState(moment: moment())
|
|
|
|
|
|
module.exports = TodayIcon
|