diff --git a/src/views/components/CourseCatalogMain.tsx b/src/views/components/CourseCatalogMain.tsx index 32096fdb..cd2db505 100644 --- a/src/views/components/CourseCatalogMain.tsx +++ b/src/views/components/CourseCatalogMain.tsx @@ -10,6 +10,7 @@ import Icon from './common/Icon/Icon'; import Text from './common/Text/Text'; import AutoLoad from './injected/AutoLoad/AutoLoad'; import CoursePopup from './injected/CoursePopup/CoursePopup'; +import RecruitmentBanner from './injected/RecruitmentBanner/RecruitmentBanner'; import TableHead from './injected/TableHead'; import TableRow from './injected/TableRow/TableRow'; @@ -54,6 +55,7 @@ export default function CourseCatalogMain({ support }: Props) { return ( + Plus {rows.map(row => { if (!row.course) { diff --git a/src/views/components/common/Link/Link.tsx b/src/views/components/common/Link/Link.tsx index d0d49aaf..9d0289b7 100644 --- a/src/views/components/common/Link/Link.tsx +++ b/src/views/components/common/Link/Link.tsx @@ -4,7 +4,7 @@ import { bMessenger } from 'src/shared/messages'; import Text, { TextProps } from '../Text/Text'; import styles from './Link.module.scss'; -type Props = TextProps & { +type Props = Omit & { url?: string; disabled?: boolean; }; @@ -27,6 +27,7 @@ export default function Link(props: PropsWithChildren) { {numInstructors > 1 && index === course.instructors.length - 1 ? '& ' : ''} - + {name} {numInstructors > 2 && !isLast ? ', ' : ''} @@ -80,7 +79,6 @@ export default function CourseHeader({ course, onClose }: Props) { {' in '} (null); + + const shouldShowBanner = (): boolean => { + const params = ['fos_fl', 'fos_cn']; + let department = ''; + params.forEach(p => { + const param = new URLSearchParams(window.location.search).get(p); + if (param) { + department = param; + } + }); + if (!department) { + return false; + } + return RECRUIT_FROM_DEPARTMENTS.includes(department); + }; + + useEffect(() => { + if (!shouldShowBanner()) { + return; + } + const container = document.createElement('div'); + container.setAttribute('id', 'ut-registration-plus-table-head'); + + const table = document.querySelector('table'); + table!.before(container); + setContainer(container); + }, []); + + if (!container) { + return null; + } + + return createPortal( +
+ + Interested in helping us develop UT Registration Plus? Check out our{' '} + + Discord Server + {' '} + and{' '} + + GitHub + + ! + +
, + container + ); +}