From 143e27bbddf8692dc7dfb6ea0fad00e07c64fdda Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Fri, 14 Mar 2025 02:18:24 +0000 Subject: [PATCH] Improve back button logic --- src/components/GenerateCourse/AICourseContent.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/GenerateCourse/AICourseContent.tsx b/src/components/GenerateCourse/AICourseContent.tsx index 90eb00f8b..b24cec425 100644 --- a/src/components/GenerateCourse/AICourseContent.tsx +++ b/src/components/GenerateCourse/AICourseContent.tsx @@ -181,6 +181,8 @@ export function AICourseContent(props: AICourseContentProps) { ); } + const isViewingLesson = viewMode === 'module'; + return (
{modals} @@ -189,11 +191,17 @@ export function AICourseContent(props: AICourseContentProps) {
{ + if (isViewingLesson) { + e.preventDefault(); + setViewMode('full'); + } + }} className="flex flex-row items-center gap-1.5 text-sm font-medium text-gray-700 hover:text-gray-900" aria-label="Back to generator" > - Back to AI Tutor + Back {isViewingLesson ? 'to Outline' : 'to AI Tutor'}