diff --git a/public/images/han-river-park-court.png b/public/images/han-river-park-court.png new file mode 100644 index 00000000..73fe8386 Binary files /dev/null and b/public/images/han-river-park-court.png differ diff --git a/src/app/(auth)/user-info/page.tsx b/src/app/(auth)/user-info/page.tsx index 07cb21e6..0a3ad64e 100644 --- a/src/app/(auth)/user-info/page.tsx +++ b/src/app/(auth)/user-info/page.tsx @@ -31,7 +31,7 @@ const SignUpProcess = () => { } else { try { // await axiosInstance.patch('/api/user/update/info', userInfo); - router.push('/login'); + router.push('/'); } catch (error) { console.error('정보 전송 실패:', error); } diff --git a/src/app/map/components/CourtDetail.tsx b/src/app/map/components/CourtDetail.tsx index 83987d0e..620373e9 100644 --- a/src/app/map/components/CourtDetail.tsx +++ b/src/app/map/components/CourtDetail.tsx @@ -1,11 +1,17 @@ 'use client'; -import React, { useEffect, useState } from 'react'; -import { Textarea, Input, RadioGroup, Radio, Button } from '@nextui-org/react'; +import React from 'react'; +import { Button } from '@nextui-org/react'; import { IoIosClose } from 'react-icons/io'; -import { FaPhone } from 'react-icons/fa'; -import { PiChatsCircle } from 'react-icons/pi'; +import { FaPhoneAlt, FaParking, FaTag, FaRegDotCircle } from 'react-icons/fa'; import Image from 'next/image'; +import { FaLocationDot, FaClock, FaLightbulb } from 'react-icons/fa6'; +import { PiChatsCircle } from 'react-icons/pi'; +import { CourtIcon } from './icons/CourtIcon'; +import { HoopIcon } from './icons/HoopIcon'; +import { FeeIcon } from './icons/FeeIcon'; +import { InfoIcon } from './icons/InfoIcon'; +import { WebsiteIcon } from './icons/WebsiteIcon'; interface CourtDetailsProps { isVisible: boolean; @@ -13,180 +19,197 @@ interface CourtDetailsProps { selectedPlace: any; } +// 농구장 사진, 주소(도로명), 코트 종류, 실내외(실내/야외), 코트사이즈, 골대수, 야간 조명, 개방시간, 사용료, 주차 가능, 전화번호, 홈페이지, 기타 정보 +// [TODO] 주소 복사 넣기, ✅ +// 각 컨텐츠 아이콘 넣기 ✅ +// true, false 명확히하기 ✅ +// 현재 링크 공유 만들기 + const CourtDetails: React.FC = ({ isVisible, onClose, selectedPlace, }) => { - const [otherInfo, setOtherInfo] = useState( - '주차하기 어려워요. 대중교통 이용 추천해요.' - ); - const [isInfoModified, setIsInfoModified] = useState(false); - - // api 개발 완료 후 주석 처리 부분 연결 예정 - useEffect(() => { - // otherInfo 상태가 변경될 때마다 isInfoModified 상태를 설정 - if (otherInfo !== selectedPlace.otherInfo) { - setIsInfoModified(true); - } else { - setIsInfoModified(false); - } - }, [otherInfo, selectedPlace]); - - const handleSaveClick = async () => { - // try { - // const response = await axios.post('/api/map/marker/{court_id}/info/save', { - // placeId: selectedPlace.id, - // otherInfo, - // }); - // console.log('데이터 저장 성공:', response.data); - // setIsInfoModified(false); // 저장 후 isInfoModified를 false로 설정하여 저장 버튼 숨김 - // } catch (error) { - // console.error('데이터 저장 실패:', error); - // } - }; - - const handleOtherInfoChange = (e: React.ChangeEvent) => { - setOtherInfo(e.target.value); - }; - const handlePhoneClick = () => { - if (selectedPlace.phone) { + if (selectedPlace.phoneNum) { const confirmDial = window.confirm( - `이 전화번호로 연결하시겠습니까? ${selectedPlace.phone}` + `이 전화번호로 연결하시겠습니까? ${selectedPlace.phoneNum}` ); if (confirmDial) { - window.location.href = `tel:${selectedPlace.phone}`; + window.location.href = `tel:${selectedPlace.phoneNum}`; + } + } + }; + + const handleCopyAddress = async () => { + if (selectedPlace.address) { + try { + await navigator.clipboard.writeText(selectedPlace.address); + alert('주소가 복사되었습니다.'); + } catch (error) { + console.error('주소 복사 중 오류 발생:', error); + alert('주소를 복사하는 데 실패했습니다.'); } } }; return (
-
-
+
+
농구장 사진 - {isInfoModified && ( - - )}
-
-
-
-

- {selectedPlace.place_name} -

-

{selectedPlace.address_name}

+
+
+

+ {selectedPlace.courtName} +

+ +
+
+ + +
+
+
+
+ + {selectedPlace.address} +
-
- {selectedPlace.phone && ( - - )} - +
+ + + 개방 시간:{' '} + + {selectedPlace.openingHours === true ? '24시간' : '제한'} + + +
+
+ + + {selectedPlace.phoneNum ? selectedPlace.phoneNum : '-'} + +
+
+ + + 이용료: {selectedPlace.fee === true ? '유료' : '무료'} +
-
-
-
- + + + {selectedPlace.website !== null ? selectedPlace.website : '-'} + +
+
+ + + 코트 종류: {selectedPlace.courtType} + +
+
+ + + 코트 사이즈: {selectedPlace.courtSize} + +
+
+ + + 골대 수: {selectedPlace.hoopCount} + +
+
+ - + 야간 조명:{' '} + {selectedPlace.nightLighting === true ? '있음' : '없음'} + +
+
+ + + 주차: {selectedPlace.parkingAvailabl === true ? '가능' : '불가'} +
- - - 있음 - 없음 - - - 제한 - 24시 - - - 무료 - 유료 - - - 가능 - 불가능 - -
-