-
Notifications
You must be signed in to change notification settings - Fork 0
Use design palette highlight color (#f8eedf) for all page headers #168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
11d92c1
90bbe07
7e97f2c
55b8365
cc1225f
6507a0c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| import { ComponentProps, forwardRef } from "react"; | ||
|
|
||
| import { cn } from "../utils/styles"; | ||
|
|
||
| /* | ||
| * since some of the header elements currently being used on the site seem | ||
| * somewhat arbitrary, the only consistent styling is just the highlight | ||
| * color. | ||
| * | ||
| * when we want more consistency we can use these to enforce specific | ||
| * styling. | ||
| * | ||
| * the current elements (2026/04/24) are 1:1 replacement for base html | ||
| * elements and only modify the styling and everything else is just passed | ||
| * through without changes. | ||
| */ | ||
|
|
||
| export const H1 = forwardRef<HTMLHeadingElement, ComponentProps<"h1">>(({className, ...props}, ref) => { | ||
| return <h1 | ||
| ref={ref} | ||
| className={cn("text-highlight-500", className)} | ||
| {...props} | ||
| />; | ||
| }); | ||
| H1.displayName = "H1"; | ||
|
Comment on lines
+18
to
+25
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice abstraction overall. One thing to maybe tweak: these heading wrappers pass children through Could we destructure children explicitly and render it inside the heading element? That should keep the behavior the same and avoid the new lint noise.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this was a similar process as to what I have done with a different project. the idea being that they only thing that needs to be extracted is and then everything else is just passed through without worrying about what it is. if we are starting to use |
||
|
|
||
| export const H2 = forwardRef<HTMLHeadingElement, ComponentProps<"h2">>(({className, ...props}, ref) => { | ||
| return <h2 | ||
| ref={ref} | ||
| className={cn("text-highlight-500", className)} | ||
| {...props} | ||
| />; | ||
| }); | ||
| H2.displayName = "H2"; | ||
|
|
||
| export const H3 = forwardRef<HTMLHeadingElement, ComponentProps<"h3">>(({className, ...props}, ref) => { | ||
| return <h3 | ||
| ref={ref} | ||
| className={cn("text-highlight-500", className)} | ||
| {...props} | ||
| />; | ||
| }); | ||
| H3.displayName = "H3"; | ||
|
|
||
| export const H4 = forwardRef<HTMLHeadingElement, ComponentProps<"h4">>(({className, ...props}, ref) => { | ||
| return <h4 | ||
| ref={ref} | ||
| className={cn("text-highlight-500", className)} | ||
| {...props} | ||
| />; | ||
| }); | ||
| H4.displayName = "H4"; | ||
|
|
||
| export const H5 = forwardRef<HTMLHeadingElement, ComponentProps<"h5">>(({className, ...props}, ref) => { | ||
| return <h5 | ||
| ref={ref} | ||
| className={cn("text-highlight-500", className)} | ||
| {...props} | ||
| />; | ||
| }); | ||
| H5.displayName = "H5"; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,7 @@ import bulbLit from '/bulb(lit).svg'; | |
|
|
||
| import { useCourseProgress } from '../../hooks/useCourse'; | ||
| import Loading from '../../components/loading/LoadingPage'; | ||
| import { H1, H2 } from "../../components/typography"; | ||
| import { ErrorPage } from '../../components/error/Error'; | ||
| import { useAxiosFetch } from "../../hooks/fetching"; | ||
| import { useEffect, useState } from "react"; | ||
|
|
@@ -71,7 +72,7 @@ export default function TeacherView({ onCourseChange }: TeacherViewProps) { | |
| if (loading || course_loading) { | ||
| return <Loading />; | ||
| } | ||
|
|
||
| if (error || course_error || course == null || !students) { | ||
| return <ErrorPage message="Failed to load course information"/>; | ||
| } | ||
|
|
@@ -105,7 +106,7 @@ export default function TeacherView({ onCourseChange }: TeacherViewProps) { | |
| } | ||
|
|
||
| async function toggleAutoEnroll() { | ||
| if (!enrolling) return; | ||
| if (!enrolling) return; | ||
| const next = !autoEnroll; | ||
| await persistFlags(enrolling, next); | ||
| } | ||
|
|
@@ -188,9 +189,9 @@ export default function TeacherView({ onCourseChange }: TeacherViewProps) { | |
| <div className="w-full flex flex-col items-center bg-black gap-8 py-8"> | ||
| {/* ───────── header + invite link ───────── */} | ||
| <div className="bg-foreground-600 w-3/4 rounded-md p-4"> | ||
| <span className="text-[16px] font-bold text-foreground-200"> | ||
| <H1 className="text-[16px] font-bold"> | ||
| Teacher Dashboard | ||
| </span> | ||
| </H1> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I noticed this changes I assume that was intentional, but wanted to confirm the goal here was also to make it a semantic page heading, not just to pick up the shared heading styling.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that was the idea, since it had the exact same heading style I figured I would just make it a heading. |
||
|
|
||
| {/* invite link */} | ||
| <div className="mt-4 flex items-center gap-2"> | ||
|
|
@@ -284,9 +285,9 @@ export default function TeacherView({ onCourseChange }: TeacherViewProps) { | |
| {/* ───────── progress table ───────── */} | ||
| <div className="bg-foreground-600 w-3/4 rounded-md p-4"> | ||
| <div className="flex items-center justify-between mb-4"> | ||
| <h1 className="font-bold text-foreground-200 text-[16px]"> | ||
| <H1 className="font-bold text-[16px]"> | ||
| Student Progress | ||
| </h1> | ||
| </H1> | ||
| <button | ||
| onClick={handleExportCsv} | ||
| disabled={exporting || students.length === 0} | ||
|
|
@@ -396,12 +397,12 @@ export default function TeacherView({ onCourseChange }: TeacherViewProps) { | |
| {/* ─── pending enrollment requests ─── */} | ||
| {pending.length > 0 && ( | ||
| <div className="bg-foreground-600 w-3/4 rounded-md p-4"> | ||
| <h2 className="font-bold text-foreground-200 text-[16px] mb-4"> | ||
| <H2 className="font-bold text-[16px] mb-4"> | ||
| Pending Enrollment Requests ({pending.length}) | ||
| </h2> | ||
| </H2> | ||
| <PendingRequestsCard courseId={courseId} pending={pending} /> | ||
| </div> | ||
| )} | ||
| </div> | ||
| ); | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-blocking: should this file be renamed to
typography.tsxbefore more imports depend on thetypeographyspelling?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I should probably fix my bad spelling