reduced the components moved (#6110)

This commit is contained in:
Vamsi Krishna 2024-12-02 13:35:40 +05:30 committed by GitHub
parent 63bc01f385
commit 5150c661ab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 15 additions and 6 deletions

View file

@ -1,7 +1,7 @@
"use client"; "use client";
// components // components
import { NotificationsSidebar } from "@/components/workspace-notifications"; import { NotificationsSidebar } from "@/plane-web/components/workspace-notifications";
export default function ProjectInboxIssuesLayout({ children }: { children: React.ReactNode }) { export default function ProjectInboxIssuesLayout({ children }: { children: React.ReactNode }) {
return ( return (

View file

@ -0,0 +1 @@
export * from './root'

View file

@ -1,6 +1,6 @@
"use client"; "use client";
import { FC } from "react"; import { FC, useCallback } from "react";
import { observer } from "mobx-react"; import { observer } from "mobx-react";
import { useParams } from "next/navigation"; import { useParams } from "next/navigation";
// components // components
@ -14,7 +14,7 @@ import {
NotificationCardListRoot, NotificationCardListRoot,
} from "@/components/workspace-notifications"; } from "@/components/workspace-notifications";
// constants // constants
import { NOTIFICATION_TABS } from "@/constants/notification"; import { NOTIFICATION_TABS, TNotificationTab } from "@/constants/notification";
// helpers // helpers
import { cn } from "@/helpers/common.helper"; import { cn } from "@/helpers/common.helper";
import { getNumberCount } from "@/helpers/string.helper"; import { getNumberCount } from "@/helpers/string.helper";
@ -37,6 +37,15 @@ export const NotificationsSidebar: FC = observer(() => {
const workspace = workspaceSlug ? getWorkspaceBySlug(workspaceSlug.toString()) : undefined; const workspace = workspaceSlug ? getWorkspaceBySlug(workspaceSlug.toString()) : undefined;
const notificationIds = workspace ? notificationIdsByWorkspaceId(workspace.id) : undefined; const notificationIds = workspace ? notificationIdsByWorkspaceId(workspace.id) : undefined;
const handleTabClick = useCallback(
(tabValue: TNotificationTab) => {
if (currentNotificationTab !== tabValue) {
setCurrentNotificationTab(tabValue);
}
},
[currentNotificationTab, setCurrentNotificationTab]
);
if (!workspaceSlug || !workspace) return <></>; if (!workspaceSlug || !workspace) return <></>;
return ( return (
@ -56,7 +65,7 @@ export const NotificationsSidebar: FC = observer(() => {
<div <div
key={tab.value} key={tab.value}
className="h-full px-3 relative cursor-pointer" className="h-full px-3 relative cursor-pointer"
onClick={() => currentNotificationTab != tab.value && setCurrentNotificationTab(tab.value)} onClick={()=>handleTabClick(tab.value)}
> >
<div <div
className={cn( className={cn(

View file

@ -1,8 +1,6 @@
export * from "./loader"; export * from "./loader";
export * from "./empty-state"; export * from "./empty-state";
export * from "./root";
export * from "./header"; export * from "./header";
export * from "./filters"; export * from "./filters";

View file

@ -0,0 +1 @@
export {NotificationsSidebar} from 'ce/components/workspace-notifications'