diff --git a/index.html b/index.html index a39119f2..4236bce1 100644 --- a/index.html +++ b/index.html @@ -1,16 +1,30 @@ + + + + + 위플플 | 여정 공유 플랫폼 + - - - - - 위플플 | 여정 공유 플랫폼 - + +
+ + - -
- - + + + + diff --git a/src/@types/detail.types.ts b/src/@types/detail.types.ts index bfb4bca8..71827919 100644 --- a/src/@types/detail.types.ts +++ b/src/@types/detail.types.ts @@ -1,5 +1,6 @@ interface tourDetail { id: number; + contentTypeId: number; title: string; liked: boolean; fullAddress: string; diff --git a/src/@types/review.types.ts b/src/@types/review.types.ts index 851b017b..fe5fcb10 100644 --- a/src/@types/review.types.ts +++ b/src/@types/review.types.ts @@ -1,11 +1,27 @@ -interface ReviewRequest { - tourItemId: number; - rating: number; - keywords: Keyword[]; +export interface Keyword { + keywordId: number; content: string; + type: string; } -interface Keyword { - keywordId: number; +export interface CommentItemProps { + commentId: number; + authorNickname: string; + authorProfileImageUrl: string; + createdTime: string; content: string; + onClick?: () => void; + isAuthor: boolean; +} + +export interface MyReviewContent { + reviewId: number; + authorNickname: string; + authorProfileImageUrl: string; + rating: number; + createdTime: string; + content: string; + keywords: Keyword[]; + commentCount: number; + isAuthor?: boolean; } diff --git a/src/@types/tours.types.ts b/src/@types/tours.types.ts index ccd95671..11e862e7 100644 --- a/src/@types/tours.types.ts +++ b/src/@types/tours.types.ts @@ -52,3 +52,25 @@ export interface LikedListType { preferTotalCount: number; notPreferTotalCount: number; } + +export interface ReviewInfoItemProps { + reviewId: number; + authorNickname: string; + authorProfileImageUrl: string; + rating: number; + createdTime: string; + content: string; + keywords: Keyword[]; // keywordId, content, type + commentCount: number; + onClick?: () => void; + tourItemId?: number; + contentTypeId?: number; + canTextOverflow: boolean; + isAuthor?: boolean; +} + +interface Keyword { + keywordId: number; + content: string; + type: string; +} diff --git a/src/@types/trips.types.ts b/src/@types/trips.types.ts index e2ebbb0c..36f92cd8 100644 --- a/src/@types/trips.types.ts +++ b/src/@types/trips.types.ts @@ -51,3 +51,13 @@ interface AuthorityType { tripId: string; }; } +interface TripSurveySetMemberInfo { + memberId: number; + nickname: string; + thumbnail: string; +} + +interface TripMemeberInfo { + nickname: string; + profileImageUrl: string; +} diff --git a/src/api/review.ts b/src/api/review.ts index 9c5e46df..ec7f4f43 100644 --- a/src/api/review.ts +++ b/src/api/review.ts @@ -1,6 +1,6 @@ import client from './client'; import authClient from './authClient'; - +import { ReviewRequest } from '@recoil/review'; // 리뷰 관련 API // 리뷰수정 diff --git a/src/components/DetailSectionBottom/DetailReviews.tsx b/src/components/DetailSectionBottom/DetailReviews.tsx index 8d526846..93e1e310 100644 --- a/src/components/DetailSectionBottom/DetailReviews.tsx +++ b/src/components/DetailSectionBottom/DetailReviews.tsx @@ -26,12 +26,13 @@ import ToastPopUp from '@components/common/toastpopup/ToastPopUp'; import EditDelete from '@components/common/modal/children/EditDelete'; import MyAlert from '@components/common/modal/children/MyAlert'; import { alertTypeState } from '@recoil/modal'; +import { ReviewInfoItemProps } from '@/@types/tours.types'; -interface reviewProps { - reviewData: any; -} - -export default function DetailReviews({ reviewData }: reviewProps) { +export default function DetailReviews({ + reviewData, +}: { + reviewData: tourDetail; +}) { const [reviewDataLength, setReviewDataLength] = useState(0); const { title, contentTypeId } = reviewData; const params = useParams(); @@ -73,7 +74,7 @@ export default function DetailReviews({ reviewData }: reviewProps) { return
데이터를 불러오는 중 오류가 발생했습니다.
; } - const handleReviewClick = (item: any) => { + const handleReviewClick = (item: ReviewInfoItemProps) => { const reviewId = item.reviewId; navigate(`/reviewComment/${reviewId}`, { state: { item, tourItemId } }); }; @@ -155,24 +156,26 @@ export default function DetailReviews({ reviewData }: reviewProps) { { return ( - {group?.data.data.reviewInfos.content.map((item: any) => ( - handleReviewClick(item)} - tourItemId={tourItemId} - contentTypeId={contentTypeId} - canTextOverflow={true} - isAuthor={item.isAuthor} - /> - ))} + {group?.data.data.reviewInfos.content.map( + (item: ReviewInfoItemProps) => ( + handleReviewClick(item)} + tourItemId={tourItemId} + contentTypeId={contentTypeId} + canTextOverflow={true} + isAuthor={item.isAuthor} + /> + ), + )} ); } @@ -187,7 +190,7 @@ export default function DetailReviews({ reviewData }: reviewProps) { {modalChildren === 'MyAlert' && alertType === 'LoginReview' && ( )} diff --git a/src/components/DetailSectionBottom/ReviewItem.tsx b/src/components/DetailSectionBottom/ReviewItem.tsx index 57a89c8c..1a2817d9 100644 --- a/src/components/DetailSectionBottom/ReviewItem.tsx +++ b/src/components/DetailSectionBottom/ReviewItem.tsx @@ -21,30 +21,9 @@ import { import { MouseEvent, useState } from 'react'; import { getEmoji } from '@utils/utils'; import { getStarFill } from '@utils/getStarFill'; +import { ReviewInfoItemProps } from '@/@types/tours.types'; -interface Keyword { - keywordId: number; - content: string; - type: string; -} - -interface ItemProps { - reviewId: number; - authorNickname: string; - authorProfileImageUrl: string; - rating: number; - createdTime: any; - content: string; - keywords: Keyword[]; // keywordId, content, type - commentCount: number; - onClick?: () => void; - tourItemId?: number; - contentTypeId?: number; - canTextOverflow: boolean; - isAuthor?: boolean; -} - -const Item: React.FC = (props: ItemProps) => { +const Item: React.FC = (props: ReviewInfoItemProps) => { const { reviewId, authorNickname, diff --git a/src/components/DetailSectionTop/DetailToursButtons.tsx b/src/components/DetailSectionTop/DetailToursButtons.tsx index 8c9e01a6..49de97fb 100644 --- a/src/components/DetailSectionTop/DetailToursButtons.tsx +++ b/src/components/DetailSectionTop/DetailToursButtons.tsx @@ -10,11 +10,11 @@ import { useNavigate, useParams } from 'react-router-dom'; import { useSetRecoilState } from 'recoil'; import { getMember } from '@api/member'; -interface reviewProps { - reviewData: any; -} - -export default function DetailTourButtons({ reviewData }: reviewProps) { +export default function DetailTourButtons({ + reviewData, +}: { + reviewData: tourDetail; +}) { const { title, contentTypeId } = reviewData; const params = useParams(); const tourItemId = Number(params.id); diff --git a/src/components/Mypage/LogoutButton.tsx b/src/components/Mypage/LogoutButton.tsx index 0e6666d7..c66aa282 100644 --- a/src/components/Mypage/LogoutButton.tsx +++ b/src/components/Mypage/LogoutButton.tsx @@ -34,7 +34,7 @@ const LogoutButton = () => { return (