Skip to content

Commit eed8389

Browse files
committed
feat: 선택된 내역 없을 때 비활성화 구현
1 parent 4525501 commit eed8389

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/pages/ticketholderlist/components/FilterBottomSheet/FilterBottomSheet.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ const FilterBottomSheet = ({
3232
filterList.scheduleNumber
3333
);
3434

35+
const initList = filterList;
36+
3537
const handleWrapperClick = () => {
3638
onClickOutside();
3739
};
@@ -77,6 +79,12 @@ const FilterBottomSheet = ({
7779
setCheckedStatusList([]);
7880
};
7981

82+
const isAllEmpty =
83+
initList.scheduleNumber.length === 0 &&
84+
initList.bookingStatus.length === 0 &&
85+
checkedStatusList.length === 0 &&
86+
checkedScheduleList.length === 0;
87+
8088
return (
8189
<S.FilterBottomSheetWrapper $isOpen={isOpen} onClick={handleWrapperClick}>
8290
<BottomSheet isOpen={isOpen}>
@@ -118,8 +126,11 @@ const FilterBottomSheet = ({
118126
))}
119127
</S.CheckBoxContainer>
120128
<Spacing marginBottom="3.2" />
121-
{/* TODO : 선택된 내역 없을 때 버튼 비활성화 하기 */}
122-
<Button onClick={handleCilckBtn}>적용하기</Button>
129+
{isAllEmpty ? (
130+
<Button variant="gray">적용하기</Button>
131+
) : (
132+
<Button onClick={handleCilckBtn}>적용하기</Button>
133+
)}
123134
</BottomSheet>
124135
</S.FilterBottomSheetWrapper>
125136
);

0 commit comments

Comments
 (0)