From 4facebd309262979dfbc423212801ace7b54cd0d Mon Sep 17 00:00:00 2001 From: Jeff Sieu Date: Wed, 26 Oct 2022 18:31:30 +0800 Subject: [PATCH] [questions][ui] add no similar questions hint --- .../questions/forms/ContributeQuestionForm.tsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/apps/portal/src/components/questions/forms/ContributeQuestionForm.tsx b/apps/portal/src/components/questions/forms/ContributeQuestionForm.tsx index 019b0165..29e1b3eb 100644 --- a/apps/portal/src/components/questions/forms/ContributeQuestionForm.tsx +++ b/apps/portal/src/components/questions/forms/ContributeQuestionForm.tsx @@ -202,10 +202,12 @@ export default function ContributeQuestionForm({ key={question.id} content={question.content} questionId={question.id} - timestamp={question.lastSeenAt?.toLocaleDateString(undefined, { - month: 'short', - year: 'numeric', - }) ?? null} + timestamp={ + question.lastSeenAt?.toLocaleDateString(undefined, { + month: 'short', + year: 'numeric', + }) ?? null + } type={question.questionType} onSimilarQuestionClick={() => { // eslint-disable-next-line no-console @@ -213,6 +215,9 @@ export default function ContributeQuestionForm({ }} /> ))} + {similarQuestions?.length === 0 && ( +

No similar questions found.

+ )}