From 7e4e2b4b625a888501dce05252c5aa5d2efbbc1c Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Wed, 15 Jan 2025 03:06:37 +0000 Subject: [PATCH] Enrollment changes --- .../CourseLanding/CourseFloatingSidebar.tsx | 2 +- src/components/CourseLanding/EnrollButton.tsx | 4 +- .../CourseLanding/UpgradeAndEnroll.tsx | 95 ------------------- .../CourseLanding/VerifyEnrollment.tsx | 75 --------------- src/queries/course-progress.ts | 4 +- 5 files changed, 5 insertions(+), 175 deletions(-) delete mode 100644 src/components/CourseLanding/UpgradeAndEnroll.tsx delete mode 100644 src/components/CourseLanding/VerifyEnrollment.tsx diff --git a/src/components/CourseLanding/CourseFloatingSidebar.tsx b/src/components/CourseLanding/CourseFloatingSidebar.tsx index f7ccdb94d..794272916 100644 --- a/src/components/CourseLanding/CourseFloatingSidebar.tsx +++ b/src/components/CourseLanding/CourseFloatingSidebar.tsx @@ -46,7 +46,7 @@ export function CourseFloatingSidebar(props: CourseFloatingSidebarProps) { queryClient, ); - const hasEnrolled = courseProgress?.startedAt ? true : false; + const hasEnrolled = courseProgress?.enrolledAt ? true : false; const isQueryLoading = isCourseProgressLoading || isCoursePricingLoading; useEffect(() => { diff --git a/src/components/CourseLanding/EnrollButton.tsx b/src/components/CourseLanding/EnrollButton.tsx index aa57f393e..6cccf7065 100644 --- a/src/components/CourseLanding/EnrollButton.tsx +++ b/src/components/CourseLanding/EnrollButton.tsx @@ -65,9 +65,9 @@ export function EnrollButton(props: EnrollButtonProps) { queryClient, ); - const hasEnrolled = !!courseProgress?.startedAt; + const hasEnrolled = !!courseProgress?.enrolledAt; const hasProgress = - courseProgress?.startedAt && courseProgress?.completed?.length > 0; + courseProgress?.enrolledAt && courseProgress?.completed?.length > 0; return (