From 0ea865f898295e142aa85a10d4d6f296380729a1 Mon Sep 17 00:00:00 2001 From: Mohamed Ali Alkassas Date: Mon, 23 Dec 2024 08:43:30 +0200 Subject: [PATCH] feat(luna): render tutor card v1 --- .../src/components/ServerStats/Chart.tsx | 2 +- .../src/components/UserDetails/Content.tsx | 2 +- apps/dashboard/src/pages/PlatformSettings.tsx | 2 +- apps/nova/src/components/Tutors/Content.tsx | 12 +- .../luna/src/components/Avatar/Avatar.tsx | 5 +- .../components/Call/PreCallUserPreview.tsx | 2 +- .../src/components/Call/UnFocusedStream.tsx | 2 +- .../Chat/ChatSummary/ChatSummary.tsx | 2 +- .../Lessons/UpcomingLessonsSummary.tsx | 2 +- .../components/MultiSelect/MultiSelect.tsx | 6 +- .../luna/src/components/Select/Select.tsx | 6 +- .../StudentOverview/StudentOverview.tsx | 2 +- .../src/components/TutorCard/TutorCard.tsx | 27 ++- .../TutorCard/TutorCardV1.stories.tsx | 105 +++++++++ .../src/components/TutorCard/TutorCardV1.tsx | 222 ++++++++++++++++++ .../luna/src/components/TutorCard/index.ts | 1 + .../luna/src/components/TutorCard/types.ts | 15 ++ packages/luna/src/locales/ar-eg.json | 2 +- packages/luna/tailwind.config.js | 3 +- 19 files changed, 384 insertions(+), 36 deletions(-) create mode 100644 packages/luna/src/components/TutorCard/TutorCardV1.stories.tsx create mode 100644 packages/luna/src/components/TutorCard/TutorCardV1.tsx create mode 100644 packages/luna/src/components/TutorCard/types.ts diff --git a/apps/dashboard/src/components/ServerStats/Chart.tsx b/apps/dashboard/src/components/ServerStats/Chart.tsx index 35802724d..24dddf27a 100644 --- a/apps/dashboard/src/components/ServerStats/Chart.tsx +++ b/apps/dashboard/src/components/ServerStats/Chart.tsx @@ -24,7 +24,7 @@ const Chart = ({ dataKey?: keyof T; }) => { return ( -
+
{lines.map((key) => ( diff --git a/apps/dashboard/src/components/UserDetails/Content.tsx b/apps/dashboard/src/components/UserDetails/Content.tsx index 34ceaadaf..e591c2f3b 100644 --- a/apps/dashboard/src/components/UserDetails/Content.tsx +++ b/apps/dashboard/src/components/UserDetails/Content.tsx @@ -39,7 +39,7 @@ const Content: React.FC<{ if (!user) return; return ( -
+
{user.image ? ( diff --git a/apps/dashboard/src/pages/PlatformSettings.tsx b/apps/dashboard/src/pages/PlatformSettings.tsx index 856a420a3..dcfcafd6b 100644 --- a/apps/dashboard/src/pages/PlatformSettings.tsx +++ b/apps/dashboard/src/pages/PlatformSettings.tsx @@ -2,7 +2,7 @@ import Cache from "@/components/Settings/Cache"; const Settings = () => { return ( -
+
); diff --git a/apps/nova/src/components/Tutors/Content.tsx b/apps/nova/src/components/Tutors/Content.tsx index b8d883339..ad51179b6 100644 --- a/apps/nova/src/components/Tutors/Content.tsx +++ b/apps/nova/src/components/Tutors/Content.tsx @@ -1,13 +1,12 @@ +import BookLesson from "@/components/Lessons/BookLesson"; +import { Route } from "@/types/routes"; import { Loading } from "@litespace/luna/Loading"; -import { Element, ITutor, Void } from "@litespace/types"; -import React, { useCallback, useState } from "react"; import { TutorCard } from "@litespace/luna/TutorCard"; import { asFullAssetUrl } from "@litespace/luna/backend"; -import { Route } from "@/types/routes"; -import { useNavigate } from "react-router-dom"; +import { Element, ITutor, Void } from "@litespace/types"; import { motion } from "framer-motion"; +import React, { useCallback, useState } from "react"; import { InView } from "react-intersection-observer"; -import BookLesson from "@/components/Lessons/BookLesson"; type Tutor = Element; @@ -19,8 +18,6 @@ const Content: React.FC<{ more: Void; hasMore: boolean; }> = ({ tutors, loading, error, more, hasMore, fetching }) => { - const navigate = useNavigate(); - const [tutor, setTutor] = useState(null); const openBookingDialog = useCallback((tutor: Tutor) => setTutor(tutor), []); @@ -53,7 +50,6 @@ const Content: React.FC<{ studentCount={tutor.studentCount} rating={tutor.avgRating} onBook={() => openBookingDialog(tutor)} - onOpenProfile={() => navigate(profileUrl)} profileUrl={profileUrl} imageUrl={tutor.image ? asFullAssetUrl(tutor.image) : null} /> diff --git a/packages/luna/src/components/Avatar/Avatar.tsx b/packages/luna/src/components/Avatar/Avatar.tsx index a029fd387..08bc7c565 100644 --- a/packages/luna/src/components/Avatar/Avatar.tsx +++ b/packages/luna/src/components/Avatar/Avatar.tsx @@ -40,7 +40,10 @@ export const Avatar: React.FC<{ "tw-absolute tw-top-0 tw-left-0 tw-w-full tw-h-full tw-z-[1]" )} > - +
); diff --git a/packages/luna/src/components/Call/PreCallUserPreview.tsx b/packages/luna/src/components/Call/PreCallUserPreview.tsx index 4e028304e..56b5df72c 100644 --- a/packages/luna/src/components/Call/PreCallUserPreview.tsx +++ b/packages/luna/src/components/Call/PreCallUserPreview.tsx @@ -17,7 +17,7 @@ export const PreCallUserPreview: React.FC<{ }, [stream, camera]); return ( -
+
{camera ? (