diff --git a/web/components/answers/answer-compatibility-question-button.tsx b/web/components/answers/answer-compatibility-question-button.tsx index 578b369..eb916b9 100644 --- a/web/components/answers/answer-compatibility-question-button.tsx +++ b/web/components/answers/answer-compatibility-question-button.tsx @@ -9,6 +9,7 @@ import router from "next/router"; import Link from "next/link"; import {useT} from 'web/lib/locale' import clsx from "clsx"; +import toast from "react-hot-toast"; export function AnswerCompatibilityQuestionButton(props: { user: User | null | undefined @@ -27,7 +28,7 @@ export function AnswerCompatibilityQuestionButton(props: { const [open, setOpen] = useState(fromSignup ?? false) const t = useT() if (!user) return null - if (otherQuestions.length === 0) return null + if (!fromSignup && otherQuestions.length === 0) return null const isCore = otherQuestions.some((q) => q.importance_score === 0) const questionsToAnswer = isCore ? otherQuestions.filter((q) => q.importance_score === 0) : otherQuestions return ( @@ -159,6 +160,11 @@ function AnswerCompatibilityQuestionModal(props: { const [showOnboarding, setShowOnboarding] = useState(fromSignup ?? false) const handleStartQuestions = () => { + if (otherQuestions.length === 0) { + toast.error('No questions to answer') + setOpen(false) + return + } setShowOnboarding(false) } diff --git a/web/components/answers/compatibility-questions-display.tsx b/web/components/answers/compatibility-questions-display.tsx index 7e6d021..fd0b1ef 100644 --- a/web/components/answers/compatibility-questions-display.tsx +++ b/web/components/answers/compatibility-questions-display.tsx @@ -180,7 +180,7 @@ export function CompatibilityQuestionsDisplay(props: { {isCurrentUser ? t('answers.display.your_prompts', 'Your Compatibility Prompts') - : t('answers.display.user_prompts', "{name}'s Compatibility Prompts", { name: shortenName(user.name) })} + : t('answers.display.user_prompts', "{name}'s Compatibility Prompts", {name: shortenName(user.name)})} {compatibilityScore && @@ -200,7 +200,7 @@ export function CompatibilityQuestionsDisplay(props: { {isCurrentUser ? t('answers.display.none_answered_you', "You haven't answered any compatibility questions yet!") - : t('answers.display.none_answered_user', "{name} hasn't answered any compatibility questions yet!", { name: user.name })}{' '} + : t('answers.display.none_answered_user', "{name} hasn't answered any compatibility questions yet!", {name: user.name})}{' '} {isCurrentUser && ( <>{t('answers.display.add_some', "Add some to better see who you'd be most compatible with.")} )} @@ -242,7 +242,7 @@ export function CompatibilityQuestionsDisplay(props: { )} )} - {otherQuestions.length >= 1 && isCurrentUser && !fromProfilePage && ( + {(fromSignup || otherQuestions.length >= 1 && isCurrentUser && !fromProfilePage) && ( 0 && (
- {preferredDoesNotIncludeAnswerText - ? t('answers.display.acceptable', 'Acceptable') - : t('answers.display.also_acceptable', 'Also acceptable')} + {preferredDoesNotIncludeAnswerText + ? t('answers.display.acceptable', 'Acceptable') + : t('answers.display.also_acceptable', 'Also acceptable')}
{distinctPreferredAnswersText.map((text) => ( @@ -653,10 +653,10 @@ function CompatibilityDisplay(props: { {question.question}
- {t('answers.modal.preferred_of_user', "{name}'s preferred answers", { name: shortenName(user1.name) })} + {t('answers.modal.preferred_of_user', "{name}'s preferred answers", {name: shortenName(user1.name)})}
- {t('answers.modal.user_marked', '{name} marked this as ', { name: shortenName(user1.name) })} + {t('answers.modal.user_marked', '{name} marked this as ', {name: shortenName(user1.name)})} @@ -677,12 +677,12 @@ function CompatibilityDisplay(props: {
{isCurrentUser ? t('answers.modal.your_preferred', 'Your preferred answers') - : t('answers.modal.preferred_of_user', "{name}'s preferred answers", { name: shortenName(user2.name) })} + : t('answers.modal.preferred_of_user', "{name}'s preferred answers", {name: shortenName(user2.name)})}
{isCurrentUser ? t('answers.modal.you_marked', 'You marked this as ') - : t('answers.modal.user_marked', '{name} marked this as ', { name: shortenName(user2.name) })} + : t('answers.modal.user_marked', '{name} marked this as ', {name: shortenName(user2.name)})}