From 5150c661ab577c322f85b00efcdd8926ff679cb8 Mon Sep 17 00:00:00 2001 From: Vamsi Krishna <46787868+mathalav55@users.noreply.github.com> Date: Mon, 2 Dec 2024 13:35:40 +0530 Subject: [PATCH] reduced the components moved (#6110) --- .../(projects)/notifications/layout.tsx | 2 +- .../components/workspace-notifications/index.ts | 1 + .../components/workspace-notifications}/root.tsx | 15 ++++++++++++--- .../workspace-notifications/sidebar/index.ts | 2 -- .../components/workspace-notifications/root.tsx | 1 + 5 files changed, 15 insertions(+), 6 deletions(-) create mode 100644 web/ce/components/workspace-notifications/index.ts rename web/{core/components/workspace-notifications/sidebar => ce/components/workspace-notifications}/root.tsx (89%) create mode 100644 web/ee/components/workspace-notifications/root.tsx diff --git a/web/app/[workspaceSlug]/(projects)/notifications/layout.tsx b/web/app/[workspaceSlug]/(projects)/notifications/layout.tsx index b8b80b4d27..b69da040a0 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 0000000000..c8711b96a4 --- /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 767b96f42a..97083d8cb1 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(() => {