From b7152d5f0d45230786d6517bbf13064ef41825a5 Mon Sep 17 00:00:00 2001 From: shuai Date: Fri, 30 Dec 2022 17:30:10 +0800 Subject: [PATCH] fix: question list add operator info --- ui/src/components/Header/index.tsx | 8 ++- ui/src/components/QuestionList/index.tsx | 68 +++++------------------- 2 files changed, 20 insertions(+), 56 deletions(-) diff --git a/ui/src/components/Header/index.tsx b/ui/src/components/Header/index.tsx index a66b26ab..db052484 100644 --- a/ui/src/components/Header/index.tsx +++ b/ui/src/components/Header/index.tsx @@ -126,7 +126,13 @@ const Header: FC = () => { ) : ( <> - {loginSetting.allow_new_registrations && ( diff --git a/ui/src/components/QuestionList/index.tsx b/ui/src/components/QuestionList/index.tsx index fcf0e141..1565891e 100644 --- a/ui/src/components/QuestionList/index.tsx +++ b/ui/src/components/QuestionList/index.tsx @@ -28,60 +28,6 @@ interface Props { source: 'questions' | 'tag'; } -const QuestionLastUpdate = ({ q, order }) => { - const { t } = useTranslation('translation', { keyPrefix: 'question' }); - if (order !== 'newest' && q.update_time > q.edit_time) { - // question answered - return ( -
- - • - -
- ); - } - - if (order !== 'newest' && q.edit_time > q.update_time) { - // question modified - return ( -
- - • - -
- ); - } - - // default: asked - return ( -
- - • - -
- ); -}; - const QuestionList: FC = ({ source }) => { const { t } = useTranslation('translation', { keyPrefix: 'question' }); const { tagName = '' } = useParams(); @@ -132,7 +78,19 @@ const QuestionList: FC = ({ source }) => {
- +
+ + • + +