lbry-desktop/ui/component/notificationBubble/view.jsx
Sean Yesmunt a31f14b016 cleanup
2020-08-11 17:04:14 -04:00

28 lines
629 B
JavaScript

// @flow
import React from 'react';
import classnames from 'classnames';
type Props = {
unreadCount: number,
inline: boolean,
user: ?User,
};
export default function NotificationHeaderButton(props: Props) {
const { unreadCount, inline = false, user } = props;
const notificationsEnabled = user && user.experimental_ui;
if (unreadCount === 0 || !notificationsEnabled) {
return null;
}
return (
<span
className={classnames('notification__bubble', {
'notification__bubble--inline': inline,
})}
>
<span className="notification__count">{unreadCount}</span>
</span>
);
}