diff --git a/src/pages/questions/QuestionDisplay.jsx b/src/pages/questions/QuestionDisplay.jsx index 7dc20b8fc..67e93bd16 100644 --- a/src/pages/questions/QuestionDisplay.jsx +++ b/src/pages/questions/QuestionDisplay.jsx @@ -57,13 +57,67 @@ const getValueTagExamplesURL = (question) => { return ""; }; -const QuestionDisplay = ({ question, answerQuestion }) => { +const QuestionDisplay = ({ question, answerQuestion, resetFilters }) => { const { t } = useTranslation(); const valueTagQuestionsURL = getValueTagQuestionsURL(question); const valueTagExamplesURL = getValueTagExamplesURL(question); if (question === NO_QUESTION_LEFT) { - return
{t("questions.no_questions_remaining")}
; + return ( +loading
; diff --git a/src/pages/questions/index.jsx b/src/pages/questions/index.jsx index e9908f3f4..dadd239ac 100644 --- a/src/pages/questions/index.jsx +++ b/src/pages/questions/index.jsx @@ -18,6 +18,15 @@ export default function Questions() { useQuestionBuffer(filterState); const question = buffer[0] ?? null; + const resetFilters = React.useCallback( + () => + setFilterState((prevState) => ({ + insightType: prevState.insightType, + sortByPopularity: prevState.sortByPopularity, + })), + [setFilterState] + ); + return (