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

39 lines
819 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 = () => {
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 (
2017-02-11 19:50:59 +00:00
<a className={linkClasses} href="/notifications" target="_blank">
2016-12-04 20:02:24 +00:00
<div className="tooltipsUnder">
Notifications
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