Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: run prettier and linter #862

Merged
merged 4 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const DaySelector: React.FC<DaySelectorProps> = ({

useEffect(() => {
onSelectDay(selectedDays);
}, [selectedDays]);
}, [onSelectDay, selectedDays]);

const handleChange = (dayIndex: number) => (event: React.ChangeEvent<HTMLInputElement>) => {
const newSelectedDays = [...selectedDays];
Expand Down
19 changes: 11 additions & 8 deletions apps/antalmanac/src/components/Map/Map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -352,7 +355,7 @@ export default function CourseMap() {
<Fragment key={Object.values(marker).join('')}>
<LocationMarker
{...marker}
label={today === 'All' ? undefined : index + 1}
label={today === 'All' ? undefined : (index + 1).toString()}
stackIndex={coursesSameBuildingPrior.length}
>
<Box>
Expand Down
4 changes: 2 additions & 2 deletions apps/antalmanac/src/components/Map/Marker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -63,7 +63,7 @@ interface Props {
location?: string;
acronym?: string;
stackIndex?: number;
label?: any;
label?: string;
children?: React.ReactNode;
}

Expand Down
2 changes: 1 addition & 1 deletion apps/antalmanac/src/components/Map/Routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export default function ClassRoutes(props: ClassRoutesProps) {
return () => {
routerRef.current.instance.remove();
};
}, []);
}, [context.map, routerRef]);

return null;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ class TermSelector extends PureComponent<TermSelectorProps> {
}

getTerm() {
return RightPaneStore.getUrlTermValue()
? this.updateTermAndGetFormData()
: RightPaneStore.getFormData().term
return RightPaneStore.getUrlTermValue() ? this.updateTermAndGetFormData() : RightPaneStore.getFormData().term;
}

state = {
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -72,7 +71,6 @@
height: 1px;
}


.course-node {
margin: auto 1rem auto 0;
}
Expand All @@ -85,7 +83,6 @@
margin-right: 0;
}


.dependency-node:first-child:last-child::after {
height: 0 !important;
}
Expand Down Expand Up @@ -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 {
Expand All @@ -209,4 +206,4 @@
/* Styling that targets the Popover component (not sure why it can't be done inline)*/
.MuiPopover-paper {
overflow-x: auto;
}
}
Loading