Skip to content

Commit 3f0a564

Browse files
committed
added documentation to TopicTagProps and TimetableHeader components and updated resizeAndPositionTimetableHeaders documentation to mention the resizing of the timetable-headers component
1 parent 2bc9c7d commit 3f0a564

4 files changed

Lines changed: 19 additions & 3 deletions

File tree

client/src/components/timetable.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,12 @@ function resizeAndPositionTimetableForeground() {
117117

118118
/*
119119
Sync the left position of the TimetableHeaders in the foreground with their
120-
respective columns, set the top position to 0px.
120+
respective columns, set the top position to 0px, ensures Time-header remains
121+
in the top left corner.
122+
123+
Also resizes the timetable-headers container to the width of timetable-content
124+
element and height of Time-header to prevent underlying elements from showing
125+
through the gaps between headers.
121126
*/
122127
function resizeAndPositionTimetableHeaders() {
123128
const timetable_headers = document.getElementById("timetable-headers");

client/src/components/timetable_column.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ interface TimetableColumnProps {
1111
}
1212

1313
/*
14-
A column of the timetable containing TimetableSlots.
14+
A column of the timetable containing 25 TimetableSlots (header + one each hour).
1515
*/
1616
export default function TimetableColumn({ day }: TimetableColumnProps) {
1717
const now = new Date(Date.now());
@@ -67,7 +67,8 @@ export default function TimetableColumn({ day }: TimetableColumnProps) {
6767

6868
/*
6969
A TimetableColumn for the time labels. Header has text "Time", all other slots
70-
have text "HH:MM" for time time they represent. Already has sticky set.
70+
have text "HH:MM" for time time they represent. Each slot has its id set to its
71+
time prop value.
7172
*/
7273
export function TimetableTimeLabelsColumn() {
7374
return (

client/src/components/timetable_slot.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ function TimetableSlot({
6767

6868
export default TimetableSlot;
6969

70+
/*
71+
A slightly modified TimetableSlot designed to be displayed in the foreground
72+
with the styling of a TimetableSlot with header=true.
73+
Has id set to its label + "-header" suffix.
74+
*/
7075
export function TimetableHeader({ label }: TimetableSlotProps) {
7176
return (
7277
<div

client/src/components/topic_tag.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
@prop name: The String to display within the topic tag.
3+
@prop color_hex: The integer representing the hex code of the color to display
4+
within the circle in the tag.
5+
*/
16
interface TopicTagProps {
27
name: string;
38
color_hex: number;

0 commit comments

Comments
 (0)