Skip to content

Commit 669e972

Browse files
committed
refactor: #35 상영관 탭 클릭 시 페이지 이동하는 optional prop 추가
1 parent be309bf commit 669e972

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/components/common/Theater/TheaterList.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ interface Props {
66
data: Theater[];
77
selected: string[];
88
onSelect: (auditoriumId: string) => void;
9+
onAuditoriumClick?: (auditoriumId: string) => void; // 클릭 prop 추가
910
}
1011

11-
const TheaterList = ({ data, selected, onSelect }: Props) => {
12+
const TheaterList = ({ data, selected, onSelect, onAuditoriumClick }: Props) => {
1213
const [expandedTheater, setExpandedTheater] = useState<string | null>(null);
1314

1415
// theaterName 기준으로 그룹화
@@ -48,7 +49,13 @@ const TheaterList = ({ data, selected, onSelect }: Props) => {
4849
return (
4950
<Button
5051
key={auditorium.auditoriumId}
51-
onClick={() => onSelect(auditorium.auditoriumId)}
52+
onClick={() => {
53+
if (onAuditoriumClick) {
54+
onAuditoriumClick(auditorium.auditoriumId); // 페이지 이동
55+
} else {
56+
onSelect(auditorium.auditoriumId); // 선택만
57+
}
58+
}}
5259
selected={isSelected}
5360
variant="secondary-assistive"
5461
size="md"

0 commit comments

Comments
 (0)