Skip to content

Commit

Permalink
code review: type 수정
Browse files Browse the repository at this point in the history
seueooo committed Sep 5, 2024
1 parent 1c22409 commit 9c5649c
Showing 4 changed files with 13 additions and 8 deletions.
10 changes: 8 additions & 2 deletions src/shared/components/ButtonCategoryDropdown.tsx
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ import UpIcon from '@/shared/assets/svgs/upIcon.svg?react';

interface CategoryBtnProps extends ButtonHTMLAttributes<HTMLButtonElement> {
isClicked: boolean;
handleClicked: () => void;
handleClicked: (prev: boolean) => void;
selectedOption: string;
}

@@ -21,7 +21,13 @@ const CategoryDropdownBtn = ({ isClicked, handleClicked, selectedOption, disable
: `${clickedDropdownStyle} ${commonBtnStyle}`;

return (
<button type="button" onClick={handleClicked} className={categoryDropdownBtnStyle} disabled={disabled} {...props}>
<button
type="button"
onClick={() => handleClicked(isClicked)}
className={categoryDropdownBtnStyle}
disabled={disabled}
{...props}
>
<p>{selectedOption}</p>
{disabled ? (
<DisabledDropIcon />
2 changes: 1 addition & 1 deletion src/shared/components/CategoryModalLeft.tsx
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ interface UrlInfo {
interface ModalProps {
handleRightModalUrlInfos: (url: UrlInfo) => void;

handleClickButton: (is: any) => void;
handleClickButton: (is: boolean) => boolean;
handleSelectOption: (name: string) => void;
isClicked: boolean;
selectedOption: string;
2 changes: 1 addition & 1 deletion src/shared/components/CategoryModalRight.tsx
Original file line number Diff line number Diff line change
@@ -44,7 +44,7 @@ const CategoryModalRight = ({
</>
)}
</h1>
<p className="text-white">의 모립세트</p>
<h1 className="text-white">의 모립세트</h1>
</header>

<section className="flex w-full">
7 changes: 3 additions & 4 deletions src/shared/components/DropdownCategory.tsx
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ import ButtonDropdownOptions from '@/shared/components/ButtonDropdownOptions';
interface DropdownBtnProps extends ButtonHTMLAttributes<HTMLButtonElement> {
optionData: Category[];
handleOptionId: (id: number) => void;
handleClickButton: (is: any) => void;
handleClickButton: (is: boolean) => boolean;
handleSelectOption: (name: string) => void;
isClicked: boolean;
selectedOption: string;
@@ -37,11 +37,10 @@ const DropdownCategory = ({
handleClickButton(false);
};

const handleBtnClicked = () => {
const handleBtnClicked = (prev: boolean) => {
queryClient.invalidateQueries({ queryKey: ['categories'] });

//Todo: 추후 타입 수정
handleClickButton((prev: boolean) => !prev);
handleClickButton(!prev);
};

return (

0 comments on commit 9c5649c

Please sign in to comment.