reduced the components moved (#6110)
This commit is contained in:
parent
63bc01f385
commit
5150c661ab
5 changed files with 15 additions and 6 deletions
|
|
@ -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 (
|
||||||
|
|
|
||||||
1
web/ce/components/workspace-notifications/index.ts
Normal file
1
web/ce/components/workspace-notifications/index.ts
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
export * from './root'
|
||||||
|
|
@ -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(
|
||||||
|
|
@ -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";
|
||||||
|
|
|
||||||
1
web/ee/components/workspace-notifications/root.tsx
Normal file
1
web/ee/components/workspace-notifications/root.tsx
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
export {NotificationsSidebar} from 'ce/components/workspace-notifications'
|
||||||
Loading…
Add table
Add a link
Reference in a new issue