fix: Resolve redundant quiz titles by merging them into the page header
All checks were successful
Automated Container Build / build-and-push (push) Successful in 55s
All checks were successful
Automated Container Build / build-and-push (push) Successful in 55s
This commit is contained in:
parent
d3d094e442
commit
2457bfcb39
3 changed files with 64 additions and 34 deletions
|
|
@ -47,7 +47,6 @@ export function QuizViewer({ quiz, retakeIds, isShared = false, onFinished }: Qu
|
|||
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [resultsData, setResultsData] = useState<any | null>(null);
|
||||
const [showTopics, setShowTopics] = useState(false);
|
||||
|
||||
// Initialize session
|
||||
useEffect(() => {
|
||||
|
|
@ -268,35 +267,9 @@ export function QuizViewer({ quiz, retakeIds, isShared = false, onFinished }: Qu
|
|||
return <div>Question not found.</div>;
|
||||
}
|
||||
|
||||
const categories = Array.from(new Set(quiz.questions.map(q => q.category.toUpperCase()))).join(" · ");
|
||||
|
||||
return (
|
||||
<div className="flex flex-col items-center">
|
||||
|
||||
{/* Title & Meta */}
|
||||
<div className="w-full max-w-3xl mb-6 text-left">
|
||||
<button
|
||||
onClick={() => setShowTopics(!showTopics)}
|
||||
className="flex items-center gap-2 group cursor-pointer text-left focus:outline-none"
|
||||
>
|
||||
<h1 className="text-3xl font-bold font-serif text-text-heading group-hover:text-primary transition-colors">
|
||||
{quiz.name}
|
||||
</h1>
|
||||
<svg
|
||||
className={`w-6 h-6 text-text-muted transition-transform duration-200 ${showTopics ? "rotate-180" : ""}`}
|
||||
fill="none" viewBox="0 0 24 24" stroke="currentColor"
|
||||
>
|
||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 9l-7 7-7-7" />
|
||||
</svg>
|
||||
</button>
|
||||
|
||||
{showTopics && (
|
||||
<div className="text-sm tracking-widest text-text-muted font-medium mt-3 animate-in fade-in slide-in-from-top-2 duration-200 leading-relaxed">
|
||||
{categories}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Main Unified Card */}
|
||||
<div className="w-full max-w-3xl bg-bg-surface-alt rounded-2xl border border-border-light shadow-[var(--shadow-card)] overflow-hidden mb-8">
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue