Skip to content

Commit

Permalink
fix CI build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
NishchintDhawan committed Jun 5, 2022
1 parent 87ad861 commit ddada51
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
5 changes: 3 additions & 2 deletions src/lib/hooks/useSavedCourses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,14 @@ export const useSavedCourses = (): SavedCourses => {
const updateCourseColor = useCallback(
(pid: string, term: string, color: string) => {
data.map((item) => {
if (item.term == term && item.pid == pid) {
if (item.term === term && item.pid === pid) {
item.color = color;
}
return data;
});
setData(data);
},
[data]
[data, setData]
);
/**
* Checks the equality of two courses
Expand Down
10 changes: 3 additions & 7 deletions src/pages/scheduler/components/CourseCard.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useCallback } from 'react';

import { ChevronDownIcon, ChevronUpIcon, CloseIcon, CopyIcon, EditIcon } from '@chakra-ui/icons';
import { ChevronDownIcon, ChevronUpIcon, CloseIcon, EditIcon } from '@chakra-ui/icons';
import {
Box,
Text,
Expand Down Expand Up @@ -96,7 +96,7 @@ export function CourseCard({
(color: string) => {
handleColorChange({ term, code, subject, pid, color });
},
[code, handleDelete, pid, subject, term, color]
[code, handleColorChange, pid, subject, term]
);

const onShowSections = useCallback(() => {
Expand Down Expand Up @@ -150,11 +150,7 @@ export function CourseCard({
<MenuList>
{colorList.map((colorOption) => {
return (
<MenuItem
icon={<CopyIcon />}
key={colorOption.color}
onClick={() => onColorChange(colorOption.color)}
>
<MenuItem key={colorOption.color} onClick={() => onColorChange(colorOption.color)}>
{colorOption.name}
</MenuItem>
);
Expand Down

0 comments on commit ddada51

Please sign in to comment.