Skip to content

Commit

Permalink
fix(NoticeComment): fix archive article comment
Browse files Browse the repository at this point in the history
  • Loading branch information
wlliaml committed Sep 3, 2024
1 parent c0cd092 commit 5241e45
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 47 deletions.
15 changes: 8 additions & 7 deletions lang/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@
"/usqHn": {
"defaultMessage": "{displayName}'s creative space"
},
"/vyhs5": {
"defaultMessage": "Comment deleted",
"description": "src/components/Notice/NoticeComment.tsx"
},
"/wKyxw": {
"defaultMessage": "Failed to republish"
},
Expand Down Expand Up @@ -618,6 +614,10 @@
"defaultMessage": "Still quiet here. {br}Be the first one to say hello!",
"description": "src/components/Empty/EmptyComment.tsx"
},
"7zn5ig": {
"defaultMessage": "Comment deleted",
"description": "src/components/Notice/NoticeComment.tsx/article"
},
"8+Z5E9": {
"defaultMessage": "The badge signifies your participation and completion in the \"Free Write in 7 days\"."
},
Expand Down Expand Up @@ -889,6 +889,10 @@
"defaultMessage": "Copy comment",
"description": "src/components/Comment/DropdownActions/index.tsx"
},
"Ci7dxf": {
"defaultMessage": "Comment deleted",
"description": "src/components/Notice/NoticeComment.tsx/moment"
},
"CjKqYk": {
"defaultMessage": "Share a story from your life"
},
Expand Down Expand Up @@ -1486,9 +1490,6 @@
"N6PWfU": {
"defaultMessage": "Forget Password"
},
"N8ISx8": {
"defaultMessage": "Oops! This comment has been deleted by author"
},
"NACY16": {
"defaultMessage": "Why need to set up a wallet?",
"description": "src/components/Forms/PaymentForm/BindWallet/index.tsx"
Expand Down
15 changes: 8 additions & 7 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@
"/usqHn": {
"defaultMessage": "{displayName}'s creative space"
},
"/vyhs5": {
"defaultMessage": "Comment deleted",
"description": "src/components/Notice/NoticeComment.tsx"
},
"/wKyxw": {
"defaultMessage": "Failed to republish"
},
Expand Down Expand Up @@ -618,6 +614,10 @@
"defaultMessage": "Still quiet here. {br}Be the first one to say hello!",
"description": "src/components/Empty/EmptyComment.tsx"
},
"7zn5ig": {
"defaultMessage": "Comment deleted",
"description": "src/components/Notice/NoticeComment.tsx/article"
},
"8+Z5E9": {
"defaultMessage": "The badge signifies your participation and completion in the \"Free Write in 7 days\"."
},
Expand Down Expand Up @@ -889,6 +889,10 @@
"defaultMessage": "Copy comment",
"description": "src/components/Comment/DropdownActions/index.tsx"
},
"Ci7dxf": {
"defaultMessage": "Comment deleted",
"description": "src/components/Notice/NoticeComment.tsx/moment"
},
"CjKqYk": {
"defaultMessage": "Share a story from your life"
},
Expand Down Expand Up @@ -1486,9 +1490,6 @@
"N6PWfU": {
"defaultMessage": "Forget Password"
},
"N8ISx8": {
"defaultMessage": "Oops! This comment has been deleted by author"
},
"NACY16": {
"defaultMessage": "Why need to set up a wallet?",
"description": "src/components/Forms/PaymentForm/BindWallet/index.tsx"
Expand Down
15 changes: 8 additions & 7 deletions lang/zh-Hans.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@
"/usqHn": {
"defaultMessage": "{displayName} 的创作空间站"
},
"/vyhs5": {
"defaultMessage": "留言已删除",
"description": "src/components/Notice/NoticeComment.tsx"
},
"/wKyxw": {
"defaultMessage": "发布失败"
},
Expand Down Expand Up @@ -618,6 +614,10 @@
"defaultMessage": "暂无评论",
"description": "src/components/Empty/EmptyComment.tsx"
},
"7zn5ig": {
"defaultMessage": "评论已删除",
"description": "src/components/Notice/NoticeComment.tsx/article"
},
"8+Z5E9": {
"defaultMessage": "纪念你参与「七日书」并完成七天书写"
},
Expand Down Expand Up @@ -889,6 +889,10 @@
"defaultMessage": "复制留言",
"description": "src/components/Comment/DropdownActions/index.tsx"
},
"Ci7dxf": {
"defaultMessage": "留言已删除",
"description": "src/components/Notice/NoticeComment.tsx/moment"
},
"CjKqYk": {
"defaultMessage": "分享今天开心或难过的小故事吧"
},
Expand Down Expand Up @@ -1486,9 +1490,6 @@
"N6PWfU": {
"defaultMessage": "忘记密码"
},
"N8ISx8": {
"defaultMessage": "Oops!该评论已被原作者删除"
},
"NACY16": {
"defaultMessage": "为什么需要设定钱包 ?",
"description": "src/components/Forms/PaymentForm/BindWallet/index.tsx"
Expand Down
15 changes: 8 additions & 7 deletions lang/zh-Hant.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@
"/usqHn": {
"defaultMessage": "{displayName} 的創作空間站"
},
"/vyhs5": {
"defaultMessage": "留言已刪除",
"description": "src/components/Notice/NoticeComment.tsx"
},
"/wKyxw": {
"defaultMessage": "發布失敗"
},
Expand Down Expand Up @@ -618,6 +614,10 @@
"defaultMessage": "暫無評論",
"description": "src/components/Empty/EmptyComment.tsx"
},
"7zn5ig": {
"defaultMessage": "評論已刪除",
"description": "src/components/Notice/NoticeComment.tsx/article"
},
"8+Z5E9": {
"defaultMessage": "紀念你參與「七日書」並完成七天書寫"
},
Expand Down Expand Up @@ -889,6 +889,10 @@
"defaultMessage": "複製留言",
"description": "src/components/Comment/DropdownActions/index.tsx"
},
"Ci7dxf": {
"defaultMessage": "留言已刪除",
"description": "src/components/Notice/NoticeComment.tsx/moment"
},
"CjKqYk": {
"defaultMessage": "分享今天開心或難過的小故事吧"
},
Expand Down Expand Up @@ -1486,9 +1490,6 @@
"N6PWfU": {
"defaultMessage": "忘記密碼"
},
"N8ISx8": {
"defaultMessage": "Oops!該評論已被原作者刪除"
},
"NACY16": {
"defaultMessage": "為什麼需要設定錢包 ?",
"description": "src/components/Forms/PaymentForm/BindWallet/index.tsx"
Expand Down
34 changes: 15 additions & 19 deletions src/components/Notice/NoticeComment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ const NoticeComment = ({
return null
}

console.log({ comment })

if (
comment.state === 'banned' &&
((comment.parentComment === null && comment.comments?.totalCount === 0) ||
Expand Down Expand Up @@ -98,33 +100,27 @@ const NoticeComment = ({
<NoticeContentDigest
content={intl.formatMessage({
defaultMessage: 'Comment deleted',
description: 'src/components/Notice/NoticeComment.tsx',
id: '/vyhs5',
description: 'src/components/Notice/NoticeComment.tsx/moment',
id: 'Ci7dxf',
})}
color="grey"
/>
</section>
)
}

if (comment.state === 'archived') {
if (comment.state === 'archived' && article) {
return (
<button
onClick={() => {
toast.success({
message: (
<FormattedMessage
defaultMessage="Oops! This comment has been deleted by author"
id="N8ISx8"
/>
),
})
}}
>
<section>
<NoticeContentDigest content={comment.content || ''} />
</section>
</button>
<section>
<NoticeContentDigest
content={intl.formatMessage({
defaultMessage: 'Comment deleted',
description: 'src/components/Notice/NoticeComment.tsx/article',
id: '7zn5ig',
})}
color="grey"
/>
</section>
)
}

Expand Down

0 comments on commit 5241e45

Please sign in to comment.