From 0ea199c0fe6f5260c883e6275cf560fd767ff436 Mon Sep 17 00:00:00 2001 From: shafin-r Date: Fri, 25 Jul 2025 19:09:06 +0600 Subject: [PATCH] fix(ui): fix question item answer indexing in results page --- app/(tabs)/profile/page.tsx | 46 ++++++++++++++++++--- app/exam/results/page.tsx | 2 +- components/ProfileManager.tsx | 75 +++++++++++++++++++---------------- components/QuestionItem.tsx | 2 +- 4 files changed, 82 insertions(+), 43 deletions(-) diff --git a/app/(tabs)/profile/page.tsx b/app/(tabs)/profile/page.tsx index 86bbd0c..3006966 100644 --- a/app/(tabs)/profile/page.tsx +++ b/app/(tabs)/profile/page.tsx @@ -2,8 +2,6 @@ import ProfileManager from "@/components/ProfileManager"; import { Avatar, AvatarFallback } from "@/components/ui/avatar"; -import { Input } from "@/components/ui/input"; -import { Label } from "@/components/ui/label"; import { getToken, API_URL } from "@/lib/auth"; import { ChevronLeft, Edit2, Lock, Save } from "lucide-react"; import { useRouter } from "next/navigation"; @@ -49,8 +47,34 @@ const ProfilePage = () => { fetchUser(); }, []); + const handleSave = async () => { + // try { + // const token = await getToken(); + // if (!token || !userData) return; + + // const response = await fetch(`${API_URL}/profile/edit`, { + // method: "POST", + // headers: { + // "Content-Type": "application/json", + // Authorization: `Bearer ${token}`, + // }, + // body: JSON.stringify(userData), + // }); + + // if (response.ok) { + // setEditStatus(false); + // } else { + // console.error("Failed to save profile"); + // } + // } catch (error) { + // console.error("Error saving profile:", error); + // } + console.log("Updated user data:", userData); + setEditStatus(false); + }; + return ( -
+
+
{userData?.name ? userData.name.charAt(0).toUpperCase() : ""} +
- + + +