From bfe3d977bbcfbc6c7f950f0c1f87c3895353d9c2 Mon Sep 17 00:00:00 2001 From: Ascent817 Date: Mon, 11 Dec 2023 17:39:35 +0000 Subject: [PATCH] Run Prettier --- src/App.css | 8 +++++--- src/App.tsx | 5 ++--- src/components/Course.tsx | 42 ++++++++++++++++++++++++--------------- src/index.tsx | 19 +++++++++++++----- 4 files changed, 47 insertions(+), 27 deletions(-) diff --git a/src/App.css b/src/App.css index 2387a67..8fef861 100644 --- a/src/App.css +++ b/src/App.css @@ -126,7 +126,8 @@ ion-icon { color: var(--primary); } -.navigation ul li a .icon, .navigation ul li button .icon { +.navigation ul li a .icon, +.navigation ul li button .icon { align-items: center; display: flex; height: 65.5px; @@ -137,7 +138,8 @@ ion-icon { text-align: center; } -.navigation ul li a .icon ion-icon, .navigation ul li button .icon ion-icon { +.navigation ul li a .icon ion-icon, +.navigation ul li button .icon ion-icon { font-size: 1.75rem; } @@ -281,7 +283,7 @@ ion-icon { .Course:target { box-shadow: rgba(141, 22, 38, 0.5) 0px 6px 24px 0px, - rgba(203, 32, 55, 0.75) 0px 0px 0px 2px; + rgba(203, 32, 55, 0.75) 0px 0px 0px 2px; transition: all 0.5s ease 0s; } diff --git a/src/App.tsx b/src/App.tsx index 795e01d..fe089f3 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -17,8 +17,7 @@ interface AppProps { authLevel: number; } -const App: FC = ({user, classItems, authLevel }): JSX.Element => { - +const App: FC = ({ user, classItems, authLevel }): JSX.Element => { // Hacky workaround because something with React probably interferes with the default browser behavior // Also, reactivates the highlight on the course element useEffect(() => { @@ -26,7 +25,7 @@ const App: FC = ({user, classItems, authLevel }): JSX.Element => { window.location.hash = ''; window.location.hash = jumpId; }, []); - + const handleContactModalOpen = useCallback(() => { const contactModal = document.getElementById( 'contact-modal' diff --git a/src/components/Course.tsx b/src/components/Course.tsx index 2fc4d4e..f6531f2 100644 --- a/src/components/Course.tsx +++ b/src/components/Course.tsx @@ -133,12 +133,19 @@ export const Course: FC = ({ const isVenture = course.tags?.filter((tag) => tag === 'Venture').length; const Style = { - gridRow: `span ${course.courses?.match(/[A-Z][A-Z][A-Z][0-9][0-9][0-9]/gm)?.length ?? 1}`, + gridRow: `span ${ + course.courses?.match(/[A-Z][A-Z][A-Z][0-9][0-9][0-9]/gm)?.length ?? 1 + }`, backgroundColor: isVenture ? 'var(--primary-light)' : '', }; return ( -
+

{course.coursename}


= ({ Courses: {course.courses}

- {course.courses.match(/[A-Z][A-Z][A-Z][0-9][0-9][0-9]/gm)?.filter((id) => courseIDtoCourse(id)).map((id) => { - return ( - <> -
- - - ); - })} + {course.courses + .match(/[A-Z][A-Z][A-Z][0-9][0-9][0-9]/gm) + ?.filter((id) => courseIDtoCourse(id)) + .map((id) => { + return ( + <> +
+ + + ); + })}
)} diff --git a/src/index.tsx b/src/index.tsx index 6daf9b1..3ef558c 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -58,7 +58,13 @@ const renderDOM = (courseItems: JSX.Element[], userData = user): void => { numColumns = 1; } - let flexParents = Array(numColumns).fill(0).map((_, i) =>
{courseItems.filter((_, j) => j % numColumns === i)}
); + let flexParents = Array(numColumns) + .fill(0) + .map((_, i) => ( +
+ {courseItems.filter((_, j) => j % numColumns === i)} +
+ )); ReactDOM.render( @@ -101,9 +107,11 @@ const initializeCourseViewer = (): void => { const courseIDtoNameMap = new Map(); for (const courseName in courseData) { - courseData[courseName].courseid.match(/[A-Z][A-Z][A-Z][0-9][0-9][0-9]/)?.forEach((id) => { - courseIDtoNameMap.set(id, courseName); - }); + courseData[courseName].courseid + .match(/[A-Z][A-Z][A-Z][0-9][0-9][0-9]/) + ?.forEach((id) => { + courseIDtoNameMap.set(id, courseName); + }); } console.log(courseIDtoNameMap); @@ -250,7 +258,8 @@ export const filterCourses = (): void => { courseIDtoNameMap.set(courseData[courseName].courseid, courseName); } - const courseIDtoCourse = (courseID: string): CourseType => courseData[courseIDtoNameMap.get(courseID) ?? ''] ?? ''; + const courseIDtoCourse = (courseID: string): CourseType => + courseData[courseIDtoNameMap.get(courseID) ?? ''] ?? ''; const key = search?.value.toLowerCase().replaceAll(' ', '-'); const renderedElements = renderedItems