[WEB-643] chore: update issue activity tabs. (#4232)

* remove `updates` tab.
* make `comments` as primary tab.
This commit is contained in:
Prateek Shourya 2024-04-23 12:52:31 +05:30 committed by GitHub
parent c50a0602f7
commit f77d2d8c0a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 50 deletions

View File

@ -1,33 +0,0 @@
import { FC } from "react";
import { observer } from "mobx-react-lite";
// hooks
import { useIssueDetail } from "@/hooks/store";
// components
import { IssueActivityList } from "./activity-list";
type TIssueActivityRoot = {
issueId: string;
};
export const IssueActivityRoot: FC<TIssueActivityRoot> = observer((props) => {
const { issueId } = props;
// hooks
const {
activity: { getActivitiesByIssueId },
} = useIssueDetail();
const activityIds = getActivitiesByIssueId(issueId);
if (!activityIds) return <></>;
return (
<div>
{activityIds.map((activityId, index) => (
<IssueActivityList
key={activityId}
activityId={activityId}
ends={index === 0 ? "top" : index === activityIds.length - 1 ? "bottom" : undefined}
/>
))}
</div>
);
});

View File

@ -3,7 +3,6 @@ export * from "./root";
export * from "./activity-comment-root";
// activity
export * from "./activity/root";
export * from "./activity/activity-list";
// issue comment

View File

@ -1,12 +1,12 @@
import { FC, useMemo, useState } from "react";
import { observer } from "mobx-react-lite";
import { History, LucideIcon, MessageCircle, ListRestart } from "lucide-react";
import { History, LucideIcon, MessageCircle } from "lucide-react";
// types
import { TIssueComment } from "@plane/types";
// ui
import { TOAST_TYPE, setToast } from "@plane/ui";
// components
import { IssueActivityCommentRoot, IssueActivityRoot, IssueCommentRoot, IssueCommentCreate } from "@/components/issues";
import { IssueActivityCommentRoot, IssueCommentRoot, IssueCommentCreate } from "@/components/issues";
// hooks
import { useIssueDetail, useProject } from "@/hooks/store";
@ -17,24 +17,19 @@ type TIssueActivity = {
disabled?: boolean;
};
type TActivityTabs = "all" | "activity" | "comments";
type TActivityTabs = "all" | "comments";
const activityTabs: { key: TActivityTabs; title: string; icon: LucideIcon }[] = [
{
key: "all",
title: "All activity",
icon: History,
},
{
key: "activity",
title: "Updates",
icon: ListRestart,
},
{
key: "comments",
title: "Comments",
icon: MessageCircle,
},
{
key: "all",
title: "All activity",
icon: History,
},
];
export type TActivityOperations = {
@ -49,7 +44,7 @@ export const IssueActivity: FC<TIssueActivity> = observer((props) => {
const { createComment, updateComment, removeComment } = useIssueDetail();
const { getProjectById } = useProject();
// state
const [activityTab, setActivityTab] = useState<TActivityTabs>("all");
const [activityTab, setActivityTab] = useState<TActivityTabs>("comments");
const activityOperations: TActivityOperations = useMemo(
() => ({
@ -158,8 +153,6 @@ export const IssueActivity: FC<TIssueActivity> = observer((props) => {
/>
)}
</div>
) : activityTab === "activity" ? (
<IssueActivityRoot issueId={issueId} />
) : (
<div className="space-y-3">
<IssueCommentRoot