From 877d14452f1c5cf5bf9c657d719bd71f8e56d776 Mon Sep 17 00:00:00 2001 From: Kevin Wu Date: Thu, 18 Jan 2024 20:12:40 -0800 Subject: [PATCH 1/2] feat: run prettier and linter (#862) --- .../Toolbar/CustomEventDialog/DaySelector.tsx | 2 +- apps/antalmanac/src/components/Map/Map.tsx | 19 +++++++++++-------- apps/antalmanac/src/components/Map/Marker.tsx | 4 ++-- apps/antalmanac/src/components/Map/Routes.tsx | 2 +- .../SearchForm/SectionCodeSearchBar.tsx | 6 +++--- .../CoursePane/SearchForm/TermSelector.tsx | 4 +--- .../RightPane/SectionTable/PrereqTree.css | 15 ++++++--------- 7 files changed, 25 insertions(+), 27 deletions(-) diff --git a/apps/antalmanac/src/components/Calendar/Toolbar/CustomEventDialog/DaySelector.tsx b/apps/antalmanac/src/components/Calendar/Toolbar/CustomEventDialog/DaySelector.tsx index b86c60d71..018113a77 100644 --- a/apps/antalmanac/src/components/Calendar/Toolbar/CustomEventDialog/DaySelector.tsx +++ b/apps/antalmanac/src/components/Calendar/Toolbar/CustomEventDialog/DaySelector.tsx @@ -23,7 +23,7 @@ const DaySelector: React.FC = ({ useEffect(() => { onSelectDay(selectedDays); - }, [selectedDays]); + }, [onSelectDay, selectedDays]); const handleChange = (dayIndex: number) => (event: React.ChangeEvent) => { const newSelectedDays = [...selectedDays]; diff --git a/apps/antalmanac/src/components/Map/Map.tsx b/apps/antalmanac/src/components/Map/Map.tsx index 4516c7ef3..8408c1446 100644 --- a/apps/antalmanac/src/components/Map/Map.tsx +++ b/apps/antalmanac/src/components/Map/Map.tsx @@ -289,13 +289,16 @@ export default function CourseMap() { */ const startDestPairs = useMemo(() => { const allEvents = [...markersToDisplay, ...customEventMarkersToDisplay]; - return allEvents.reduce((acc, cur, index) => { - acc.push([cur]); - if (index > 0) { - acc[index - 1].push(cur); - } - return acc; - }, [] as (typeof allEvents)[]); + return allEvents.reduce( + (acc, cur, index) => { + acc.push([cur]); + if (index > 0) { + acc[index - 1].push(cur); + } + return acc; + }, + [] as (typeof allEvents)[] + ); }, [markersToDisplay, customEventMarkersToDisplay]); return ( @@ -352,7 +355,7 @@ export default function CourseMap() { diff --git a/apps/antalmanac/src/components/Map/Marker.tsx b/apps/antalmanac/src/components/Map/Marker.tsx index 34a0110d1..477840bf9 100644 --- a/apps/antalmanac/src/components/Map/Marker.tsx +++ b/apps/antalmanac/src/components/Map/Marker.tsx @@ -10,7 +10,7 @@ const IMAGE_CMS_URL = 'https://cms.concept3d.com/map/lib/image-cache/i.php?mapId /** * returns a leaflet DivIcon that can replace the marker's default blue icon */ -function getMarkerIcon(color = '', stackIndex = 1, label: any = '') { +function getMarkerIcon(color = '', stackIndex = 1, label = '') { return Leaflet.divIcon({ /** * Adds offset to __marker__ for stacking markers. @@ -63,7 +63,7 @@ interface Props { location?: string; acronym?: string; stackIndex?: number; - label?: any; + label?: string; children?: React.ReactNode; } diff --git a/apps/antalmanac/src/components/Map/Routes.tsx b/apps/antalmanac/src/components/Map/Routes.tsx index 597e15f83..b22f413f6 100644 --- a/apps/antalmanac/src/components/Map/Routes.tsx +++ b/apps/antalmanac/src/components/Map/Routes.tsx @@ -146,7 +146,7 @@ export default function ClassRoutes(props: ClassRoutesProps) { return () => { routerRef.current.instance.remove(); }; - }, []); + }, [context.map, routerRef]); return null; } diff --git a/apps/antalmanac/src/components/RightPane/CoursePane/SearchForm/SectionCodeSearchBar.tsx b/apps/antalmanac/src/components/RightPane/CoursePane/SearchForm/SectionCodeSearchBar.tsx index ab38581ab..abe296bb9 100644 --- a/apps/antalmanac/src/components/RightPane/CoursePane/SearchForm/SectionCodeSearchBar.tsx +++ b/apps/antalmanac/src/components/RightPane/CoursePane/SearchForm/SectionCodeSearchBar.tsx @@ -10,9 +10,9 @@ class SectionCodeSearchBar extends PureComponent { } getSectionCode() { - return RightPaneStore.getUrlCourseCodeValue() - ? this.updateCourseCodeAndGetFormData() - : RightPaneStore.getFormData().sectionCode; + return RightPaneStore.getUrlCourseCodeValue() + ? this.updateCourseCodeAndGetFormData() + : RightPaneStore.getFormData().sectionCode; } state = { diff --git a/apps/antalmanac/src/components/RightPane/CoursePane/SearchForm/TermSelector.tsx b/apps/antalmanac/src/components/RightPane/CoursePane/SearchForm/TermSelector.tsx index 270c10b5d..344839614 100644 --- a/apps/antalmanac/src/components/RightPane/CoursePane/SearchForm/TermSelector.tsx +++ b/apps/antalmanac/src/components/RightPane/CoursePane/SearchForm/TermSelector.tsx @@ -19,9 +19,7 @@ class TermSelector extends PureComponent { } getTerm() { - return RightPaneStore.getUrlTermValue() - ? this.updateTermAndGetFormData() - : RightPaneStore.getFormData().term + return RightPaneStore.getUrlTermValue() ? this.updateTermAndGetFormData() : RightPaneStore.getFormData().term; } state = { diff --git a/apps/antalmanac/src/components/RightPane/SectionTable/PrereqTree.css b/apps/antalmanac/src/components/RightPane/SectionTable/PrereqTree.css index 743b7596b..a0ca4fe22 100644 --- a/apps/antalmanac/src/components/RightPane/SectionTable/PrereqTree.css +++ b/apps/antalmanac/src/components/RightPane/SectionTable/PrereqTree.css @@ -1,13 +1,12 @@ :root { --grey-light-theme: #8d8d8d; --background-grey-light-theme: #e0e0e0; - } +} .dependency-list-branch { margin: auto; } - .prereq-tree { display: flex; flex-direction: column; @@ -72,7 +71,6 @@ height: 1px; } - .course-node { margin: auto 1rem auto 0; } @@ -85,7 +83,6 @@ margin-right: 0; } - .dependency-node:first-child:last-child::after { height: 0 !important; } @@ -194,10 +191,10 @@ } .course { - border-radius: 3px; - font-size: .8rem; - font-weight: 500; - padding: 0.35rem; + border-radius: 3px; + font-size: 0.8rem; + font-weight: 500; + padding: 0.35rem; } .missing-tree { @@ -209,4 +206,4 @@ /* Styling that targets the Popover component (not sure why it can't be done inline)*/ .MuiPopover-paper { overflow-x: auto; -} \ No newline at end of file +} From af8e096222e23afdc27626f499b39b2d7f848534 Mon Sep 17 00:00:00 2001 From: Kevin Wu Date: Wed, 24 Jan 2024 11:13:03 -0800 Subject: [PATCH 2/2] style: remove hardcoded gutter width (#866) --- apps/antalmanac/src/components/Calendar/calendar.css | 8 -------- 1 file changed, 8 deletions(-) diff --git a/apps/antalmanac/src/components/Calendar/calendar.css b/apps/antalmanac/src/components/Calendar/calendar.css index 38843ba4b..dd5770613 100644 --- a/apps/antalmanac/src/components/Calendar/calendar.css +++ b/apps/antalmanac/src/components/Calendar/calendar.css @@ -40,14 +40,6 @@ font-size: 0.9rem; } -.rbc-time-header-gutter { - width: 42px; -} - -.rbc-time-gutter { - width: 42px; -} - @media (min-resolution: 96dpi) { .rbc-timeslot-group { min-height: 28px;