Skip to content

Commit

Permalink
reduced the components moved (#6110)
Browse files Browse the repository at this point in the history
  • Loading branch information
mathalav55 authored Dec 2, 2024
1 parent 63bc01f commit 5150c66
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down
1 change: 1 addition & 0 deletions web/ce/components/workspace-notifications/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './root'
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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";
Expand All @@ -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 (
Expand All @@ -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(
Expand Down
2 changes: 0 additions & 2 deletions web/core/components/workspace-notifications/sidebar/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
export * from "./loader";
export * from "./empty-state";

export * from "./root";

export * from "./header";

export * from "./filters";
Expand Down
1 change: 1 addition & 0 deletions web/ee/components/workspace-notifications/root.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {NotificationsSidebar} from 'ce/components/workspace-notifications'

0 comments on commit 5150c66

Please sign in to comment.