move NotificationHub from plugins to main folder

Summary: As all device plugins are now moved to the plugins folder, this was the last thing in this folder. I am moving it out and putting it next to the core UI parts of the app.

Reviewed By: jknoxville

Differential Revision: D10337838

fbshipit-source-id: 6fa699c28e5df8a53719179fbb760f2a140bafc4
This commit is contained in:
Daniel Büchele
2018-10-15 02:53:57 -07:00
committed by Facebook Github Bot
parent 01020edbf2
commit 22e3017cdc
3 changed files with 14 additions and 15 deletions

View File

@@ -25,14 +25,10 @@ import {
} from 'flipper';
import React from 'react';
import {devicePlugins, clientPlugins} from '../plugins/index.js';
import notificationPlugin from '../device-plugins/notifications/index.js';
import NotificationsHub from '../NotificationsHub.js';
import {selectPlugin} from '../reducers/connections.js';
import {connect} from 'react-redux';
if (GK.get('flipper_notifications')) {
devicePlugins.push(notificationPlugin);
}
const ListItem = styled('div')(({active}) => ({
paddingLeft: 10,
display: 'flex',
@@ -214,13 +210,15 @@ class MainSidebar extends Component<MainSidebarProps> {
}>
<PluginIcon
color={colors.light50}
name={notifications.length > 0 ? 'bell' : 'bell-null'}
isActive={selectedPlugin === 'notifications'}
name={
notifications.length > 0 ? NotificationsHub.icon : 'bell-null'
}
isActive={selectedPlugin === NotificationsHub.id}
/>
<PluginName
count={notifications.length}
isActive={selectedPlugin === 'notifications'}>
Notifications
isActive={selectedPlugin === NotificationsHub.id}>
{NotificationsHub.title}
</PluginName>
</ListItem>
)}