* feat: enable TS strict mode * fix: strict TS errors * fix: strict TS errors * fix: strict TS errors * fix: strict TS errors * fix: strict TS errors * fix: strict TS errors * fix: strict TS errors * fix: strict TS errors * fix: colors bug with default * fix: strict TS errors * fix: strict TS errors * fix: strict TS errors * fix: strict TS errors * fix: strict TS errors * fix: strict TS errors * fix: strict TS errors * fix: strict TS errors * fix: strict TS errors * fix: strict TS errors * fix: strict TS errors * fix: text type errors * fix: strict TS errors * fix: strict TS errors * fix: strict TS errors - add definite assignment assertion * fix: strict TS errors - add definite assignment assertion * fix: strict TS errors * fix: strict TS errors * fix: strict TS errors * fix: strict TS errors * fix: strict TS errors * fix: strict TS errors * fix(ESLint): error on no-explicit-any * fix: type annotations for any types * fix: strict TS errors * fix: strict TS errors * fix: strict TS errors * fix: strict TS errors (and remove packages) * fix: strict TS errors * fix: strict TS errors * fix: strict TS errors * fix: strict TS errors * fix: strict TS errors * fix: strict TS errors * fix: strict TS errors * feat: enable React.StrictMode * fix: strict TS errors (done!) * fix: build error * fix: replace no-explicit-any assertions * refactor: cleanup * refactor: more cleanup * style: prettier --------- Co-authored-by: Lukas Zenick <lukas@utexas.edu> Co-authored-by: Razboy20 <razboy20@gmail.com>
27 lines
682 B
TypeScript
27 lines
682 B
TypeScript
import type { ScrapedRow } from '@shared/types/Course';
|
|
import { useEffect } from 'react';
|
|
|
|
import styles from './TableSubheading.module.scss';
|
|
|
|
interface Props {
|
|
row: ScrapedRow;
|
|
}
|
|
|
|
/**
|
|
* This component is injected into each row of the course catalog table.
|
|
* @returns a react portal to the new td in the column or null if the column has not been created yet.
|
|
*/
|
|
export default function TableSubheading({ row }: Props): JSX.Element | null {
|
|
const { element } = row;
|
|
|
|
useEffect(() => {
|
|
element.classList.add(styles.subheader!);
|
|
|
|
return () => {
|
|
element.classList.remove(styles.subheader!);
|
|
};
|
|
}, [element]);
|
|
|
|
return null;
|
|
}
|