mirror of
https://github.com/makeplane/plane.git
synced 2026-05-02 05:59:36 -05:00
[WEB-4094]chore: workspace notifications refactor (#7061)
* chore: workspace notifications refactor * fix: url params * fix: added null checks to avoid run time errors * fix: notifications header color fix
This commit is contained in:
@@ -1 +1,2 @@
|
||||
export * from "./notification-card/root";
|
||||
export * from "./list-root";
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
import { NotificationCardListRoot } from "./notification-card/root";
|
||||
|
||||
export type TNotificationListRoot = {
|
||||
workspaceSlug: string;
|
||||
workspaceId: string;
|
||||
};
|
||||
|
||||
export const NotificationListRoot = (props: TNotificationListRoot) => <NotificationCardListRoot {...props} />;
|
||||
@@ -0,0 +1,25 @@
|
||||
import { EIssueServiceType } from "@plane/constants";
|
||||
import { IWorkItemPeekOverview } from "@plane/types";
|
||||
import { IssuePeekOverview } from "@/components/issues";
|
||||
import { useIssueDetail } from "@/hooks/store";
|
||||
import { TPeekIssue } from "@/store/issue/issue-details/root.store";
|
||||
|
||||
export type TNotificationPreview = {
|
||||
isWorkItem: boolean;
|
||||
PeekOverviewComponent: React.ComponentType<IWorkItemPeekOverview>;
|
||||
setPeekWorkItem: (peekIssue: TPeekIssue | undefined) => void;
|
||||
};
|
||||
|
||||
/**
|
||||
* This function returns if the current active notification is related to work item or an epic.
|
||||
* @returns isWorkItem: boolean, peekOverviewComponent: IWorkItemPeekOverview, setPeekWorkItem
|
||||
*/
|
||||
export const useNotificationPreview = (): TNotificationPreview => {
|
||||
const { peekIssue, setPeekIssue } = useIssueDetail(EIssueServiceType.ISSUES);
|
||||
|
||||
return {
|
||||
isWorkItem: Boolean(peekIssue),
|
||||
PeekOverviewComponent: IssuePeekOverview,
|
||||
setPeekWorkItem: setPeekIssue,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user