-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip: enhance question handling with new answer types and toggle funct…
…ionality, updated layout and components (needs refactor)
- Loading branch information
Showing
6 changed files
with
165 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,36 @@ | ||
"use client"; | ||
// "use client"; | ||
|
||
import { BottomBar, QuestionWrapper } from "@repo/design-system/ui"; | ||
import { useQuestionsStore } from "../providers/storeProvider"; | ||
import { Question } from "@repo/schema/dist"; | ||
// import { BottomBar, QuestionWrapper } from "@repo/design-system/ui"; | ||
// import { useQuestionsStore } from "../providers/storeProvider"; | ||
// import { Question } from "@repo/schema/dist"; | ||
|
||
type ExtendedQuestions = Question & { | ||
isImportant: true | false | null; | ||
answerType: true | false | null; | ||
}; | ||
// type ExtendedQuestions = Question & { | ||
// isImportant: true | false | null; | ||
// answerType: true | false | null; | ||
// }; | ||
|
||
export default function Page() { | ||
const questions = useQuestionsStore((state) => state.questions); | ||
const currentQuestion = useQuestionsStore((state) => state.currentQuestion); | ||
const prevQuestion = useQuestionsStore((state) => state.prevQuestion); | ||
const skipQuestion = useQuestionsStore((state) => state.skipQuestion); | ||
return ( | ||
<main className="flex min-h-screen flex-col items-center p-24"> | ||
<div className="bg-red-200"> | ||
<h2>Collection</h2> | ||
{questions?.map((item: Question, index) => { | ||
if (currentQuestion === index + 1) { | ||
return ( | ||
<div key={index} className="m-4 bg-red-400"> | ||
<span>{item.statement}</span> | ||
</div> | ||
); | ||
} | ||
})} | ||
</div> | ||
// export default function Page() { | ||
// const questions = useQuestionsStore((state) => state.questions); | ||
// const currentQuestion = useQuestionsStore((state) => state.currentQuestion); | ||
// const prevQuestion = useQuestionsStore((state) => state.prevQuestion); | ||
// const skipQuestion = useQuestionsStore((state) => state.skipQuestion); | ||
// return ( | ||
// <main className="flex min-h-screen flex-col items-center p-24"> | ||
// <div className="bg-red-200"> | ||
// <h2>Collection</h2> | ||
// {questions?.map((item: Question, index) => { | ||
// if (currentQuestion === index + 1) { | ||
// return ( | ||
// <div key={index} className="m-4 bg-red-400"> | ||
// <span>{item.statement}</span> | ||
// </div> | ||
// ); | ||
// } | ||
// })} | ||
// </div> | ||
|
||
<button onClick={skipQuestion}>Skip question</button> | ||
<button onClick={prevQuestion}>Prev question</button> | ||
</main> | ||
); | ||
} | ||
// <button onClick={skipQuestion}>Skip question</button> | ||
// <button onClick={prevQuestion}>Prev question</button> | ||
// </main> | ||
// ); | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters