Skip to content

Commit

Permalink
refactor(sanity): reverts changes to the potential ui for the future
Browse files Browse the repository at this point in the history
  • Loading branch information
RitaDias committed Aug 27, 2024
1 parent ab78ce7 commit 183f5bd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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 */

Expand All @@ -294,26 +289,24 @@ export const CommentsListItem = memo(function CommentsListItem(props: CommentsLi
onReactionSelect={onReactionSelect}
readOnly={readOnly}
withAvatar={avatarConfig.threadCommentsAvatar}
version={label}
/>
</Stack>
)),
[
splicedReplies,
avatarConfig.avatarSize,
avatarConfig.threadCommentsAvatar,
avatarConfig.avatarSize,
currentUser,
parentComment,
handleInputKeyDown,
mentionOptions,
mode,
onCopyLink,
onCreateRetry,
onDelete,
onEdit,
handleInputKeyDown,
onReactionSelect,
parentComment,
readOnly,
label,
splicedReplies,
mode,
],
)

Expand Down Expand Up @@ -363,7 +356,6 @@ export const CommentsListItem = memo(function CommentsListItem(props: CommentsLi
onStatusChange={onStatusChange}
readOnly={readOnly}
withAvatar={avatarConfig.parentCommentAvatar}
version={label}
/>
</Stack>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -338,9 +336,6 @@ export function CommentsListItemLayout(props: CommentsListItemLayoutProps) {
<TextSkeleton size={1} style={SKELETON_INLINE_STYLE} />
)

/* 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 (
<RootStack
data-menu-open={menuOpen ? 'true' : 'false'}
Expand Down

0 comments on commit 183f5bd

Please sign in to comment.