diff --git a/apps/lms/app/(course)/courses/[courseId]/chapters/[chapterId]/_components/video-player.tsx b/apps/lms/app/(course)/courses/[courseId]/chapters/[chapterId]/_components/video-player.tsx index d6f3bf8..77cda42 100644 --- a/apps/lms/app/(course)/courses/[courseId]/chapters/[chapterId]/_components/video-player.tsx +++ b/apps/lms/app/(course)/courses/[courseId]/chapters/[chapterId]/_components/video-player.tsx @@ -69,7 +69,7 @@ export const VideoPlayer = ({ {isLocked && (
-

This chapter is locked

+

Please enroll to enjoy this course.

)} {!isLocked && ( diff --git a/apps/lms/app/(course)/courses/[courseId]/chapters/[chapterId]/page.tsx b/apps/lms/app/(course)/courses/[courseId]/chapters/[chapterId]/page.tsx index a2f95f4..b376669 100644 --- a/apps/lms/app/(course)/courses/[courseId]/chapters/[chapterId]/page.tsx +++ b/apps/lms/app/(course)/courses/[courseId]/chapters/[chapterId]/page.tsx @@ -5,6 +5,7 @@ import { redirect } from 'next/navigation'; import { getChapter } from '@/actions/get-chapter'; import { Banner } from '@/components/banner'; +import { Container } from '@/components/container'; import { Preview } from '@/components/preview'; import { CourseEnrollButton } from './_components/course-enroll-button'; @@ -45,82 +46,84 @@ const ChapterIdPage = async ({ return (
-
- {userProgress?.isCompleted && ( - - )} - {isLocked && ( - - )} -
- -
-
-
-

- {chapter.title} -

- {purchase ? ( - - ) : ( - - )} + +
+ {userProgress?.isCompleted && ( + + )} + {isLocked && ( + + )} +
+
- -
- +
+
+

+ {chapter.title} +

+ {purchase ? ( + + ) : ( + + )} +
+ +
+ +
+ {!!attachments.length && ( + <> + +
+ {attachments.length > 0 && ( +
+

+ Resources & Attachments +

+
+ )} + {attachments.map((attachment) => ( + + +

{attachment.name}

+
+ ))} +
+ + )}
- {!!attachments.length && ( - <> - -
- {attachments.length > 0 && ( -
-

- Resources & Attachments -

-
- )} - {attachments.map((attachment) => ( - - -

{attachment.name}

-
- ))} -
- - )}
-
+
); }; diff --git a/apps/lms/app/(dashboard)/(routes)/(root)/page.tsx b/apps/lms/app/(dashboard)/(routes)/(root)/page.tsx index eca5ed4..b17fcf8 100644 --- a/apps/lms/app/(dashboard)/(routes)/(root)/page.tsx +++ b/apps/lms/app/(dashboard)/(routes)/(root)/page.tsx @@ -3,6 +3,7 @@ import { CheckCircledIcon, ClockIcon } from '@ui/index'; import { redirect } from 'next/navigation'; import { getDashboardCourses } from '@/actions/get-dashboard-courses'; +import { Container } from '@/components/container'; import { CoursesList } from '@/components/courses-list'; import { InfoCard } from './_components/info-card'; @@ -18,21 +19,23 @@ export default async function Dashboard() { await getDashboardCourses(userId); return ( -
-
- - + +
+
+ + +
+
- -
+ ); } diff --git a/apps/lms/app/(dashboard)/(routes)/search/page.tsx b/apps/lms/app/(dashboard)/(routes)/search/page.tsx index aed38cb..cdf54ba 100644 --- a/apps/lms/app/(dashboard)/(routes)/search/page.tsx +++ b/apps/lms/app/(dashboard)/(routes)/search/page.tsx @@ -35,10 +35,10 @@ const SearchPage = async ({ searchParams }: SearchPageProps) => { return ( <> -
+
-
+
diff --git a/apps/lms/app/(dashboard)/(routes)/teacher/analytics/_components/chart.tsx b/apps/lms/app/(dashboard)/(routes)/teacher/analytics/_components/chart.tsx index c06f424..f689e7a 100644 --- a/apps/lms/app/(dashboard)/(routes)/teacher/analytics/_components/chart.tsx +++ b/apps/lms/app/(dashboard)/(routes)/teacher/analytics/_components/chart.tsx @@ -29,7 +29,7 @@ export const Chart = ({ data }: ChartProps) => { axisLine={false} tickFormatter={(value) => `$${value}`} /> - + diff --git a/apps/lms/app/(dashboard)/(routes)/teacher/analytics/page.tsx b/apps/lms/app/(dashboard)/(routes)/teacher/analytics/page.tsx index 3521906..ecfc1c9 100644 --- a/apps/lms/app/(dashboard)/(routes)/teacher/analytics/page.tsx +++ b/apps/lms/app/(dashboard)/(routes)/teacher/analytics/page.tsx @@ -2,6 +2,7 @@ import { auth } from '@clerk/nextjs'; import { redirect } from 'next/navigation'; import { getAnalytics } from '@/actions/get-analytics'; +import { Container } from '@/components/container'; import { Chart } from './_components/chart'; import { DataCard } from './_components/data-card'; @@ -16,13 +17,15 @@ const AnalyticsPage = async () => { const { data, totalRevenue, totalSales } = await getAnalytics(userId); return ( -
-
- - + +
+
+ + +
+
- -
+ ); }; diff --git a/apps/lms/app/(dashboard)/(routes)/teacher/courses/[courseId]/_components/chapters-list.tsx b/apps/lms/app/(dashboard)/(routes)/teacher/courses/[courseId]/_components/chapters-list.tsx index 59d99cf..07ce9c5 100644 --- a/apps/lms/app/(dashboard)/(routes)/teacher/courses/[courseId]/_components/chapters-list.tsx +++ b/apps/lms/app/(dashboard)/(routes)/teacher/courses/[courseId]/_components/chapters-list.tsx @@ -101,7 +101,7 @@ export const ChaptersList = ({ )} { }); return ( -
+ -
+ ); }; diff --git a/apps/lms/app/(dashboard)/(routes)/teacher/create/page.tsx b/apps/lms/app/(dashboard)/(routes)/teacher/create/page.tsx index 23240fa..59518d1 100644 --- a/apps/lms/app/(dashboard)/(routes)/teacher/create/page.tsx +++ b/apps/lms/app/(dashboard)/(routes)/teacher/create/page.tsx @@ -48,7 +48,7 @@ const CreatePage = () => { }; return ( -
+

Course title

diff --git a/apps/lms/components/container.tsx b/apps/lms/components/container.tsx new file mode 100644 index 0000000..9d9d8b2 --- /dev/null +++ b/apps/lms/components/container.tsx @@ -0,0 +1,22 @@ +import clsx from 'clsx'; +import { ElementType, ReactNode } from 'react'; + +interface ContainerProps { + as?: ElementType; + className?: string; + children?: ReactNode; +} + +export function Container({ + as: Component = 'div', + className, + children, +}: ContainerProps) { + return ( + +

{children}
+ + ); +} diff --git a/apps/lms/components/course-card.tsx b/apps/lms/components/course-card.tsx index cb0a1ea..b0aefb9 100644 --- a/apps/lms/components/course-card.tsx +++ b/apps/lms/components/course-card.tsx @@ -9,6 +9,7 @@ import { formatPrice } from '@/lib/format'; interface CourseCardProps { id: string; title: string; + description: string; imageUrl: string; chaptersLength: number; price: number; @@ -19,6 +20,7 @@ interface CourseCardProps { export const CourseCard = ({ id, title, + description, imageUrl, chaptersLength, price, @@ -41,9 +43,12 @@ export const CourseCard = ({
-
+
{title}
+

+ {description} +

{progress !== null ? ( ) : ( -

+

{formatPrice(price) === '$0' ? 'Free' : formatPrice(price)}

)} diff --git a/apps/lms/components/courses-list.tsx b/apps/lms/components/courses-list.tsx index 74f3aee..02a87e9 100644 --- a/apps/lms/components/courses-list.tsx +++ b/apps/lms/components/courses-list.tsx @@ -21,6 +21,7 @@ export const CoursesList = ({ items }: CoursesListProps) => { key={item.id} id={item.id} title={item.title} + description={item.description!} imageUrl={item.imageUrl!} chaptersLength={item.chapters.length} price={item.price!}