[questions][ui] fix no similar question bug

pull/514/head
wlren 3 years ago
parent cdf1d3d934
commit 2147d0fdc0

@ -5,7 +5,7 @@ import { ArrowPathIcon } from '@heroicons/react/20/solid';
import type { QuestionsQuestionType } from '@prisma/client'; import type { QuestionsQuestionType } from '@prisma/client';
import type { TypeaheadOption } from '@tih/ui'; import type { TypeaheadOption } from '@tih/ui';
import { CheckboxInput } from '@tih/ui'; import { CheckboxInput } from '@tih/ui';
import { Button, HorizontalDivider, Select, TextArea } from '@tih/ui'; import { Button, Select, TextArea } from '@tih/ui';
import { QUESTION_TYPES } from '~/utils/questions/constants'; import { QUESTION_TYPES } from '~/utils/questions/constants';
import relabelQuestionAggregates from '~/utils/questions/relabelQuestionAggregates'; import relabelQuestionAggregates from '~/utils/questions/relabelQuestionAggregates';
@ -187,11 +187,9 @@ export default function ContributeQuestionForm({
/> />
</div> </div>
</div> </div>
<div className="w-full">
<HorizontalDivider />
</div>
<h2 <h2
className="text-primary-900 mb-3 className="text-primary-900
text-lg font-semibold text-lg font-semibold
"> ">
Are these questions the same as yours? Are these questions the same as yours?
@ -243,7 +241,9 @@ export default function ContributeQuestionForm({
/> />
); );
})} })}
{similarQuestions?.length === 0 && ( {similarQuestions?.length === 0 &&
contentToCheck?.length !== 0 &&
questionContent === contentToCheck && (
<p className="font-semibold text-slate-900"> <p className="font-semibold text-slate-900">
No similar questions found. No similar questions found.
</p> </p>

Loading…
Cancel
Save