Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WEB-863] chore: issue comment empty state added #4202

Merged
merged 1 commit into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 22 additions & 12 deletions web/components/issues/issue-detail/issue-activity/comments/root.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { FC } from "react";
import { observer } from "mobx-react-lite";
// components
import { EmptyState } from "@/components/empty-state";
// hooks
import { EmptyStateType } from "@/constants/empty-state";
// hooks
import { useIssueDetail } from "@/hooks/store";
// components
Expand Down Expand Up @@ -28,18 +32,24 @@ export const IssueCommentRoot: FC<TIssueCommentRoot> = observer((props) => {

return (
<div>
{commentIds.map((commentId, index) => (
<IssueCommentCard
projectId={projectId}
key={commentId}
workspaceSlug={workspaceSlug}
commentId={commentId}
ends={index === 0 ? "top" : index === commentIds.length - 1 ? "bottom" : undefined}
activityOperations={activityOperations}
showAccessSpecifier={showAccessSpecifier}
disabled={disabled}
/>
))}
{commentIds.length > 0 ? (
commentIds.map((commentId, index) => (
<IssueCommentCard
projectId={projectId}
key={commentId}
workspaceSlug={workspaceSlug}
commentId={commentId}
ends={index === 0 ? "top" : index === commentIds.length - 1 ? "bottom" : undefined}
activityOperations={activityOperations}
showAccessSpecifier={showAccessSpecifier}
disabled={disabled}
/>
))
) : (
<div className="flex items-center justify-center py-9">
<EmptyState type={EmptyStateType.ISSUE_COMMENT_EMPTY_STATE} layout="screen-simple" />
</div>
)}
</div>
);
});
2 changes: 1 addition & 1 deletion web/constants/empty-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ const emptyStateDetails = {
[EmptyStateType.ISSUE_COMMENT_EMPTY_STATE]: {
key: EmptyStateType.ISSUE_COMMENT_EMPTY_STATE,
title: "No comments yet",
description: "Comments can be used as a discussion and follow-up space for the issues",
description: "Comments can be used as a discussion and \n follow-up space for the issues",
path: "/empty-state/search/comments",
},

Expand Down
Loading