-
Notifications
You must be signed in to change notification settings - Fork 432
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tasks): add comment delete confirm dialog (#6009)
* feat(tasks): add comment delete confirm dialog * refactor(tasks): create dedicated comment activity item component
- Loading branch information
1 parent
217a47d
commit c105115
Showing
2 changed files
with
129 additions
and
81 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
packages/sanity/src/tasks/src/tasks/components/activity/TasksActivityCommentItem.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import {CommentsListItem, type CommentsListItemProps} from '../../../../../structure/comments' | ||
import {ActivityItem} from './TasksActivityItem' | ||
|
||
const COMMENTS_LIST_ITEM_AVATAR_CONFIG: CommentsListItemProps['avatarConfig'] = { | ||
parentCommentAvatar: false, | ||
threadCommentsAvatar: true, | ||
replyAvatar: true, | ||
avatarSize: 0, | ||
} | ||
|
||
interface TasksActivityCommentItemProps extends Omit<CommentsListItemProps, 'mode' | 'isSelected'> { | ||
// ... | ||
} | ||
|
||
export function TasksActivityCommentItem(props: TasksActivityCommentItemProps) { | ||
const {parentComment} = props | ||
|
||
return ( | ||
<ActivityItem userId={parentComment.authorId}> | ||
<CommentsListItem | ||
{...props} | ||
avatarConfig={COMMENTS_LIST_ITEM_AVATAR_CONFIG} | ||
canReply | ||
innerPadding={1} | ||
isSelected={false} | ||
mode="default" // TODO: set dynamic mode? | ||
/> | ||
</ActivityItem> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters