diff --git a/ui/component/notificationBubble/view.jsx b/ui/component/notificationBubble/view.jsx index f3d060030..9da6b1659 100644 --- a/ui/component/notificationBubble/view.jsx +++ b/ui/component/notificationBubble/view.jsx @@ -1,16 +1,19 @@ // @flow import React from 'react'; import classnames from 'classnames'; +import { ENABLE_UI_NOTIFICATIONS } from 'config'; type Props = { unseenCount: number, inline: boolean, + user: ?User, }; export default function NotificationHeaderButton(props: Props) { - const { unseenCount, inline = false } = props; + const { unseenCount, inline = false, user } = props; + const notificationsEnabled = ENABLE_UI_NOTIFICATIONS || (user && user.experimental_ui); - if (unseenCount === 0) { + if (unseenCount === 0 || !notificationsEnabled) { return null; } diff --git a/ui/component/notificationHeaderButton/view.jsx b/ui/component/notificationHeaderButton/view.jsx index 9c19e4116..74c581888 100644 --- a/ui/component/notificationHeaderButton/view.jsx +++ b/ui/component/notificationHeaderButton/view.jsx @@ -6,6 +6,7 @@ import Icon from 'component/common/icon'; import NotificationBubble from 'component/notificationBubble'; import Button from 'component/button'; import { useHistory } from 'react-router'; +import { ENABLE_UI_NOTIFICATIONS } from 'config'; type Props = { unseenCount: number, @@ -19,8 +20,9 @@ export default function NotificationHeaderButton(props: Props) { // notifications, // fetching, doSeeAllNotifications, - // user, + user, } = props; + const notificationsEnabled = ENABLE_UI_NOTIFICATIONS || (user && user.experimental_ui); const { push } = useHistory(); function handleMenuClick() { @@ -31,6 +33,10 @@ export default function NotificationHeaderButton(props: Props) { push(`/$/${PAGES.NOTIFICATIONS}`); } + if (!notificationsEnabled) { + return null; + } + return (