Toggle visibility of comment UI based on policy (#5143)
This commit is contained in:
@@ -68,6 +68,8 @@ type Props = {
|
||||
lastOfAuthor?: boolean;
|
||||
/** The date of the previous comment in the thread */
|
||||
previousCommentCreatedAt?: string;
|
||||
/** Whether the user can reply in the thread */
|
||||
canReply: boolean;
|
||||
};
|
||||
|
||||
function CommentThreadItem({
|
||||
@@ -77,6 +79,7 @@ function CommentThreadItem({
|
||||
lastOfThread,
|
||||
dir,
|
||||
previousCommentCreatedAt,
|
||||
canReply,
|
||||
}: Props) {
|
||||
const { editor } = useDocumentContext();
|
||||
const { showToast } = useToasts();
|
||||
@@ -139,6 +142,7 @@ function CommentThreadItem({
|
||||
$firstOfAuthor={firstOfAuthor}
|
||||
$lastOfThread={lastOfThread}
|
||||
$dir={dir}
|
||||
$canReply={canReply}
|
||||
column
|
||||
>
|
||||
{(showAuthor || showTime) && (
|
||||
@@ -247,6 +251,7 @@ export const Bubble = styled(Flex)<{
|
||||
$firstOfThread?: boolean;
|
||||
$firstOfAuthor?: boolean;
|
||||
$lastOfThread?: boolean;
|
||||
$canReply?: boolean;
|
||||
$focused?: boolean;
|
||||
$dir?: "rtl" | "ltr";
|
||||
}>`
|
||||
@@ -260,8 +265,9 @@ export const Bubble = styled(Flex)<{
|
||||
padding: 8px 12px;
|
||||
transition: color 100ms ease-out, ${s("backgroundTransition")};
|
||||
|
||||
${({ $lastOfThread }) =>
|
||||
${({ $lastOfThread, $canReply }) =>
|
||||
$lastOfThread &&
|
||||
!$canReply &&
|
||||
"border-bottom-left-radius: 8px; border-bottom-right-radius: 8px"};
|
||||
|
||||
${({ $firstOfThread }) =>
|
||||
|
||||
Reference in New Issue
Block a user