Skip to content

Commit

Permalink
Merge pull request #1055 from bluehost/add/app-nav-notifications
Browse files Browse the repository at this point in the history
Render `bluehost-app-nav` messages in the app nav
  • Loading branch information
wpalani authored Apr 30, 2024
2 parents 2893dce + 507a79d commit 0425cc2
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/app/components/app-nav/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { useEffect, useState } from '@wordpress/element';
import apiFetch from '@wordpress/api-fetch';
import { useViewportMatch } from '@wordpress/compose';
import { addQueryArgs } from '@wordpress/url';
import classnames from 'classnames';
import { filter } from 'lodash';
import { Modal, SidebarNavigation } from '@newfold/ui-component-library';
import { default as NewfoldNotifications } from '@modules/wp-module-notifications/assets/js/components/notifications/';
import { NavLink, useLocation } from 'react-router-dom';
import { Bars3Icon } from '@heroicons/react/24/outline';
import { topRoutes, utilityRoutes } from 'App/data/routes';
Expand Down Expand Up @@ -146,6 +151,9 @@ export const SideNavMenuSubItem = ( { label, path, action } ) => {
};

export const SideNav = () => {
const location = useLocation();
const hashedPath = '#' + location.pathname;

return (
<aside className="wppbh-app-sidenav nfd-shrink-0 nfd-hidden min-[783px]:nfd-block nfd-pb-6 nfd-bottom-0 nfd-w-56">
<SidebarNavigation>
Expand All @@ -154,6 +162,20 @@ export const SideNav = () => {
<SideNavMenu />
</SidebarNavigation.Sidebar>
</SidebarNavigation>
<NewfoldNotifications
constants={ {
context: 'bluehost-app-nav',
page: hashedPath,
} }
methods={ {
apiFetch,
addQueryArgs,
classnames,
filter,
useState,
useEffect,
} }
/>
</aside>
);
};
Expand Down

0 comments on commit 0425cc2

Please sign in to comment.