Skip to content

Commit

Permalink
feat(NoticeArticleTitle): update archived title
Browse files Browse the repository at this point in the history
  • Loading branch information
wlliaml committed Sep 3, 2024
1 parent 5241e45 commit 6cd299f
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 2 deletions.
4 changes: 4 additions & 0 deletions lang/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 4 additions & 0 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 4 additions & 0 deletions lang/zh-Hans.json
Original file line number Diff line number Diff line change
Expand Up @@ -3532,6 +3532,10 @@
"z3uIHQ": {
"defaultMessage": "取消点赞"
},
"z91BKe": {
"defaultMessage": "已归档作品",
"description": "src/components/Notice/NoticeArticleTitle.tsx"
},
"zAK5G+": {
"defaultMessage": "登录链接已发送至 {email}",
"description": "src/components/Forms/Verification/LinkSent.tsx"
Expand Down
4 changes: 4 additions & 0 deletions lang/zh-Hant.json
Original file line number Diff line number Diff line change
Expand Up @@ -3532,6 +3532,10 @@
"z3uIHQ": {
"defaultMessage": "取消點讚"
},
"z91BKe": {
"defaultMessage": "已封存作品",
"description": "src/components/Notice/NoticeArticleTitle.tsx"
},
"zAK5G+": {
"defaultMessage": "登入連結已發送至 {email}",
"description": "src/components/Forms/Verification/LinkSent.tsx"
Expand Down
15 changes: 13 additions & 2 deletions src/components/Notice/NoticeArticleTitle.tsx
Original file line number Diff line number Diff line change
@@ -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'

Expand All @@ -24,14 +25,24 @@ const NoticeArticleTitle = ({
article,
})

const isArchived = article.articleState === ArticleState.Archived

if (!isBlock) {
return (
<Link {...path}>
<a
className={styles.noticeArticleTitle}
data-test-id={TEST_ID.NOTICE_ARTICLE_TITLE}
>
{article.title}
{isArchived ? (
<FormattedMessage
defaultMessage="Archived Work"
id="z91BKe"
description="src/components/Notice/NoticeArticleTitle.tsx"
/>
) : (
article.title
)}
</a>
</Link>
)
Expand Down

0 comments on commit 6cd299f

Please sign in to comment.