From 275b7d2015a2834e61aedfe2aebd34250b0ce200 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Mon, 5 Jul 2021 20:35:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=B8=BA0=E6=97=B6=E4=B8=8D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Main/IndexItem.js | 14 ++++++++++++-- src/forge/users/Infos.js | 13 +++++++++++-- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/forge/Main/IndexItem.js b/src/forge/Main/IndexItem.js index 38d80aa63..fcfa2d2af 100644 --- a/src/forge/Main/IndexItem.js +++ b/src/forge/Main/IndexItem.js @@ -60,8 +60,18 @@ class IndexItem extends Component { } - 赞 {item.praises_count} - fork {item.forked_count} + { + item.praises_count && item.praises_count>0 ? + + 赞 {item.praises_count} + :"" + } + { + item.forked_count && item.forked_count>0 ? + + fork {item.forked_count} + :"" + }

{item.description}

diff --git a/src/forge/users/Infos.js b/src/forge/users/Infos.js index 34c6808ef..a588cb8b2 100644 --- a/src/forge/users/Infos.js +++ b/src/forge/users/Infos.js @@ -285,7 +285,11 @@ class Infos extends Component { 项目 { current_user && user && user.login === current_user.login ? - 待办事项({undo_events}) + + + 待办事项 + {undo_events && undo_events >0 ? ({undo_events}):""} + :"" } { @@ -293,7 +297,12 @@ class Infos extends Component { DevOps工作流 :"" } - 组织({user && user.user_org_count}) + + + 组织 + { user && user.user_org_count && user.user_org_count > 0 ? ({user.user_org_count}):""} + + } {user && (