diff --git a/frontend/src/app/Catalog/Class/Class.module.scss b/frontend/src/app/Catalog/Class/Class.module.scss index 8560bd912..2e552c036 100644 --- a/frontend/src/app/Catalog/Class/Class.module.scss +++ b/frontend/src/app/Catalog/Class/Class.module.scss @@ -16,56 +16,40 @@ } .header { - border-bottom: 1px solid var(--border-color); + padding: 24px 24px 12px; - .information { + .group { display: flex; - align-items: center; - gap: 12px; - padding: 16px 24px 12px; - font-size: 14px; - line-height: 1; - - .units { - color: var(--paragraph-color); - user-select: none; - } + justify-content: space-between; + margin-bottom: 24px; } - .details { - padding: 24px 24px 0; + .row { display: flex; - align-items: flex-start; + align-items: center; gap: 12px; + } - .group { - display: flex; - gap: 12px; - } - - .text { - flex-grow: 1; - - .heading { - font-size: 24px; - line-height: 1.25; - font-weight: 700; - color: var(--heading-color); - margin-bottom: 8px; - } - - .description { - font-size: 16px; - line-height: 1.5; - color: var(--paragraph-color); - } - } + .heading { + font-size: 24px; + line-height: 1.25; + font-weight: 700; + color: var(--heading-color); + margin-bottom: 8px; } - .menu { - display: flex; - padding: 0 12px; - align-items: center; + .description { + font-size: 16px; + line-height: 1.5; + color: var(--paragraph-color); + margin-bottom: 16px; } } + + .menu { + display: flex; + border-bottom: 1px solid var(--border-color); + padding: 0 12px; + align-items: center; + } } \ No newline at end of file diff --git a/frontend/src/app/Catalog/Class/index.tsx b/frontend/src/app/Catalog/Class/index.tsx index 786cde025..ae15a3b87 100644 --- a/frontend/src/app/Catalog/Class/index.tsx +++ b/frontend/src/app/Catalog/Class/index.tsx @@ -1,14 +1,16 @@ import { useMemo, useState } from "react"; import { useQuery } from "@apollo/client"; -import { Bookmark, CalendarPlus, Xmark } from "iconoir-react"; +import { BookmarkSolid, CalendarPlus, Heart, Xmark } from "iconoir-react"; import { Link, useSearchParams } from "react-router-dom"; import AverageGrade from "@/components/AverageGrade"; +import Button from "@/components/Button"; import CCN from "@/components/CCN"; import Capacity from "@/components/Capacity"; import IconButton from "@/components/IconButton"; import MenuItem from "@/components/MenuItem"; +import Units from "@/components/Units"; import { GET_CLASS, ICatalogClass, @@ -38,10 +40,6 @@ const views = [ text: "Enrollment", Component: () => null, }, - { - text: "Discussion", - Component: () => null, - }, ]; interface ClassProps { @@ -88,49 +86,42 @@ export default function Class({ const currentClass = useMemo(() => classData?.class, [classData?.class]); - const units = useMemo(() => { - const { unitsMin: minimum, unitsMax: maximum } = - currentClass ?? partialClass; - - return maximum === minimum - ? `${minimum} ${minimum === 1 ? "unit" : "units"}` - : `${minimum} - ${maximum} units`; - }, [currentClass, partialClass]); - const Component = useMemo(() => views[view].Component, [view]); return (
- {currentClass?.title ?? currentCourse.title} -
-+ {currentClass?.title ?? partialClass.title ?? currentCourse.title} +
+{title ?? course.title}
- {unitsMin === unitsMax - ? `${unitsMax} ${unitsMax === 1 ? "unit" : "units"}` - : `${unitsMin} - ${unitsMax} units`} -
+Time
Location
{instructors?.length > 1 ? "Instructors" : "Instructor"} diff --git a/frontend/src/components/Units/Units.module.scss b/frontend/src/components/Units/Units.module.scss new file mode 100644 index 000000000..f6cd0173d --- /dev/null +++ b/frontend/src/components/Units/Units.module.scss @@ -0,0 +1,5 @@ +.root { + font-size: 14px; + color: var(--paragraph-color); + line-height: 1; +} \ No newline at end of file diff --git a/frontend/src/components/Units/index.tsx b/frontend/src/components/Units/index.tsx new file mode 100644 index 000000000..3a2af6d4c --- /dev/null +++ b/frontend/src/components/Units/index.tsx @@ -0,0 +1,18 @@ +import { useMemo } from "react"; + +import styles from "./Units.module.scss"; + +interface UnitsProps { + unitsMin: number; + unitsMax: number; +} + +export default function Units({ unitsMin, unitsMax }: UnitsProps) { + const units = useMemo(() => { + return unitsMax === unitsMin + ? `${unitsMin} ${unitsMin === 1 ? "unit" : "units"}` + : `${unitsMin} - ${unitsMax} units`; + }, [unitsMax, unitsMin]); + + return
{units}
; +}