From ec458f2fd2b3f1e82a92e9dfc2e86495cb159bd2 Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Fri, 11 Apr 2025 18:04:47 +0100 Subject: [PATCH] Responsiveness of AI --- .../AITutor/AIExploreCourseListing.tsx | 2 +- src/components/AITutor/AITutorLayout.tsx | 33 +++++- src/components/AITutor/AITutorSidebar.tsx | 103 +++++++++++------- src/components/GenerateCourse/AICourse.tsx | 27 ++++- 4 files changed, 112 insertions(+), 53 deletions(-) diff --git a/src/components/AITutor/AIExploreCourseListing.tsx b/src/components/AITutor/AIExploreCourseListing.tsx index 8fbcc366f..15ac7c9ef 100644 --- a/src/components/AITutor/AIExploreCourseListing.tsx +++ b/src/components/AITutor/AIExploreCourseListing.tsx @@ -86,7 +86,7 @@ export function AIExploreCourseListing() { {!isExploreAiCoursesLoading && courses && courses.length > 0 && (
-
+
{courses.map((course) => ( - -
- {children} + <> +
+ + + + +
+ +
+ setIsSidebarFloating(false)} + isFloating={isSidebarFloating} + activeTab={activeTab} + /> +
+ {children} +
-
+ ); } diff --git a/src/components/AITutor/AITutorSidebar.tsx b/src/components/AITutor/AITutorSidebar.tsx index c6b1a7aa5..5ee4fccc2 100644 --- a/src/components/AITutor/AITutorSidebar.tsx +++ b/src/components/AITutor/AITutorSidebar.tsx @@ -1,8 +1,10 @@ -import { BookOpen, Compass, Plus, Star, Users2 } from 'lucide-react'; +import { BookOpen, Compass, Plus, Star, X } from 'lucide-react'; import { AITutorLogo } from '../ReactIcons/AITutorLogo'; type AITutorSidebarProps = { + isFloating: boolean; activeTab: AITutorTab; + onClose: () => void; }; const sidebarItems = [ @@ -35,49 +37,68 @@ const sidebarItems = [ export type AITutorTab = (typeof sidebarItems)[number]['key']; export function AITutorSidebar(props: AITutorSidebarProps) { - const { activeTab } = props; + const { activeTab, isFloating, onClose } = props; return ( - + + + {isFloating && ( +
+ )} + ); } diff --git a/src/components/GenerateCourse/AICourse.tsx b/src/components/GenerateCourse/AICourse.tsx index eba3cecd5..2e6fffb70 100644 --- a/src/components/GenerateCourse/AICourse.tsx +++ b/src/components/GenerateCourse/AICourse.tsx @@ -72,11 +72,11 @@ export function AICourse(props: AICourseProps) { } return ( -
-

+
+

What can I help you learn?

-

+

Enter a topic below to generate a personalized course for it

@@ -100,7 +100,7 @@ export function AICourse(props: AICourseProps) { maxLength={50} /> -
+
- Explain more for a better course + Explain more + for a better course
@@ -127,7 +128,7 @@ export function AICourse(props: AICourseProps) { type="submit" disabled={!keyword.trim()} className={cn( - 'flex items-center justify-center rounded-full px-4 py-1 text-sm text-white transition-colors', + 'hidden items-center justify-center rounded-full px-4 py-1 text-sm text-white transition-colors md:flex', !keyword.trim() ? 'cursor-not-allowed bg-gray-400' : 'bg-black hover:bg-gray-800', @@ -148,6 +149,20 @@ export function AICourse(props: AICourseProps) { setGoal={setGoal} setCustomInstructions={setCustomInstructions} /> + +