@@ -14,6 +14,7 @@ import { omnibarEvents } from './events';
1414import { OmnibarHomeIcon } from './home' ;
1515import { useHelpCenterPlugin } from './plugin-help-center' ;
1616import { useNotificationsPlugin } from './plugin-notifications' ;
17+ import { buildSiteBadgeNode } from './plugin-site-badges' ;
1718import { useStatsSparklinePlugin } from './plugin-stats-sparkline' ;
1819import { buildWpcomAccountNode } from './plugin-wpcom-account' ;
1920import type { AppConfig } from '../context' ;
@@ -22,25 +23,16 @@ import type { OmnibarNodeBuilders } from '@automattic/omnibar';
2223
2324const onClickResponsiveMenu = ( ) => omnibarEvents . mobileMenu . emit ( ) ;
2425
25- const UNSUPPORTED_DOTCOM_NODE_IDS = new Set ( [
26- 'site-plan' ,
27- 'site-plan-badge' ,
28- 'site-status-badge' ,
29- ] ) ;
30-
3126const DOTCOM_NODE_BUILDERS : OmnibarNodeBuilders = {
3227 'my-wpcom-account' : buildWpcomAccountNode ,
28+ 'site-plan-badge' : buildSiteBadgeNode ,
29+ 'site-status-badge' : buildSiteBadgeNode ,
3330} ;
3431
3532function removeUnsupportedNodes ( nodes : AdminBarNode [ ] , supports : AppConfig [ 'supports' ] ) {
36- return nodes . filter ( ( node ) => {
37- if ( UNSUPPORTED_DOTCOM_NODE_IDS . has ( node . id ) ) {
38- return false ;
39- }
40- // The palette is only mounted where the app supports it, so elsewhere the
41- // admin bar's button would open nothing.
42- return node . id !== 'command-palette' || supports . commandPalette ;
43- } ) ;
33+ // The palette is only mounted where the app supports it, so elsewhere the
34+ // admin bar's button would open nothing.
35+ return nodes . filter ( ( node ) => node . id !== 'command-palette' || supports . commandPalette ) ;
4436}
4537
4638export default function OmnibarContainer ( { user } : { user ?: User } ) {
0 commit comments