diff --git a/web/app/[workspaceSlug]/(projects)/notifications/layout.tsx b/web/app/[workspaceSlug]/(projects)/notifications/layout.tsx index b8b80b4d279..b69da040a07 100644 --- a/web/app/[workspaceSlug]/(projects)/notifications/layout.tsx +++ b/web/app/[workspaceSlug]/(projects)/notifications/layout.tsx @@ -1,7 +1,7 @@ "use client"; // components -import { NotificationsSidebar } from "@/components/workspace-notifications"; +import { NotificationsSidebar } from "@/plane-web/components/workspace-notifications"; export default function ProjectInboxIssuesLayout({ children }: { children: React.ReactNode }) { return ( diff --git a/web/ce/components/workspace-notifications/index.ts b/web/ce/components/workspace-notifications/index.ts new file mode 100644 index 00000000000..c8711b96a4c --- /dev/null +++ b/web/ce/components/workspace-notifications/index.ts @@ -0,0 +1 @@ +export * from './root' \ No newline at end of file diff --git a/web/core/components/workspace-notifications/sidebar/root.tsx b/web/ce/components/workspace-notifications/root.tsx similarity index 89% rename from web/core/components/workspace-notifications/sidebar/root.tsx rename to web/ce/components/workspace-notifications/root.tsx index 767b96f42aa..97083d8cb15 100644 --- a/web/core/components/workspace-notifications/sidebar/root.tsx +++ b/web/ce/components/workspace-notifications/root.tsx @@ -1,6 +1,6 @@ "use client"; -import { FC } from "react"; +import { FC, useCallback } from "react"; import { observer } from "mobx-react"; import { useParams } from "next/navigation"; // components @@ -14,7 +14,7 @@ import { NotificationCardListRoot, } from "@/components/workspace-notifications"; // constants -import { NOTIFICATION_TABS } from "@/constants/notification"; +import { NOTIFICATION_TABS, TNotificationTab } from "@/constants/notification"; // helpers import { cn } from "@/helpers/common.helper"; import { getNumberCount } from "@/helpers/string.helper"; @@ -37,6 +37,15 @@ export const NotificationsSidebar: FC = observer(() => { const workspace = workspaceSlug ? getWorkspaceBySlug(workspaceSlug.toString()) : undefined; const notificationIds = workspace ? notificationIdsByWorkspaceId(workspace.id) : undefined; + const handleTabClick = useCallback( + (tabValue: TNotificationTab) => { + if (currentNotificationTab !== tabValue) { + setCurrentNotificationTab(tabValue); + } + }, + [currentNotificationTab, setCurrentNotificationTab] + ); + if (!workspaceSlug || !workspace) return <>; return ( @@ -56,7 +65,7 @@ export const NotificationsSidebar: FC = observer(() => {
currentNotificationTab != tab.value && setCurrentNotificationTab(tab.value)} + onClick={()=>handleTabClick(tab.value)} >