Skip to content

armgit / plane

Public Imported from GitHub
0

πŸ”₯πŸ”₯πŸ”₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.

reduced the components moved (#6110)

Vamsi Krishna5150c661ab57
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(() => {
<div
key={tab.value}
className="h-full px-3 relative cursor-pointer"
- onClick={() => currentNotificationTab != tab.value && setCurrentNotificationTab(tab.value)}
+ onClick={()=>handleTabClick(tab.value)}
>
<div
className={cn(
diff --git a/web/core/components/workspace-notifications/sidebar/index.ts b/web/core/components/workspace-notifications/sidebar/index.ts
index d8ab5c4ed5..9e46ed0e63 100644
--- a/web/core/components/workspace-notifications/sidebar/index.ts
+++ b/web/core/components/workspace-notifications/sidebar/index.ts
@@ -1,8 +1,6 @@
export * from "./loader";
export * from "./empty-state";
-export * from "./root";
-
export * from "./header";
export * from "./filters";
diff --git a/web/ee/components/workspace-notifications/root.tsx b/web/ee/components/workspace-notifications/root.tsx
new file mode 100644
index 0000000000..d4a704bd2a
--- /dev/null
+++ b/web/ee/components/workspace-notifications/root.tsx
@@ -0,0 +1 @@
+export {NotificationsSidebar} from 'ce/components/workspace-notifications'
\ No newline at end of file