From 9bf57ab44ebc9f8c8930bbe53ae6457121799510 Mon Sep 17 00:00:00 2001 From: bluecloud <96812901+pitb2022@users.noreply.github.com> Date: Tue, 5 Mar 2024 15:34:23 +0800 Subject: [PATCH 1/3] fix(ArticleDetail): fix comment detail style --- src/views/ArticleDetail/Comments/CommentDetail/index.tsx | 3 ++- .../ArticleDetail/Comments/CommentDetail/styles.module.css | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 src/views/ArticleDetail/Comments/CommentDetail/styles.module.css diff --git a/src/views/ArticleDetail/Comments/CommentDetail/index.tsx b/src/views/ArticleDetail/Comments/CommentDetail/index.tsx index e23693d932..5927c1d104 100644 --- a/src/views/ArticleDetail/Comments/CommentDetail/index.tsx +++ b/src/views/ArticleDetail/Comments/CommentDetail/index.tsx @@ -10,6 +10,7 @@ import { CommentDetailQuery } from '~/gql/graphql' import { Placeholder } from '../Placeholder' import { COMMENT_DETAIL } from './gql' +import styles from './styles.module.css' const CommentDetail = () => { /** @@ -110,7 +111,7 @@ const CommentDetail = () => { const comment = data?.node as ThreadCommentType return ( -
+
Date: Tue, 5 Mar 2024 17:37:47 +0800 Subject: [PATCH 2/3] feat(Notice): adjust comment notice jump logic --- lang/default.json | 3 +++ lang/en.json | 3 +++ lang/zh-Hans.json | 3 +++ lang/zh-Hant.json | 3 +++ src/components/Notice/NoticeComment.tsx | 26 ++++++++++++++++++++++--- 5 files changed, 35 insertions(+), 3 deletions(-) diff --git a/lang/default.json b/lang/default.json index f9f9383492..4519f2ec2d 100644 --- a/lang/default.json +++ b/lang/default.json @@ -1057,6 +1057,9 @@ "N2IrpM": { "defaultMessage": "Confirm" }, + "N8ISx8": { + "defaultMessage": "Oops! This comment has been deleted by author" + }, "NAidKb": { "defaultMessage": "Notifications" }, diff --git a/lang/en.json b/lang/en.json index 6e1b2e17cf..b879cf5330 100644 --- a/lang/en.json +++ b/lang/en.json @@ -1057,6 +1057,9 @@ "N2IrpM": { "defaultMessage": "Confirm" }, + "N8ISx8": { + "defaultMessage": "Oops! This comment has been deleted by author" + }, "NAidKb": { "defaultMessage": "Notifications" }, diff --git a/lang/zh-Hans.json b/lang/zh-Hans.json index 03e2b5dd86..8ca9ad5eaf 100644 --- a/lang/zh-Hans.json +++ b/lang/zh-Hans.json @@ -1057,6 +1057,9 @@ "N2IrpM": { "defaultMessage": "确认" }, + "N8ISx8": { + "defaultMessage": "Oops!该评论已被原作者删除" + }, "NAidKb": { "defaultMessage": "通知" }, diff --git a/lang/zh-Hant.json b/lang/zh-Hant.json index 52d14b8db3..d94bdfffd9 100644 --- a/lang/zh-Hant.json +++ b/lang/zh-Hant.json @@ -1057,6 +1057,9 @@ "N2IrpM": { "defaultMessage": "確認" }, + "N8ISx8": { + "defaultMessage": "Oops!該評論已被原作者刪除" + }, "NAidKb": { "defaultMessage": "通知" }, diff --git a/src/components/Notice/NoticeComment.tsx b/src/components/Notice/NoticeComment.tsx index 3afeaa4f8a..93e9e67c59 100644 --- a/src/components/Notice/NoticeComment.tsx +++ b/src/components/Notice/NoticeComment.tsx @@ -1,7 +1,8 @@ import gql from 'graphql-tag' +import { FormattedMessage } from 'react-intl' import { toPath } from '~/common/utils' -import { LinkWrapper } from '~/components' +import { LinkWrapper, toast } from '~/components' import CommentContent from '~/components/Comment/Content' import { NoticeCommentFragment } from '~/gql/graphql' @@ -54,8 +55,28 @@ const NoticeComment = ({ return null } + if (comment.state === 'archived') { + return ( + + ) + } const path = - comment.state === 'active' + comment.state === 'active' || comment.state === 'collapsed' ? toPath({ page: 'commentDetail', comment, @@ -63,7 +84,6 @@ const NoticeComment = ({ circle, }) : { href: '' } - return (
From a479d1e47bca00c7c53743db398eb5ee6258f7c5 Mon Sep 17 00:00:00 2001 From: bluecloud <96812901+pitb2022@users.noreply.github.com> Date: Tue, 5 Mar 2024 17:39:38 +0800 Subject: [PATCH 3/3] feat(CommentBeta): revise archived comment style --- src/components/CommentBeta/Content/index.tsx | 3 ++- src/components/CommentBeta/Content/styles.module.css | 6 ------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/components/CommentBeta/Content/index.tsx b/src/components/CommentBeta/Content/index.tsx index 984d54a2ee..eec5ed4e1e 100644 --- a/src/components/CommentBeta/Content/index.tsx +++ b/src/components/CommentBeta/Content/index.tsx @@ -61,6 +61,7 @@ const Content = ({ const contentClasses = classNames({ [styles.content]: true, [size ? styles[`size${capitalizeFirstLetter(size)}`] : '']: !!size, + [styles.inactive]: state === 'archived', }) if (state === 'collapsed' || state === 'banned' || isBlocked) { @@ -104,7 +105,7 @@ const Content = ({ if (state === 'archived') { return ( -

+