fix: resolve Next.js rendering errors, hook unhandled fetch error, theme logo layout, double header, and FastAPI multipart dependency

This commit is contained in:
2026-07-07 13:56:32 +05:30
parent 04db17ea0e
commit 22549edcdb
5 changed files with 26 additions and 20 deletions

View File

@@ -41,20 +41,24 @@ export default function DashboardLayout({ children }: { children: ReactNode }) {
<aside className="w-64 border-r border-border bg-background flex flex-col hidden md:flex">
<div className="p-6">
<Link href="/dashboard" className="block relative h-16 w-full hover:opacity-90 transition-opacity">
<Image
src="/PragatiVeer_Logo/SVG_Logos/Rectangular_light_background.svg"
alt="PragatiVeer"
fill
className="object-contain object-left scale-135 origin-left dark:hidden"
priority
/>
<Image
src="/PragatiVeer_Logo/SVG_Logos/Rectangular_dark_background.svg"
alt="PragatiVeer"
fill
className="object-contain object-left scale-135 origin-left hidden dark:block"
priority
/>
<div className="absolute inset-0 dark:hidden">
<Image
src="/PragatiVeer_Logo/SVG_Logos/Rectangular_light_background.svg"
alt="PragatiVeer"
fill
className="object-contain object-left"
priority
/>
</div>
<div className="absolute inset-0 hidden dark:block">
<Image
src="/PragatiVeer_Logo/SVG_Logos/Rectangular_dark_background.svg"
alt="PragatiVeer"
fill
className="object-contain object-left"
priority
/>
</div>
</Link>
</div>
<nav className="flex-1 px-4 space-y-1.5 mt-4 overflow-y-auto">

View File

@@ -28,11 +28,7 @@ export default function DashboardPage() {
return (
<div className="p-8 max-w-6xl mx-auto space-y-10 animate-in fade-in duration-500 slide-in-from-bottom-4">
<header className="flex flex-col md:flex-row md:items-center justify-between gap-4">
<div>
<h1 className="text-3xl font-bold tracking-tight">Welcome back, Demo Student</h1>
<p className="text-muted-foreground mt-1 font-medium">Let's keep up the momentum for JEE Advanced 2027.</p>
</div>
<header className="flex justify-end mb-2">
<Button size="lg" className="gap-2 shadow-sm bg-[#00F0FF] text-background hover:bg-[#00F0FF]/90 font-bold">
<BrainCircuit size={18} />
Generate AI Plan

View File

@@ -1,3 +1,5 @@
"use client";
import { useEffect, useState } from "react";
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
import { Button } from "@/components/ui/button";

View File

@@ -44,7 +44,10 @@ export function useActiveUser() {
try {
const res = await fetch(`/api/users/${id}`);
if (!res.ok) {
throw new Error("Failed to fetch user profile");
console.error("Failed to fetch user profile, status:", res.status);
setError("Failed to fetch user profile");
setUser(null);
return;
}
const data = await res.json();
setUser(data);