fix: refactor

This commit is contained in:
gakshita
2025-07-31 13:20:04 +05:30
parent 53d61c1a1d
commit c11d17f23b
3 changed files with 11 additions and 7 deletions

View File

@@ -3,6 +3,6 @@
import { FC } from "react"; import { FC } from "react";
import { observer } from "mobx-react"; import { observer } from "mobx-react";
export type TIssuePageActivity = { activityId: string; showIssue?: boolean; ends: "top" | "bottom" | undefined }; export type TIssuePageActivity = { activityId: string; showIssue?: boolean; ends?: "top" | "bottom" | undefined };
export const IssuePageActivity: FC<TIssuePageActivity> = observer(() => <></>); export const IssuePageActivity: FC<TIssuePageActivity> = observer(() => <></>);

View File

@@ -15,3 +15,5 @@ export const shouldShowConnector = (notificationField: string | undefined) =>
!["comment", "archived_at", "None", "assignees", "labels", "start_date", "target_date", "parent"].includes( !["comment", "archived_at", "None", "assignees", "labels", "start_date", "target_date", "parent"].includes(
notificationField || "" notificationField || ""
); );
export const shouldRender = (notificationField: string | undefined, verb: string | undefined) => verb !== "deleted";

View File

@@ -1,9 +1,5 @@
import { FC } from "react"; import { FC } from "react";
import {
renderAdditionalAction,
renderAdditionalValue,
shouldShowConnector,
} from "ee/components/workspace-notifications";
import { TNotification } from "@plane/types"; import { TNotification } from "@plane/types";
import { import {
convertMinutesToHoursMinutesString, convertMinutesToHoursMinutesString,
@@ -14,6 +10,12 @@ import {
} from "@plane/utils"; } from "@plane/utils";
// components // components
import { LiteTextEditor } from "@/components/editor/lite-text"; import { LiteTextEditor } from "@/components/editor/lite-text";
import {
renderAdditionalAction,
renderAdditionalValue,
shouldShowConnector,
shouldRender,
} from "@/plane-web/components/workspace-notifications";
export const NotificationContent: FC<{ export const NotificationContent: FC<{
notification: TNotification; notification: TNotification;
@@ -86,7 +88,7 @@ export const NotificationContent: FC<{
<> <>
{renderTriggerName()} {renderTriggerName()}
<span className="text-custom-text-300">{renderAction()} </span> <span className="text-custom-text-300">{renderAction()} </span>
{verb !== "deleted" && ( {shouldRender(notificationField, verb) && (
<> <>
{shouldShowConnector(notificationField) && <span className="text-custom-text-300">to </span>} {shouldShowConnector(notificationField) && <span className="text-custom-text-300">to </span>}
<span className="text-custom-text-100 font-medium">{renderValue()}</span> <span className="text-custom-text-100 font-medium">{renderValue()}</span>