From 4eee31cd35554025899e8055387cd58aa2575bba Mon Sep 17 00:00:00 2001 From: tanayvaswani Date: Sat, 3 Feb 2024 13:03:10 +0530 Subject: [PATCH] feat: Course card --- src/app/page.tsx | 31 ++++++++++++++++++++--- src/components/CourseCard.tsx | 47 +++++++++++++++++++++-------------- src/components/Courses.tsx | 2 +- 3 files changed, 57 insertions(+), 23 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index 9c88205e..6b5d4911 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,7 +1,14 @@ import { MyCourses } from '@/components/MyCourses'; import LandingPage from '@/components/landing/landing-page'; import { authOptions } from '@/lib/auth'; +import { cn } from '@/lib/utils'; import { getServerSession } from 'next-auth'; +import { Poppins } from 'next/font/google'; + +const rs = Poppins({ + weight: ['100', '200', '300', '400', '500', '600', '700', '800', '900'], + subsets: ['latin'], +}); const getUserDetails = async () => { const session = await getServerSession(authOptions); @@ -13,12 +20,28 @@ export default async function Home() { if (session?.user) { return ( -
-
Your courses
+
+
+

+ Courses +

+

+ List of purchased courses, click on any of them to navigate through + curriculum, access course material, watch lectures and much more. +

+
- -
); } diff --git a/src/components/CourseCard.tsx b/src/components/CourseCard.tsx index 343334aa..01cc2ae4 100644 --- a/src/components/CourseCard.tsx +++ b/src/components/CourseCard.tsx @@ -1,5 +1,7 @@ 'use client'; import { Course } from '@/store/atoms'; +import { Button } from './ui/button'; +import { ChevronRight } from 'lucide-react'; export const CourseCard = ({ course, @@ -10,23 +12,37 @@ export const CourseCard = ({ }) => { return (
{ onClick(); }} > - {course.title}
-
-
{course.title} Cohort
-
-
- + {course.title} +
+ +
+
+
+

+ {course.title} Cohort +

+ +

+ {course.description} +

+
+ +
+ +
@@ -36,12 +52,7 @@ export const CourseCard = ({ export const CourseSkeleton = () => { return (
-
-
-
-
-
-
+
); }; diff --git a/src/components/Courses.tsx b/src/components/Courses.tsx index 9d7dbf94..419b80e2 100644 --- a/src/components/Courses.tsx +++ b/src/components/Courses.tsx @@ -7,7 +7,7 @@ import { useRouter } from 'next/navigation'; export const Courses = ({ courses }: { courses: Course[] }) => { const router = useRouter(); return ( -
+
{courses?.map((course) => (