From 445505cb6532d65585bfe2a545611b3b057f5d23 Mon Sep 17 00:00:00 2001 From: krishhh16 Date: Sun, 17 Mar 2024 15:30:10 +0530 Subject: [PATCH 1/2] closes #212 --- src/app/courses/[...courseId]/page.tsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/app/courses/[...courseId]/page.tsx b/src/app/courses/[...courseId]/page.tsx index bcd364bdf..37bdee0f8 100644 --- a/src/app/courses/[...courseId]/page.tsx +++ b/src/app/courses/[...courseId]/page.tsx @@ -14,6 +14,19 @@ import { redirect } from 'next/navigation'; import { CourseView } from '@/components/CourseView'; import { QueryParams } from '@/actions/types'; +interface PurchaseType { + id: number; + title: string; + imageUrl: string; + description: string; + appxCourseId: number; + openToEveryone: boolean; + slug: string; + discordRoleId: string; + totalVideos?: number; + totalVideosWatched: number; +} + const checkAccess = async (courseId: string) => { const session = await getServerSession(authOptions); @@ -21,7 +34,7 @@ const checkAccess = async (courseId: string) => { return false; } const purchases = await getPurchases(session.user.email); - if (purchases.map((p: any) => p.id).includes(Number(courseId))) { + if (purchases.map((p: PurchaseType) => p.id).includes(Number(courseId))) { return true; } return false; From d77a3fef2695c0d6da8585bced37e5777c739466 Mon Sep 17 00:00:00 2001 From: krishhh16 Date: Tue, 19 Mar 2024 00:38:12 +0530 Subject: [PATCH 2/2] closes #212 --- src/app/courses/[...courseId]/page.tsx | 1 - src/components/Sidebar.tsx | 18 ++++++++---------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/app/courses/[...courseId]/page.tsx b/src/app/courses/[...courseId]/page.tsx index 37bdee0f8..1ecbd3a9e 100644 --- a/src/app/courses/[...courseId]/page.tsx +++ b/src/app/courses/[...courseId]/page.tsx @@ -13,7 +13,6 @@ import { getPurchases } from '@/utiles/appx'; import { redirect } from 'next/navigation'; import { CourseView } from '@/components/CourseView'; import { QueryParams } from '@/actions/types'; - interface PurchaseType { id: number; title: string; diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx index d4363aab4..6fe95b2cd 100644 --- a/src/components/Sidebar.tsx +++ b/src/components/Sidebar.tsx @@ -116,8 +116,8 @@ export function Sidebar({ return (
+ className="overflow-y-scroll h-sidebar w-[300px] min-w-[133px] bg-gray-50 dark:bg-gray-800 cursor-pointer sticky top-[64px] self-start w-84" + >
{/* { @@ -151,17 +151,15 @@ export function ToggleButton({ > );