Skip to content

Commit

Permalink
fix :: 빌드 오류
Browse files Browse the repository at this point in the history
  • Loading branch information
hyuna committed Aug 31, 2024
1 parent 255ba24 commit ee9a6d9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/app/components/common/dropdown/state/class/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ interface StateDropProps {
const ClassmealDrop = ({ option, id, onclick }: StateDropProps) => {
const dropdownRef = useRef<HTMLDivElement>(null);
const [isDropdownVisible, setIsDropdownVisible] = useState<boolean>(false);
const [grade, setGrade] = useState<number>(0);

const toggleDropdown = () => {
setIsDropdownVisible(!isDropdownVisible);
};

const handleOptionClick = (selectedOption: "신청" | "미신청") => {
setIsDropdownVisible(false);
onclick(selectedOption); // 수정된 부분
onclick(selectedOption);
};

const dropStyle = () => {
Expand Down Expand Up @@ -47,7 +48,9 @@ const ClassmealDrop = ({ option, id, onclick }: StateDropProps) => {
};
}, []);

const grade = parseInt(localStorage.getItem("grade") || "1", 10);
useEffect(() => {
setGrade(parseInt(localStorage.getItem("grade") || "1", 10));
}, []);

return (
<div className="relative w-24 " ref={dropdownRef}>
Expand Down

0 comments on commit ee9a6d9

Please sign in to comment.