From ce6bb0a27ad1b4e564155df1236cd71fc86d57e3 Mon Sep 17 00:00:00 2001 From: mertyercel Date: Sat, 24 Jan 2026 15:05:00 -0600 Subject: [PATCH 1/2] Fixed most of non-mobile friendly UI --- app/educator/dashboard/page.tsx | 148 +++++--- .../students/StudentDetailsDialog.tsx | 213 +++++++---- app/educator/students/page.tsx | 81 +++-- app/student/diagnostic/page.tsx | 107 ++++-- app/student/learning-style-quiz/page.tsx | 82 +++-- app/student/onboarding/page.tsx | 332 ++++++++++++++++-- domains/auth/LoginForm.tsx | 53 ++- domains/auth/SignupForm.tsx | 125 ++++--- .../educator/onboarding/OnboardingForm.tsx | 36 +- domains/student/dashboard/GreetingCard.tsx | 36 +- .../dashboard/PromptDiagnosticCard.tsx | 25 +- .../dashboard/RecentQuizCompletions.tsx | 33 +- .../student/dashboard/RecommendedQuizzes.tsx | 51 +-- .../dashboard/StudentDashboardClient.tsx | 13 +- .../dashboard/StudentDashboardHeader.tsx | 57 ++- domains/student/dashboard/WritingFeedback.tsx | 106 ++++-- 16 files changed, 1015 insertions(+), 483 deletions(-) diff --git a/app/educator/dashboard/page.tsx b/app/educator/dashboard/page.tsx index 4723778..bab669c 100644 --- a/app/educator/dashboard/page.tsx +++ b/app/educator/dashboard/page.tsx @@ -11,57 +11,79 @@ import { usePathname } from "next/navigation"; export default function InstructorDashboard() { const pathname = usePathname(); + return (
+ {/* Header */}
-
-

- My Image -

- -
- - + {/* Logo and User Info Row (mobile) / Logo (desktop) */} +
+ Logo -
-
-
- -
- - + {/* Mobile: Show avatar and bell in header row */} +
+ + + IN
+ + {/* Search Bar */} +
+ + +
+ + {/* Desktop: Avatar and Bell */} +
+ + + + IN + +
{/* Main */} -
+
{/* Greeting Card */} - - + + IN -

Hello Mr. Burns!

+

+ Hello Mr. Burns! +

{/* Tabs */} -
+
+
); -} +} \ No newline at end of file diff --git a/app/educator/students/StudentDetailsDialog.tsx b/app/educator/students/StudentDetailsDialog.tsx index d7bb350..f4b6880 100644 --- a/app/educator/students/StudentDetailsDialog.tsx +++ b/app/educator/students/StudentDetailsDialog.tsx @@ -41,11 +41,14 @@ interface StudentDetails { correct: number; wrong: number; completed_at: string | null; - performance_by_subject: Record; - }>; + performance_by_subject: Record< + string, + { + correct: number; + total: number; + topics: Record; + } + >; } | null; } @@ -67,87 +70,119 @@ export default function StudentDetailsDialog({ return ( - {student ? `${student.first_name} ${student.last_name}` : "Student Details"} + + {student + ? `${student.first_name} ${student.last_name}` + : "Student Details"} + + {/* Header */} -
+
-

+

{student ? `${student.first_name} ${student.last_name}` : ""}

{details && ( -

- Last Active: {details.lastActive || "No recent activity"} | Total - Lessons: {details.totalLessons} +

+ + Last Active: {details.lastActive || "No recent activity"} + + | + + Total Lessons: {details.totalLessons} +

)}
-
+
{loading ? ( -
+
Loading student details…
) : details ? ( <> {/* Diagnostic Results */} {details.diagnosticResults && ( - -

+ +

Diagnostic Results

-
-
+
+
-
Score
-
+
+ Score +
+
{details.diagnosticResults.score}%
-
Correct
-
+
+ Correct +
+
{details.diagnosticResults.correct}
-
Wrong
-
+
+ Wrong +
+
{details.diagnosticResults.wrong}
-
- Total Questions: {details.diagnosticResults.total_questions} +
+ + Total Questions:{" "} + {details.diagnosticResults.total_questions} + {details.diagnosticResults.completed_at && ( - - Completed: {new Date(details.diagnosticResults.completed_at).toLocaleDateString()} + + Completed:{" "} + {new Date( + details.diagnosticResults.completed_at + ).toLocaleDateString()} )}
- + {/* Performance by Subject */} - {Object.keys(details.diagnosticResults.performance_by_subject || {}).length > 0 && ( -
-

+ {Object.keys( + details.diagnosticResults.performance_by_subject || {} + ).length > 0 && ( +
+

Performance by Subject

-
- {Object.entries(details.diagnosticResults.performance_by_subject).map(([subject, data]: [string, any]) => { - const accuracy = data.total > 0 ? Math.round((data.correct / data.total) * 100) : 0; +
+ {Object.entries( + details.diagnosticResults.performance_by_subject + ).map(([subject, data]: [string, any]) => { + const accuracy = + data.total > 0 + ? Math.round((data.correct / data.total) * 100) + : 0; return ( -
+
{subject} {data.correct}/{data.total} ({accuracy}%) @@ -163,27 +198,29 @@ export default function StudentDetailsDialog({ )} {/* Strengths & Weaknesses */} -
+
{/* Strengths */} - -

+ +

Top Strengths

{details.strengths.length === 0 ? ( -

+

No strengths recorded

) : ( -
+
{details.strengths.map((s, i) => (
-
{s.skill}
-
+
+ {s.skill} +
+
{s.description}
{i < details.strengths.length - 1 && ( -
+
)}
))} @@ -192,25 +229,27 @@ export default function StudentDetailsDialog({ {/* Weaknesses */} - -

+ +

Top Weaknesses

{details.weaknesses.length === 0 ? ( -

+

No weaknesses recorded

) : ( -
+
{details.weaknesses.map((w, i) => (
-
{w.skill}
-
+
+ {w.skill} +
+
{w.description}
{i < details.weaknesses.length - 1 && ( -
+
)}
))} @@ -221,15 +260,15 @@ export default function StudentDetailsDialog({ {/* Lesson Tracker */} - -

+ +

Lesson Tracker

{/* Filters */} -
+
- {/* Table */} -
+ {/* Mobile: Card-based layout */} +
+ {details.lessonHistory.length === 0 ? ( +

+ No lessons yet +

+ ) : ( + details.lessonHistory.map((lesson, index) => ( +
+
+ + {lesson.assignment} + + + {lesson.lastAttempt} + +
+

+ {lesson.feedback} +

+
+ )) + )} +
+ + {/* Desktop: Table layout */} +
- Assignment - Last Attempt - Feedback + + Assignment + + + Last Attempt + + + Feedback + @@ -262,7 +335,7 @@ export default function StudentDetailsDialog({ No lessons yet @@ -270,9 +343,15 @@ export default function StudentDetailsDialog({ ) : ( details.lessonHistory.map((lesson, index) => ( - {lesson.assignment} - {lesson.lastAttempt} - {lesson.feedback} + + {lesson.assignment} + + + {lesson.lastAttempt} + + + {lesson.feedback} + )) )} @@ -287,4 +366,4 @@ export default function StudentDetailsDialog({ ); -} +} \ No newline at end of file diff --git a/app/educator/students/page.tsx b/app/educator/students/page.tsx index 6b059c3..c8b33dd 100644 --- a/app/educator/students/page.tsx +++ b/app/educator/students/page.tsx @@ -145,19 +145,20 @@ export default function StudentRoster() { }); if (loading) { - // Diisplays Loading... state while waiting for data + // Displays Loading... state while waiting for data return
Loading...
; } return (
+ {/* Header */}
-
-

+
+

-
+
-
-
- +
- - + + {/* Main content area */} -
+
{/* Tabs */}
- +

- + Student - + Progress - + Engagement - + Status @@ -303,14 +302,14 @@ export default function StudentRoster() { > {/* Student */} -
- +
+ - + {student.first_name?.[0] || ""}{student.last_name?.[0] || ""} - + {student.first_name} {student.last_name}
@@ -318,19 +317,19 @@ export default function StudentRoster() { {/* Progress */} -
+
- + {student.progress}%
- {/* Engagement - fix later */} - + {/* Engagement - hidden on mobile */} + {student.progress >= 80 ? "more than 10 hours" : student.progress >= 60 @@ -343,7 +342,7 @@ export default function StudentRoster() { {/* Status */} - {/* Pagination or additional controls can go here */} -
-

+ {/* Pagination */} +

+

Showing {filteredStudents.length} of {filteredStudents.length}{" "} students

@@ -385,4 +384,4 @@ export default function StudentRoster() { />
); -} +} \ No newline at end of file diff --git a/app/student/diagnostic/page.tsx b/app/student/diagnostic/page.tsx index c298a94..12ed299 100644 --- a/app/student/diagnostic/page.tsx +++ b/app/student/diagnostic/page.tsx @@ -301,11 +301,11 @@ export default function QuizzesPage() { if (!passage) return null; return ( -
-

+

+

Reading Passage:

-

{passage}

+

{passage}

); }; @@ -318,7 +318,7 @@ export default function QuizzesPage() { const details = currentQuestion.question_details; return ( -
+
{/* Reading Passage */} {renderPassage( (details as FreeResponseDetails | MCQDetails | DragDropDetails) @@ -326,27 +326,27 @@ export default function QuizzesPage() { )} {/* Question Box */} -
+
-

+

{currentQuestion.subject} - {currentQuestion.topic}

{currentQuestion.question_type === "free_response" && ( <> -

+

{(details as FreeResponseDetails).question}

)} {currentQuestion.question_type === "mcq" && ( <> -

+

{(details as MCQDetails).question}

)} {currentQuestion.question_type === "drag_drop" && ( -

+

Match each item with the correct answer from the dropdowns.

)} @@ -354,23 +354,23 @@ export default function QuizzesPage() {
{/* Answer Options */} -
+
{currentQuestion.question_type === "free_response" && (