diff --git a/apps/api/src/courses/course.service.ts b/apps/api/src/courses/course.service.ts index 5d3df907..abe68ead 100644 --- a/apps/api/src/courses/course.service.ts +++ b/apps/api/src/courses/course.service.ts @@ -520,9 +520,32 @@ export class CourseService { }; } + // TODO: Needs to be refactored async getTeacherCourses(authorId: UUIDType): Promise { return this.db - .select(this.getSelectField()) + .select({ + id: courses.id, + description: sql`${courses.description}`, + title: courses.title, + imageUrl: courses.imageUrl, + authorId: sql`${courses.authorId}`, + author: sql`CONCAT(${users.firstName} || ' ' || ${users.lastName})`, + authorEmail: sql`${users.email}`, + category: sql`${categories.title}`, + enrolled: sql`CASE WHEN ${studentCourses.studentId} IS NOT NULL THEN true ELSE false END`, + enrolledParticipantCount: sql`0`, + courseLessonCount: courses.lessonsCount, + completedLessonCount: sql`0`, + priceInCents: courses.priceInCents, + currency: courses.currency, + hasFreeLessons: sql` + EXISTS ( + SELECT 1 + FROM ${courseLessons} + WHERE ${courseLessons.courseId} = ${courses.id} + AND ${courseLessons.isFree} = true + )`, + }) .from(courses) .leftJoin(studentCourses, eq(studentCourses.courseId, courses.id)) .leftJoin(categories, eq(courses.categoryId, categories.id)) @@ -545,8 +568,6 @@ export class CourseService { users.email, studentCourses.studentId, categories.title, - coursesSummaryStats.freePurchasedCount, - coursesSummaryStats.paidPurchasedCount, ) .orderBy( sql`CASE WHEN ${studentCourses.studentId} IS NULL THEN TRUE ELSE FALSE END`, diff --git a/apps/api/src/swagger/api-schema.json b/apps/api/src/swagger/api-schema.json index e570ce84..a6f11da7 100644 --- a/apps/api/src/swagger/api-schema.json +++ b/apps/api/src/swagger/api-schema.json @@ -2302,6 +2302,26 @@ "data": { "type": "object", "properties": { + "firstName": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "lastName": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, "id": { "format": "uuid", "type": "string" @@ -2348,6 +2368,8 @@ } }, "required": [ + "firstName", + "lastName", "id", "description", "contactEmail", diff --git a/apps/api/src/users/schemas/user.schema.ts b/apps/api/src/users/schemas/user.schema.ts index fc35ee0a..d62d217f 100644 --- a/apps/api/src/users/schemas/user.schema.ts +++ b/apps/api/src/users/schemas/user.schema.ts @@ -1,9 +1,11 @@ -import { Type, type Static } from "@sinclair/typebox"; +import { type Static, Type } from "@sinclair/typebox"; import { commonUserSchema } from "src/common/schemas/common-user.schema"; export const allUsersSchema = Type.Array(commonUserSchema); export const userDetailsSchema = Type.Object({ + firstName: Type.Union([Type.String(), Type.Null()]), + lastName: Type.Union([Type.String(), Type.Null()]), id: Type.String({ format: "uuid" }), description: Type.Union([Type.String(), Type.Null()]), contactEmail: Type.Union([Type.String(), Type.Null()]), diff --git a/apps/api/src/users/users.service.ts b/apps/api/src/users/users.service.ts index 01c0a369..c50b0337 100644 --- a/apps/api/src/users/users.service.ts +++ b/apps/api/src/users/users.service.ts @@ -99,6 +99,8 @@ export class UsersService { public async getUserDetails(userId: string): Promise { const [userBio]: UserDetails[] = await this.db .select({ + firstName: users.firstName, + lastName: users.lastName, id: userDetails.id, description: userDetails.description, contactEmail: userDetails.contactEmail, @@ -106,6 +108,7 @@ export class UsersService { jobTitle: userDetails.jobTitle, }) .from(userDetails) + .leftJoin(users, eq(userDetails.userId, users.id)) .where(eq(userDetails.userId, userId)); if (!userBio) { diff --git a/apps/web/app/api/queries/useTeacherCourses.ts b/apps/web/app/api/queries/useTeacherCourses.ts index c82cddbe..7b3ad26c 100644 --- a/apps/web/app/api/queries/useTeacherCourses.ts +++ b/apps/web/app/api/queries/useTeacherCourses.ts @@ -4,7 +4,7 @@ import { ApiClient } from "../api-client"; import type { GetTeacherCoursesResponse } from "../generated-api"; -export const teacherCourses = (authorId: string) => { +export const teacherCoursesOptions = (authorId: string) => { return { queryKey: ["teacher-courses", authorId], queryFn: async () => { @@ -17,5 +17,5 @@ export const teacherCourses = (authorId: string) => { }; export function useTeacherCourses(authorId: string) { - return useQuery(teacherCourses(authorId)); + return useQuery(teacherCoursesOptions(authorId)); } diff --git a/apps/web/app/assets/svgs/index.ts b/apps/web/app/assets/svgs/index.ts index ac875bcf..ae82e37d 100644 --- a/apps/web/app/assets/svgs/index.ts +++ b/apps/web/app/assets/svgs/index.ts @@ -35,9 +35,7 @@ export { default as ArrowUp } from "./arrow-up.svg?react"; export { default as ArrowDown } from "./arrow-down.svg?react"; export { default as DragAndDropIcon } from "./drag-and-drop.svg?react"; export { default as Info } from "./info.svg?react"; -export { default as Text } from "./text.svg?react"; -export { default as Presentation } from "./presentation.svg?react"; -export { default as Video } from "./video.svg?react"; -export { default as Quiz } from "./quiz.svg?react"; export { default as Warning } from "./warning.svg?react"; export { default as Admin } from "./admin.svg?react"; + +export * from "./lesson-types"; diff --git a/apps/web/app/assets/svgs/lesson-types/index.ts b/apps/web/app/assets/svgs/lesson-types/index.ts new file mode 100644 index 00000000..ca966678 --- /dev/null +++ b/apps/web/app/assets/svgs/lesson-types/index.ts @@ -0,0 +1,4 @@ +export { default as Text } from "./text.svg?react"; +export { default as Presentation } from "./presentation.svg?react"; +export { default as Video } from "./video.svg?react"; +export { default as Quiz } from "./quiz.svg?react"; diff --git a/apps/web/app/assets/svgs/lesson-types/presentation.svg b/apps/web/app/assets/svgs/lesson-types/presentation.svg new file mode 100644 index 00000000..262eff7f --- /dev/null +++ b/apps/web/app/assets/svgs/lesson-types/presentation.svg @@ -0,0 +1,3 @@ + + + diff --git a/apps/web/app/assets/svgs/lesson-types/quiz.svg b/apps/web/app/assets/svgs/lesson-types/quiz.svg new file mode 100644 index 00000000..52eaa5e0 --- /dev/null +++ b/apps/web/app/assets/svgs/lesson-types/quiz.svg @@ -0,0 +1,3 @@ + + + diff --git a/apps/web/app/assets/svgs/lesson-types/text.svg b/apps/web/app/assets/svgs/lesson-types/text.svg new file mode 100644 index 00000000..725941cf --- /dev/null +++ b/apps/web/app/assets/svgs/lesson-types/text.svg @@ -0,0 +1,3 @@ + + + diff --git a/apps/web/app/assets/svgs/lesson-types/video.svg b/apps/web/app/assets/svgs/lesson-types/video.svg new file mode 100644 index 00000000..a28d591e --- /dev/null +++ b/apps/web/app/assets/svgs/lesson-types/video.svg @@ -0,0 +1,3 @@ + + + diff --git a/apps/web/app/assets/svgs/presentation.svg b/apps/web/app/assets/svgs/presentation.svg deleted file mode 100644 index 7b593ac0..00000000 --- a/apps/web/app/assets/svgs/presentation.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/apps/web/app/assets/svgs/quiz.svg b/apps/web/app/assets/svgs/quiz.svg deleted file mode 100644 index f07c21eb..00000000 --- a/apps/web/app/assets/svgs/quiz.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/apps/web/app/assets/svgs/text.svg b/apps/web/app/assets/svgs/text.svg deleted file mode 100644 index 5983c9df..00000000 --- a/apps/web/app/assets/svgs/text.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/apps/web/app/assets/svgs/video.svg b/apps/web/app/assets/svgs/video.svg deleted file mode 100644 index 60556c2e..00000000 --- a/apps/web/app/assets/svgs/video.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/apps/web/app/components/Badges/ProgressBadge.tsx b/apps/web/app/components/Badges/ProgressBadge.tsx new file mode 100644 index 00000000..a2acff14 --- /dev/null +++ b/apps/web/app/components/Badges/ProgressBadge.tsx @@ -0,0 +1,44 @@ +import { Badge } from "~/components/ui/badge"; + +import type { IconName } from "~/types/shared"; + +type ProgressBadgeProps = { + progress: "completed" | "inProgress" | "notStarted"; + className?: string; +}; + +type ProgressConfig = { + [key in "completed" | "inProgress" | "notStarted"]: { + variant: "successFilled" | "inProgressFilled" | "notStartedFilled"; + icon: IconName; + label: string; + }; +}; + +export const ProgressBadge = ({ progress, className }: ProgressBadgeProps) => { + const progressConfig: ProgressConfig = { + completed: { + variant: "successFilled", + icon: "InputRoundedMarkerSuccess", + label: "Completed", + }, + inProgress: { + variant: "inProgressFilled", + icon: "InProgress", + label: "In Progress", + }, + notStarted: { + variant: "notStartedFilled", + icon: "NotStartedRounded", + label: "Not Started", + }, + }; + + const { variant, icon, label } = progressConfig[progress]; + + return ( + + {label} + + ); +}; diff --git a/apps/web/app/components/CardBadge.tsx b/apps/web/app/components/CardBadge.tsx index b7d1ac6b..820ffabc 100644 --- a/apps/web/app/components/CardBadge.tsx +++ b/apps/web/app/components/CardBadge.tsx @@ -13,6 +13,7 @@ const badgeVariants = cva( default: "text-neutral-900", primary: "text-primary-950", secondary: "text-secondary-700", + secondaryFilled: "text-secondary-700 bg-secondary-50", successOutlined: "text-success-800", successFilled: "text-white bg-success-600", }, diff --git a/apps/web/app/components/PageWrapper/PageWrapper.tsx b/apps/web/app/components/PageWrapper/PageWrapper.tsx index 2457ac01..fe0a0138 100644 --- a/apps/web/app/components/PageWrapper/PageWrapper.tsx +++ b/apps/web/app/components/PageWrapper/PageWrapper.tsx @@ -1,15 +1,53 @@ +import { + BreadcrumbItem, + BreadcrumbLink, + BreadcrumbList, + BreadcrumbSeparator, +} from "~/components/ui/breadcrumb"; import { cn } from "~/lib/utils"; -import type { HTMLAttributes } from "react"; +import type { HTMLAttributes, ReactNode } from "react"; type PageWrapperProps = HTMLAttributes & { + breadcrumbs?: { title: string; href: string }[]; + children: ReactNode; className?: string; }; -export const PageWrapper = ({ className, ...props }: PageWrapperProps) => { +type Breadcrumb = { title: string; href: string }; + +type BreadcrumbsProps = { + breadcrumbs?: Breadcrumb[]; +}; + +export const Breadcrumbs = ({ breadcrumbs = [] }: BreadcrumbsProps) => { + if (!breadcrumbs.length) return null; + + return ( + + {breadcrumbs.map(({ href, title }, index) => ( + + {title} + {index < breadcrumbs.length - 1 && } + + ))} + + ); +}; + +export const PageWrapper = ({ className, breadcrumbs, children, ...props }: PageWrapperProps) => { + const hasBreadcrumbs = Boolean(breadcrumbs); + const classes = cn( - "h-auto w-full pt-6 px-4 pb-4 md:px-6 md:pb-6 2xl:pt-12 2xl:px-8 2xl:pb-8", + "w-full pt-6 px-4 pb-4 md:px-6 md:pb-6 3xl:pt-12 3xl:px-8 3xl:pb-8", + { "pt-8 md:pt-6 3xl:pb-2": hasBreadcrumbs }, className, ); - return
; + + return ( +
+ {breadcrumbs && } + {children} +
+ ); }; diff --git a/apps/web/app/components/ui/accordion.tsx b/apps/web/app/components/ui/accordion.tsx new file mode 100644 index 00000000..efe18aa3 --- /dev/null +++ b/apps/web/app/components/ui/accordion.tsx @@ -0,0 +1,52 @@ +"use client"; + +import * as AccordionPrimitive from "@radix-ui/react-accordion"; +import * as React from "react"; + +import { cn } from "~/lib/utils"; + +const Accordion = AccordionPrimitive.Root; + +const AccordionItem = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)); +AccordionItem.displayName = "AccordionItem"; + +const AccordionTrigger = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, children, ...props }, ref) => ( + + + {children} + + +)); +AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName; + +const AccordionContent = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, children, ...props }, ref) => ( + +
{children}
+
+)); + +AccordionContent.displayName = AccordionPrimitive.Content.displayName; + +export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }; diff --git a/apps/web/app/components/ui/badge.tsx b/apps/web/app/components/ui/badge.tsx index 468242c2..774fdfbf 100644 --- a/apps/web/app/components/ui/badge.tsx +++ b/apps/web/app/components/ui/badge.tsx @@ -1,34 +1,47 @@ -import { cva, type VariantProps } from "class-variance-authority"; +import { cva } from "class-variance-authority"; +import { Icon } from "~/components/Icon"; import { cn } from "~/lib/utils"; -import type * as React from "react"; +import type { VariantProps } from "class-variance-authority"; +import type { HTMLAttributes } from "react"; +import type { IconName } from "~/types/shared"; const badgeVariants = cva( - "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", + "flex shrink-0 items-center h-min text-sm font-medium rounded-lg px-2 py-1 gap-x-2", { variants: { variant: { - default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80", - secondary: - "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80", - destructive: - "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80", - outline: "text-foreground", + default: "text-neutral-900 bg-white border border-neutral-200", + success: "text-success-800 bg-success-100", + successFilled: "text-success-800 bg-success-50", + inProgress: "text-warning-800 bg-warning-100", + inProgressFilled: "text-secondary-700 bg-secondary-50", + notStarted: "text-neutral-600 bg-neutral-100", + notStartedFilled: "text-white bg-neutral-400", + }, + outline: { + true: "bg-transparent border border-current", + false: "", }, }, defaultVariants: { variant: "default", + outline: false, }, }, ); -export interface BadgeProps - extends React.HTMLAttributes, - VariantProps {} - -function Badge({ className, variant, ...props }: BadgeProps) { - return
; -} +type BadgeProps = HTMLAttributes & + VariantProps & { + icon?: IconName; + }; -export { Badge, badgeVariants }; +export const Badge = ({ className, variant, outline, icon, children, ...props }: BadgeProps) => { + return ( +
+ {icon && } + {children} +
+ ); +}; diff --git a/apps/web/app/modules/Courses/CourseView/CourseView.page.tsx b/apps/web/app/modules/Courses/CourseView/CourseView.page.tsx index 5e6e79a7..ac0f0dbb 100644 --- a/apps/web/app/modules/Courses/CourseView/CourseView.page.tsx +++ b/apps/web/app/modules/Courses/CourseView/CourseView.page.tsx @@ -51,7 +51,7 @@ export default function CoursesViewPage() { - Dashboard + Dashboard diff --git a/apps/web/app/modules/Courses/NewCourseView/CourseChapter.tsx b/apps/web/app/modules/Courses/NewCourseView/CourseChapter.tsx new file mode 100644 index 00000000..580b5066 --- /dev/null +++ b/apps/web/app/modules/Courses/NewCourseView/CourseChapter.tsx @@ -0,0 +1,123 @@ +import { ProgressBadge } from "~/components/Badges/ProgressBadge"; +import { CardBadge } from "~/components/CardBadge"; +import { Icon } from "~/components/Icon"; +import { + Accordion, + AccordionContent, + AccordionItem, + AccordionTrigger, +} from "~/components/ui/accordion"; +import { Button } from "~/components/ui/button"; + +const cardBadgeVariant: Record = { + completed: "successOutlined", + in_progress: "secondaryFilled", + not_started: "default", +}; + +const cardBadgeIcon = { + completed: "InputRoundedMarkerSuccess", + inProgress: "InProgress", + not_started: "NotStartedRounded", +} as const; + +const lessonProgress = "inProgress"; + +export const CourseChapterLesson = ({ isSuccess }: { isSuccess: boolean }) => { + return ( +
+ +
+

+ Introduction (8) +

+ Video +
+ +
+ ); +}; + +export const CourseChapter = ({ isSuccess }: { isSuccess: boolean }) => { + return ( + + +
+
+ {isSuccess ? ( + <> +
+ +
+
+ + ) : ( + <> +
+ +
+
+ + )} +
+
+ +
+
+ +
+
+
3 Lessons - 2 Quizzes
+

+ Introduction to Data Analytics and its Applications +

+
+ 5/5 + {Array.from({ length: 5 }).map((_, index) => { + if (isSuccess) { + return ( + + ); + } + return ( + + ); + })} +
+
+ + + Free + +
+
+ +
+ {Array.from({ length: 5 }).map((_, index) => ( + + ))} + +
+
+
+
+ + + ); +}; diff --git a/apps/web/app/modules/Courses/NewCourseView/MoreCoursesByAuthor.tsx b/apps/web/app/modules/Courses/NewCourseView/MoreCoursesByAuthor.tsx new file mode 100644 index 00000000..1c78408b --- /dev/null +++ b/apps/web/app/modules/Courses/NewCourseView/MoreCoursesByAuthor.tsx @@ -0,0 +1,56 @@ +import { isEmpty } from "lodash-es"; + +import { useUserById } from "~/api/queries/admin/useUserById"; +import { useTeacherCourses } from "~/api/queries/useTeacherCourses"; +import { Icon } from "~/components/Icon"; +import Loader from "~/modules/common/Loader/Loader"; +import { StudentCoursesCarousel } from "~/modules/Dashboard/Courses/StudentCoursesCarousel"; + +type MoreCoursesByAuthorProps = { + teacherId: string; +}; + +export const MoreCoursesByAuthor = ({ teacherId }: MoreCoursesByAuthorProps) => { + const { data: teacherCourses, isLoading } = useTeacherCourses(teacherId); + const { data: teacherData } = useUserById(teacherId); + + return ( +
+
+

+ More courses by {teacherData?.firstName} {teacherData?.lastName} +

+

+ Below you can see more courses created by the same author +

+
+
+ {!teacherCourses || + (isEmpty(teacherCourses) && ( +
+
+ +
+
+

+ We could not find any courses +

+

+ Please change the search criteria or try again later +

+
+
+ ))} + {isLoading && ( +
+ +
+ )} + +
+
+ ); +}; diff --git a/apps/web/app/modules/Courses/NewCourseView/NewCourseView.page.tsx b/apps/web/app/modules/Courses/NewCourseView/NewCourseView.page.tsx new file mode 100644 index 00000000..e0c39215 --- /dev/null +++ b/apps/web/app/modules/Courses/NewCourseView/NewCourseView.page.tsx @@ -0,0 +1,127 @@ +import { useParams } from "@remix-run/react"; + +import { useCourse } from "~/api/queries"; +import { useUserDetails } from "~/api/queries/useUserDetails"; +import { Gravatar } from "~/components/Gravatar"; +import { PageWrapper } from "~/components/PageWrapper"; +import { Avatar } from "~/components/ui/avatar"; +import { Button } from "~/components/ui/button"; +import Overview from "~/modules/Courses/Lesson/Overview"; +import { CourseChapter } from "~/modules/Courses/NewCourseView/CourseChapter"; +import { MoreCoursesByAuthor } from "~/modules/Courses/NewCourseView/MoreCoursesByAuthor"; +import { YouMayBeInterestedIn } from "~/modules/Courses/NewCourseView/YouMayBeInterestedIn"; + +export default function NewCourseViewPage() { + const { id = "" } = useParams(); + const { data: course, isLoading } = useCourse(id); + const { data: userDetails } = useUserDetails(course?.authorId ?? ""); + + if (isLoading) { + return null; + } + + const breadcrumbs = [ + { + title: "Dashboard", + href: "/", + }, + { + title: course?.title ?? "", + href: `/course/${id}`, + }, + ]; + + return ( + +
+
+ +
+
+

Chapters

+

+ Below you can see all chapters inside this course +

+
+ + + +
+ + +
+
+

Options

+
+ + +
+

Author

+
+ + + +
+

+ {userDetails?.firstName} {userDetails?.lastName} +

+
+

+ Title:{" "} + {userDetails?.jobTitle} +

+
+
+
+
+
+ About +
+
+

{userDetails?.description}

+
+ + +
+
+
+ ); +} diff --git a/apps/web/app/modules/Courses/NewCourseView/YouMayBeInterestedIn.tsx b/apps/web/app/modules/Courses/NewCourseView/YouMayBeInterestedIn.tsx new file mode 100644 index 00000000..58c8cfec --- /dev/null +++ b/apps/web/app/modules/Courses/NewCourseView/YouMayBeInterestedIn.tsx @@ -0,0 +1,51 @@ +import { isEmpty } from "lodash-es"; + +import { useTeacherCourses } from "~/api/queries/useTeacherCourses"; +import { Icon } from "~/components/Icon"; +import Loader from "~/modules/common/Loader/Loader"; +import { StudentCoursesCarousel } from "~/modules/Dashboard/Courses/StudentCoursesCarousel"; + +export const YouMayBeInterestedIn = ({ teacherId }: { teacherId: string }) => { + // const { data: teacherCourses, isLoading } = useTeacherCourses(teacherId); + const { data: teacherCourses, isLoading } = useTeacherCourses(teacherId); + const sortedTeacherCourses = teacherCourses?.sort((a, b) => (b.title > a.title ? 1 : -1)); + return ( +
+
+

+ You may be interested in +

+

+ Below you can see courses with similar topic or knowledge domain{" "} +

+
+
+ {!teacherCourses || + (isEmpty(teacherCourses) && ( +
+
+ +
+
+

+ We could not find any courses +

+

+ Please change the search criteria or try again later +

+
+
+ ))} + {isLoading && ( +
+ +
+ )} + +
+
+ ); +}; diff --git a/apps/web/app/modules/Courses/NewCourseView/index.ts b/apps/web/app/modules/Courses/NewCourseView/index.ts new file mode 100644 index 00000000..67e02075 --- /dev/null +++ b/apps/web/app/modules/Courses/NewCourseView/index.ts @@ -0,0 +1 @@ +export { NewCourseViewPage } from "./NewCourseView.page"; diff --git a/apps/web/app/modules/Dashboard/Courses/StudentCoursesCarousel.tsx b/apps/web/app/modules/Dashboard/Courses/StudentCoursesCarousel.tsx index cf95670b..90c3dc3b 100644 --- a/apps/web/app/modules/Dashboard/Courses/StudentCoursesCarousel.tsx +++ b/apps/web/app/modules/Dashboard/Courses/StudentCoursesCarousel.tsx @@ -37,7 +37,7 @@ export const StudentCoursesCarousel = ({ studentCourses }: StudentCoursesCarouse return ( - + {carouselItems}
diff --git a/apps/web/app/modules/Teacher/Teacher.page.tsx b/apps/web/app/modules/Teacher/Teacher.page.tsx index 1def0bdd..dee39c57 100644 --- a/apps/web/app/modules/Teacher/Teacher.page.tsx +++ b/apps/web/app/modules/Teacher/Teacher.page.tsx @@ -1,6 +1,5 @@ import { useParams } from "@remix-run/react"; -import { useUserById } from "~/api/queries/admin/useUserById"; import { useTeacherCourses } from "~/api/queries/useTeacherCourses"; import { useUserDetails } from "~/api/queries/useUserDetails"; import { ButtonGroup } from "~/components/ButtonGroup/ButtonGroup"; @@ -16,21 +15,23 @@ import { TeacherPageBreadcrumbs } from "./TeacherPageBreadcrumbs"; export default function TeacherPage() { const { id = "" } = useParams(); const { data: userDetails } = useUserDetails(id); - const { data: user } = useUserById(id); const { data: teacherCourses } = useTeacherCourses(id); return ( - +
- +

- {user?.firstName} {user?.lastName} + {userDetails?.firstName} {userDetails?.lastName}

diff --git a/apps/web/routes.ts b/apps/web/routes.ts index 60ce1cd0..aa80323a 100644 --- a/apps/web/routes.ts +++ b/apps/web/routes.ts @@ -15,7 +15,7 @@ export const routes: ( index: true, }); route("courses", "modules/Dashboard/Dashboard.page.tsx"); - route("course/:id", "modules/Courses/CourseView/CourseView.page.tsx"); + route("course/:id", "modules/Courses/NewCourseView/NewCourseView.page.tsx"); route("course/:courseId/lesson/:lessonId", "modules/Courses/Lesson/Lesson.page.tsx"); route("settings", "modules/Dashboard/Settings/Settings.page.tsx"); route("teachers/:id", "modules/Teacher/Teacher.page.tsx");