From 183f5bdaf6756d44200caefa015acd8a17072f37 Mon Sep 17 00:00:00 2001 From: RitaDias Date: Tue, 27 Aug 2024 09:57:52 +0200 Subject: [PATCH] refactor(sanity): reverts changes to the potential ui for the future --- .../components/list/CommentsListItem.tsx | 18 +++++------------- .../components/list/CommentsListItemLayout.tsx | 5 ----- 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/packages/sanity/src/core/comments/components/list/CommentsListItem.tsx b/packages/sanity/src/core/comments/components/list/CommentsListItem.tsx index 0bf9cfc343ba..083146ae5177 100644 --- a/packages/sanity/src/core/comments/components/list/CommentsListItem.tsx +++ b/packages/sanity/src/core/comments/components/list/CommentsListItem.tsx @@ -11,7 +11,6 @@ import { useRef, useState, } from 'react' -import {getBundleSlug, isVersionId} from 'sanity' import {css, styled} from 'styled-components' import {Button} from '../../../../ui-components' @@ -264,10 +263,6 @@ export const CommentsListItem = memo(function CommentsListItem(props: CommentsLi } }, [replies]) - const label = isVersionId(props.parentComment.target.document._ref) - ? getBundleSlug(props.parentComment.target.document._ref) - : undefined - /* TODO - once we understand how to set up with "finished" releases we need to add a condition to the readOnly prop in this component */ @@ -294,26 +289,24 @@ export const CommentsListItem = memo(function CommentsListItem(props: CommentsLi onReactionSelect={onReactionSelect} readOnly={readOnly} withAvatar={avatarConfig.threadCommentsAvatar} - version={label} /> )), [ - splicedReplies, - avatarConfig.avatarSize, avatarConfig.threadCommentsAvatar, + avatarConfig.avatarSize, currentUser, - parentComment, + handleInputKeyDown, mentionOptions, - mode, onCopyLink, onCreateRetry, onDelete, onEdit, - handleInputKeyDown, onReactionSelect, + parentComment, readOnly, - label, + splicedReplies, + mode, ], ) @@ -363,7 +356,6 @@ export const CommentsListItem = memo(function CommentsListItem(props: CommentsLi onStatusChange={onStatusChange} readOnly={readOnly} withAvatar={avatarConfig.parentCommentAvatar} - version={label} /> diff --git a/packages/sanity/src/core/comments/components/list/CommentsListItemLayout.tsx b/packages/sanity/src/core/comments/components/list/CommentsListItemLayout.tsx index 3ca8ef7910b0..f708c08f1591 100644 --- a/packages/sanity/src/core/comments/components/list/CommentsListItemLayout.tsx +++ b/packages/sanity/src/core/comments/components/list/CommentsListItemLayout.tsx @@ -166,7 +166,6 @@ interface CommentsListItemLayoutProps { onStatusChange?: (id: string, status: CommentStatus) => void readOnly?: boolean withAvatar?: boolean - version?: string } const RELATIVE_TIME_OPTIONS: RelativeTimeOptions = {useTemporalPhrase: true} @@ -194,7 +193,6 @@ export function CommentsListItemLayout(props: CommentsListItemLayoutProps) { onStatusChange, readOnly, withAvatar = true, - version, } = props const {_createdAt, authorId, message, _id, lastEditedAt} = comment const [user] = useUser(authorId) @@ -338,9 +336,6 @@ export function CommentsListItemLayout(props: CommentsListItemLayoutProps) { ) - /* TODO - it's still unclear if we want to show that the comments belong to a specific version - we can do that by displaying the version somewhere in the UI */ - return (