import React from 'react'; import PropTypes from 'prop-types'; import { Link } from 'react-router-dom'; import { Icon, Menu } from 'semantic-ui-react'; import Paths from '../../constants/Paths'; import NotificationsPopup from './NotificationsPopup'; import UserPopup from '../UserPopup'; import styles from './Header.module.scss'; const Header = React.memo( ({ user, notifications, isEditable, onUsers, onNotificationDelete, onUserSettings, onLogout, }) => (
Planka {isEditable && ( )} {notifications.length > 0 && ( {notifications.length} )} {user.name}
), ); Header.propTypes = { /* eslint-disable react/forbid-prop-types */ user: PropTypes.object.isRequired, notifications: PropTypes.array.isRequired, /* eslint-enable react/forbid-prop-types */ isEditable: PropTypes.bool.isRequired, onUsers: PropTypes.func.isRequired, onNotificationDelete: PropTypes.func.isRequired, onUserSettings: PropTypes.func.isRequired, onLogout: PropTypes.func.isRequired, }; export default Header;