Skip to content

Commit a381831

Browse files
authored
fix: 변경된 토글버튼 훅 반영 (#467)
1 parent 1f6bbce commit a381831

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/components/SelectPosition/SelectPosition.tsx

+5-4
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,26 @@ import { useToggleButtons } from '@components/shared/ToggleButton';
33

44
import { Position } from '@type/models/Position';
55

6+
import { POSITIONS_BUTTON } from '@constants/positions';
7+
68
export const SelectPosition = ({
79
setPositions,
810
}: {
911
setPositions: (value: Position[]) => void;
1012
}) => {
11-
const positions = ['C', 'PF', 'SF', 'PG', 'SG', '없음'];
12-
1313
const handledToggle = (value: string[]) => {
1414
setPositions(value as Position[]);
1515
};
1616

1717
const { handleToggle, selectedItems } = useToggleButtons({
1818
onToggle: handledToggle,
1919
isMultipleSelect: true,
20+
noValue: POSITIONS_BUTTON['없음'],
2021
});
2122

2223
return (
2324
<>
24-
{positions.map((position) => (
25+
{Object.values(POSITIONS_BUTTON).map((position) => (
2526
<ToggleButton
2627
type="button"
2728
fontSize="12px"
@@ -30,7 +31,7 @@ export const SelectPosition = ({
3031
key={position}
3132
value={position}
3233
isActive={selectedItems.includes(position)}
33-
onToggle={handleToggle}
34+
onToggle={() => handleToggle(position)}
3435
/>
3536
))}
3637
</>

0 commit comments

Comments
 (0)