diff --git a/src/components/Questions/QuestionCard.tsx b/src/components/Questions/QuestionCard.tsx index 500f1502b..2b804b3fa 100644 --- a/src/components/Questions/QuestionCard.tsx +++ b/src/components/Questions/QuestionCard.tsx @@ -22,10 +22,10 @@ export function QuestionCard() { // if the user has scrolled down and the top of the answer is not // visible, scroll to the top of the answer - const questionTop = questionRef.current?.getBoundingClientRect().top || 0; + const questionTop = (questionRef.current?.getBoundingClientRect().top || 0) - 147; if (questionTop < 0) { window.scrollTo({ - top: window.scrollY + questionTop - 100, + top: window.scrollY + questionTop - 10, }); } }, [isAnswerVisible]); diff --git a/src/components/Questions/QuestionsList.tsx b/src/components/Questions/QuestionsList.tsx index eea75dce7..241880176 100644 --- a/src/components/Questions/QuestionsList.tsx +++ b/src/components/Questions/QuestionsList.tsx @@ -4,6 +4,7 @@ import { QuestionsProgress } from './QuestionsProgress'; import { CheckCircle, SkipForward, Sparkles } from 'lucide-react'; import { QuestionCard } from './QuestionCard'; import { QuestionLoader } from './QuestionLoader'; +import { isLoggedIn } from '../../lib/jwt'; type ConfettiPosition = { x: number; @@ -14,6 +15,7 @@ type ConfettiPosition = { export function QuestionsList() { const [isLoading, setIsLoading] = useState(false); + const [givenAnswers, setGivenAnswers] = useState([]); const [confettiPos, setConfettiPos] = useState( undefined ); @@ -22,7 +24,9 @@ export function QuestionsList() { return (
- + {confettiPos && ( [...prev, 'alreadyKnow']); }} className="flex flex-1 items-center rounded-xl border border-gray-300 bg-white py-3 px-4 text-black transition-colors hover:border-black hover:bg-black hover:text-white" > diff --git a/src/components/Questions/QuestionsProgress.tsx b/src/components/Questions/QuestionsProgress.tsx index 7116b7f57..566d182db 100644 --- a/src/components/Questions/QuestionsProgress.tsx +++ b/src/components/Questions/QuestionsProgress.tsx @@ -1,15 +1,15 @@ -import { - Check, - CheckCircle, - Lightbulb, - PartyPopper, - RotateCcw, - Sparkles, -} from 'lucide-react'; +import { CheckCircle, RotateCcw, Sparkles } from 'lucide-react'; +import { showLoginPopup } from '../../lib/popup'; + +type QuestionsProgressProps = { + showLoginAlert?: boolean; +}; + +export function QuestionsProgress(props: QuestionsProgressProps) { + const { showLoginAlert } = props; -export function QuestionsProgress() { return ( -
+
@@ -40,12 +40,19 @@ export function QuestionsProgress() {
-

- You progress will not be saved. Please{' '} - -

+ {showLoginAlert && ( +

+ You progress is not saved. Please{' '} + +

+ )}
); }