From a38b65f5d43ee2d39a482bff2c3f19bc2834a4a2 Mon Sep 17 00:00:00 2001 From: Selwyn Ang Date: Thu, 14 Nov 2024 15:33:22 +0800 Subject: [PATCH] Fix category view of question form in non-admin account --- .../questions/question-form-modal.tsx | 36 +++++++++++-------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/frontend/components/questions/question-form-modal.tsx b/frontend/components/questions/question-form-modal.tsx index 94a7fb2828..3a449503a9 100644 --- a/frontend/components/questions/question-form-modal.tsx +++ b/frontend/components/questions/question-form-modal.tsx @@ -96,20 +96,28 @@ const QuestionFormModal: React.FC = ({ ...props }) => {
- ({ - label: category, - value: category, - }))} - onValueChange={(v) => - setQuestion({ - ...question, - categories: v as CategoryEnum[], - }) - } - /> + {props.isAdmin ? ( + ({ + label: category, + value: category, + }))} + onValueChange={(v) => + setQuestion({ + ...question, + categories: v as CategoryEnum[], + }) + } + /> + ) : ( + + )}