Skip to content

Commit

Permalink
modify panelRef
Browse files Browse the repository at this point in the history
  • Loading branch information
Blake Holifield committed Jan 10, 2025
1 parent f58ef66 commit 00ad60e
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/components/NotificationsDrawer/DrawerPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ import {
StackItem,
} from '@patternfly/react-core/dist/dynamic/layouts/Stack';
import { getSevenDaysAgo } from '../UtcDate';
// import { DrawerPanelContent } from '@patternfly/react-core';

interface Bundle {
id: string;
Expand All @@ -75,7 +74,7 @@ interface FilterConfigItem {
}

export type DrawerPanelProps = {
innerRef: React.Ref<unknown>;
panelRef: React.Ref<unknown>;
isOrgAdmin: boolean;
expanded: boolean;
getUserPermissions: (
Expand Down Expand Up @@ -154,17 +153,16 @@ const EmptyNotifications = ({
</EmptyState>
);

const DrawerPanelBase = (
{ isOrgAdmin, getUserPermissions }: DrawerPanelProps,
innerRef
) => {
const DrawerPanelBase = ({
isOrgAdmin,
getUserPermissions,
}: DrawerPanelProps) => {
const { addWsEventListener } = useChrome();
const [isDropdownOpen, setIsDropdownOpen] = useState(false);
const [isFilterDropdownOpen, setIsFilterDropdownOpen] = useState(false);
const [activeFilters, setActiveFilters] = useAtom(
notificationDrawerFilterAtom
);
console.log(innerRef);
const navigate = useNavigate();
const populateNotifications = useSetAtom(notificationDrawerDataAtom);
const addNotification = useSetAtom(addNotificationAtom);
Expand Down Expand Up @@ -259,6 +257,7 @@ const DrawerPanelBase = (

const onNotificationsDrawerClose = () => {
setActiveFilters([]);
// toggleDrawer(false);
};

const onUpdateSelectedStatus = (read: boolean) => {
Expand Down Expand Up @@ -412,7 +411,6 @@ const DrawerPanelBase = (
};

return (
// <DrawerPanelContent>
<>
<NotificationDrawerHeader
onClose={onNotificationsDrawerClose}
Expand Down Expand Up @@ -503,10 +501,10 @@ const DrawerPanelBase = (
};

const DrawerPanel = React.forwardRef(
(props: DrawerPanelProps, innerRef: React.Ref<unknown>) => (
(props: DrawerPanelProps, panelRef: React.Ref<unknown>) => (
<DrawerPanelBase
isOrgAdmin={props.isOrgAdmin}
innerRef={innerRef}
panelRef={panelRef}
getUserPermissions={props.getUserPermissions}
expanded={props.expanded}
/>
Expand Down

0 comments on commit 00ad60e

Please sign in to comment.