From e0ffb9670d76db0019153845d8bb29d63912df1e Mon Sep 17 00:00:00 2001 From: shuai Date: Fri, 18 Oct 2024 15:25:22 +0800 Subject: [PATCH] fix: linked question component not use empty content --- ui/src/components/Modal/BadgeModal.tsx | 1 - .../components/LinkedQuestions/index.tsx | 66 ++++++++----------- 2 files changed, 28 insertions(+), 39 deletions(-) diff --git a/ui/src/components/Modal/BadgeModal.tsx b/ui/src/components/Modal/BadgeModal.tsx index 185248526..5cb6c3603 100644 --- a/ui/src/components/Modal/BadgeModal.tsx +++ b/ui/src/components/Modal/BadgeModal.tsx @@ -98,7 +98,6 @@ const BadgeModal: FC = ({ badge, visible }) => { }; const destroyAnimation = () => { - console.log('destroyAnimation'); clearTimeout(timeout); bg1?.destroy(); bg2?.destroy(); diff --git a/ui/src/pages/Questions/Detail/components/LinkedQuestions/index.tsx b/ui/src/pages/Questions/Detail/components/LinkedQuestions/index.tsx index 0706cc4bf..208953b6e 100644 --- a/ui/src/pages/Questions/Detail/components/LinkedQuestions/index.tsx +++ b/ui/src/pages/Questions/Detail/components/LinkedQuestions/index.tsx @@ -58,45 +58,35 @@ const Index: FC = ({ id }) => { - {data.list.length > 0 ? ( - data.list.map((item) => ( - -
{item.title}
- {item.answer_count > 0 && ( -
( + +
{item.title}
+ {item.answer_count > 0 && ( +
0 + ? 'link-success' + : 'link-secondary' + }`}> + 0 - ? 'link-success' - : 'link-secondary' - }`}> - 0 - ? 'check-circle-fill' - : 'chat-square-text-fill' - } - className="me-1" - /> - - {item.answer_count} {t2('answers')} - -
- )} -
- )) - ) : ( -
- {t('no_linked_question')} -
- )} + ? 'check-circle-fill' + : 'chat-square-text-fill' + } + className="me-1" + /> + + {item.answer_count} {t2('answers')} + +
+ )} +
+ ))}
);