2016-12-04 20:02:24 +00:00
|
|
|
import React, { PropTypes, Component } from 'react'
|
|
|
|
|
|
|
|
class NotificationIcon extends Component {
|
|
|
|
constructor(props) {
|
|
|
|
super(props)
|
|
|
|
|
|
|
|
this.state = {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
render = () => {
|
2016-12-11 22:29:48 +00:00
|
|
|
let linkClasses = 'notificationsIcon upperRightEl upperRightIcon '
|
|
|
|
|
2016-12-04 20:02:24 +00:00
|
|
|
if (this.props.unreadNotificationsCount > 0) {
|
2016-12-11 22:29:48 +00:00
|
|
|
linkClasses += 'unread'
|
2016-12-04 20:02:24 +00:00
|
|
|
} else {
|
2016-12-11 22:29:48 +00:00
|
|
|
linkClasses += 'read'
|
2016-12-04 20:02:24 +00:00
|
|
|
}
|
2016-12-11 22:29:48 +00:00
|
|
|
|
2016-12-04 20:02:24 +00:00
|
|
|
return (
|
|
|
|
<a className={linkClasses} href="/notifications">
|
|
|
|
<div className="tooltipsUnder">
|
2016-12-08 19:39:41 +00:00
|
|
|
Notifications ({this.props.unreadNotificationsCount} unread)
|
2016-12-04 20:02:24 +00:00
|
|
|
</div>
|
|
|
|
{this.props.unreadNotificationsCount === 0 ? null : (
|
|
|
|
<div className="unread-notifications-dot"></div>
|
|
|
|
)}
|
|
|
|
</a>
|
2016-12-11 22:29:48 +00:00
|
|
|
|
2016-12-04 20:02:24 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
NotificationIcon.propTypes = {
|
|
|
|
unreadNotificationsCount: PropTypes.number
|
|
|
|
}
|
|
|
|
|
|
|
|
export default NotificationIcon
|