metamaps--metamaps/frontend/src/components/NotificationIcon.js

40 lines
869 B
JavaScript
Raw Normal View History

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 = () => {
var linkClasses = "notificationsIcon upperRightEl upperRightIcon "
if (this.props.unreadNotificationsCount > 0) {
linkClasses += "unread"
} else {
linkClasses += "read"
}
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>
)
}
}
NotificationIcon.propTypes = {
unreadNotificationsCount: PropTypes.number
}
export default NotificationIcon