Fix UI issues, timer logic, theme switcher, view solutions, and markdown rendering
This commit is contained in:
@@ -132,7 +132,7 @@ export default function CBTPage() {
|
||||
</Badge>
|
||||
{exam.exam_pattern && (
|
||||
<Badge variant="outline" className="bg-primary/20 text-primary border-primary/30 uppercase tracking-wider text-[10px]">
|
||||
{exam.exam_pattern}
|
||||
{exam.exam_pattern === 'JEE_Main' ? 'JEE Main' : exam.exam_pattern === 'JEE_Advanced' ? 'JEE Advanced' : exam.exam_pattern}
|
||||
</Badge>
|
||||
)}
|
||||
</div>
|
||||
@@ -218,7 +218,7 @@ export default function CBTPage() {
|
||||
<div className="font-bold text-base md:text-lg text-[#00F0FF]">{Math.round(attempt.accuracy)}%</div>
|
||||
</div>
|
||||
<Link href={`/dashboard/cbt/history/${attempt.id}`}>
|
||||
<Button variant="outline" className="rounded-xl border-border hover:bg-secondary hover:text-foreground">
|
||||
<Button variant="outline" className="rounded-xl border-border hover:bg-primary hover:text-primary-foreground">
|
||||
View Solutions
|
||||
</Button>
|
||||
</Link>
|
||||
|
||||
@@ -78,6 +78,26 @@ export default function CommunityPage() {
|
||||
return true
|
||||
})
|
||||
|
||||
if (!hasAccessTo("ask-doubts-from-tutors")) {
|
||||
return (
|
||||
<div className="p-8 h-full flex flex-col items-center justify-center text-center animate-in fade-in zoom-in duration-500 max-w-2xl mx-auto">
|
||||
<div className="size-20 rounded-full bg-red-500/10 flex items-center justify-center mx-auto text-red-500 mb-6">
|
||||
<Lock size={40} />
|
||||
</div>
|
||||
<h2 className="text-3xl font-bold mb-4">Premium Feature</h2>
|
||||
<p className="text-muted-foreground text-lg mb-8">
|
||||
The Doubt Forum is a premium feature. Upgrade your plan to ask doubts and interact with tutors and the community.
|
||||
</p>
|
||||
<button
|
||||
className="px-8 py-3 bg-primary text-primary-foreground font-bold rounded-xl shadow-[0_0_20px_-5px_var(--color-primary)] text-lg"
|
||||
onClick={() => window.location.href = '/upgrade'}
|
||||
>
|
||||
Upgrade Plan
|
||||
</button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="p-8 space-y-6 animate-in fade-in slide-in-from-bottom-4 duration-500 max-w-5xl mx-auto">
|
||||
<div className="flex flex-col md:flex-row justify-between items-start md:items-end gap-4">
|
||||
@@ -88,17 +108,9 @@ export default function CommunityPage() {
|
||||
</h1>
|
||||
<p className="text-muted-foreground mt-2 font-medium">Ask questions, share knowledge, and learn together with the community.</p>
|
||||
</div>
|
||||
|
||||
{hasAccessTo("ask-doubts-from-tutors") ? (
|
||||
<button className="px-5 py-2.5 bg-[#00F0FF] text-black font-bold rounded-xl shadow-[0_0_15px_-3px_rgba(0,240,255,0.4)] hover:bg-[#00d0dd] transition-colors">
|
||||
Ask a Doubt
|
||||
</button>
|
||||
) : (
|
||||
<button disabled className="px-5 py-2.5 bg-secondary text-muted-foreground font-bold rounded-xl flex items-center gap-2 cursor-not-allowed">
|
||||
<Lock size={16} />
|
||||
Pro Feature
|
||||
</button>
|
||||
)}
|
||||
<button className="px-5 py-2.5 bg-[#00F0FF] text-black font-bold rounded-xl shadow-[0_0_15px_-3px_rgba(0,240,255,0.4)] hover:bg-[#00d0dd] transition-colors">
|
||||
Ask a Doubt
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div className="flex flex-col md:flex-row gap-4">
|
||||
|
||||
Reference in New Issue
Block a user