From 6cd299f2add65dc0c83bad17d434912df0058a4b Mon Sep 17 00:00:00 2001 From: bluecloud <96812901+pitb2022@users.noreply.github.com> Date: Tue, 3 Sep 2024 16:36:37 +0800 Subject: [PATCH] feat(NoticeArticleTitle): update archived title --- lang/default.json | 4 ++++ lang/en.json | 4 ++++ lang/zh-Hans.json | 4 ++++ lang/zh-Hant.json | 4 ++++ src/components/Notice/NoticeArticleTitle.tsx | 15 +++++++++++++-- 5 files changed, 29 insertions(+), 2 deletions(-) diff --git a/lang/default.json b/lang/default.json index 8b24dfc52c..2d10896945 100644 --- a/lang/default.json +++ b/lang/default.json @@ -3532,6 +3532,10 @@ "z3uIHQ": { "defaultMessage": "Undo upvote" }, + "z91BKe": { + "defaultMessage": "Archived Work", + "description": "src/components/Notice/NoticeArticleTitle.tsx" + }, "zAK5G+": { "defaultMessage": "The login link has been sent to {email}", "description": "src/components/Forms/Verification/LinkSent.tsx" diff --git a/lang/en.json b/lang/en.json index 82f5192358..65438ff0f7 100644 --- a/lang/en.json +++ b/lang/en.json @@ -3532,6 +3532,10 @@ "z3uIHQ": { "defaultMessage": "Undo upvote" }, + "z91BKe": { + "defaultMessage": "Archived Work", + "description": "src/components/Notice/NoticeArticleTitle.tsx" + }, "zAK5G+": { "defaultMessage": "The login link has been sent to {email}", "description": "src/components/Forms/Verification/LinkSent.tsx" diff --git a/lang/zh-Hans.json b/lang/zh-Hans.json index 66f536ad7d..7bddb86514 100644 --- a/lang/zh-Hans.json +++ b/lang/zh-Hans.json @@ -3532,6 +3532,10 @@ "z3uIHQ": { "defaultMessage": "取消点赞" }, + "z91BKe": { + "defaultMessage": "已归档作品", + "description": "src/components/Notice/NoticeArticleTitle.tsx" + }, "zAK5G+": { "defaultMessage": "登录链接已发送至 {email}", "description": "src/components/Forms/Verification/LinkSent.tsx" diff --git a/lang/zh-Hant.json b/lang/zh-Hant.json index 2ccfd46a52..c5bbdca94e 100644 --- a/lang/zh-Hant.json +++ b/lang/zh-Hant.json @@ -3532,6 +3532,10 @@ "z3uIHQ": { "defaultMessage": "取消點讚" }, + "z91BKe": { + "defaultMessage": "已封存作品", + "description": "src/components/Notice/NoticeArticleTitle.tsx" + }, "zAK5G+": { "defaultMessage": "登入連結已發送至 {email}", "description": "src/components/Forms/Verification/LinkSent.tsx" diff --git a/src/components/Notice/NoticeArticleTitle.tsx b/src/components/Notice/NoticeArticleTitle.tsx index 4206eba4f3..4c7b1934c6 100644 --- a/src/components/Notice/NoticeArticleTitle.tsx +++ b/src/components/Notice/NoticeArticleTitle.tsx @@ -1,10 +1,11 @@ import gql from 'graphql-tag' import Link from 'next/link' +import { FormattedMessage } from 'react-intl' import { TEST_ID } from '~/common/enums' import { toPath } from '~/common/utils' import { ArticleDigestTitle } from '~/components/ArticleDigest' -import { NoticeArticleTitleFragment } from '~/gql/graphql' +import { ArticleState, NoticeArticleTitleFragment } from '~/gql/graphql' import styles from './styles.module.css' @@ -24,6 +25,8 @@ const NoticeArticleTitle = ({ article, }) + const isArchived = article.articleState === ArticleState.Archived + if (!isBlock) { return ( @@ -31,7 +34,15 @@ const NoticeArticleTitle = ({ className={styles.noticeArticleTitle} data-test-id={TEST_ID.NOTICE_ARTICLE_TITLE} > - {article.title} + {isArchived ? ( + + ) : ( + article.title + )} )