diff --git a/src/components/DetailSectionBottom/DetailReviews.tsx b/src/components/DetailSectionBottom/DetailReviews.tsx index 6405c618..87893173 100644 --- a/src/components/DetailSectionBottom/DetailReviews.tsx +++ b/src/components/DetailSectionBottom/DetailReviews.tsx @@ -1,7 +1,7 @@ import { getToursReviews } from '@api/tours'; import { useEffect, useState } from 'react'; -import InfiniteScroll from 'react-infinite-scroller'; -import { useInfiniteQuery, useQuery } from '@tanstack/react-query'; +// import InfiniteScroll from 'react-infinite-scroller'; +import { useQuery } from '@tanstack/react-query'; import ReviewItem from './ReviewItem'; import { StarIcon } from '@components/common/icons/Icons'; import { useNavigate, useParams } from 'react-router-dom'; @@ -80,24 +80,22 @@ export default function DetailReviews({ reviewData }: reviewProps) { {reviewDataLength > 0 && (
- {toursReviews?.data?.data?.reviewInfos?.content?.map( - (item: any, index: number) => ( - handleReviewClick(item)} - tourItemId={tourItemId} - contentTypeId={contentTypeId} - /> - ), - )} + {toursReviews?.data?.data?.reviewInfos?.content?.map((item: any) => ( + handleReviewClick(item)} + tourItemId={tourItemId} + contentTypeId={contentTypeId} + /> + ))}
)} {reviewDataLength == 0 && ( diff --git a/src/components/DetailSectionBottom/DetailSectionBottom.tsx b/src/components/DetailSectionBottom/DetailSectionBottom.tsx index 25a2d599..354bf93f 100644 --- a/src/components/DetailSectionBottom/DetailSectionBottom.tsx +++ b/src/components/DetailSectionBottom/DetailSectionBottom.tsx @@ -2,12 +2,11 @@ import { DetailReviews, DetailReviewStats } from '.'; import { useParams } from 'react-router-dom'; import { useQuery } from '@tanstack/react-query'; import { getDetailTours } from '@api/tours'; -import { useEffect } from 'react'; export default function DetailSectionBottom() { const params = useParams(); const tourItemId = Number(params.id); - const { isError, isLoading, isFetching, data } = useQuery({ + const { isError, data } = useQuery({ queryKey: ['details', tourItemId], queryFn: () => getDetailTours(tourItemId), }); diff --git a/src/components/DetailSectionBottom/ReviewItem.tsx b/src/components/DetailSectionBottom/ReviewItem.tsx index 814f3946..157f284d 100644 --- a/src/components/DetailSectionBottom/ReviewItem.tsx +++ b/src/components/DetailSectionBottom/ReviewItem.tsx @@ -1,4 +1,3 @@ -import { useEffect } from 'react'; import { StarIcon, ChatIcon, MoreIcon } from '@components/common/icons/Icons'; import { useSetRecoilState, useRecoilState } from 'recoil'; import { isModalOpenState, titleState } from '@recoil/modal'; @@ -45,7 +44,7 @@ const Item: React.FC = (props: ItemProps) => { tourItemId, contentTypeId, } = props; - const [isModalOpen, setIsModalOpen] = useRecoilState(isModalOpenState); + const [_, setIsModalOpen] = useRecoilState(isModalOpenState); const setRating = useSetRecoilState(ratingState); const setKeywords = useSetRecoilState(keywordsState); diff --git a/src/components/Review/CommentItem.tsx b/src/components/Review/CommentItem.tsx index 5bc3fb8b..43f43686 100644 --- a/src/components/Review/CommentItem.tsx +++ b/src/components/Review/CommentItem.tsx @@ -1,5 +1,5 @@ import { MoreIcon } from '@components/common/icons/Icons'; -import { useSetRecoilState, useRecoilState, useRecoilValue } from 'recoil'; +import { useSetRecoilState, useRecoilState } from 'recoil'; import { isModalOpenState, titleState } from '@recoil/modal'; import { commentState, @@ -22,12 +22,12 @@ const CommentItem: React.FC = (props: ItemProps) => { const { commentId, authorNickname, - authorProfileImageUrl, + // authorProfileImageUrl, createdTime, content, - onClick, + // onClick, } = props; - const [isModalOpen, setIsModalOpen] = useRecoilState(isModalOpenState); + const [_, setIsModalOpen] = useRecoilState(isModalOpenState); const setTitle = useSetRecoilState(titleState); const [targetCommentId, setTargetCommentId] = useRecoilState(targetCommentIdState); diff --git a/src/components/Review/Review.tsx b/src/components/Review/Review.tsx index 6acf244b..e8f4c3f7 100644 --- a/src/components/Review/Review.tsx +++ b/src/components/Review/Review.tsx @@ -18,12 +18,12 @@ export default function Review() { const params = useParams(); const navigate = useNavigate(); const tourItemId = Number(params.id); - const [rating, setRating] = useRecoilState(ratingState); - const [keywords, setKeywords] = useRecoilState(keywordsState); - const [content, setContent] = useRecoilState(contentState); + const [rating] = useRecoilState(ratingState); + const [keywords] = useRecoilState(keywordsState); + const [content] = useRecoilState(contentState); const isModifyingReview = useRecoilValue(isModifyingReviewState); const targetReviewId = useRecoilValue(targetReviewIdState); - const [isModalOpen, setIsModalOpen] = useRecoilState(isModalOpenState); + const [_, setIsModalOpen] = useRecoilState(isModalOpenState); const handlePostReview = async () => { try { diff --git a/src/components/Review/ReviewButton.tsx b/src/components/Review/ReviewButton.tsx index ff38a4aa..3b9cde51 100644 --- a/src/components/Review/ReviewButton.tsx +++ b/src/components/Review/ReviewButton.tsx @@ -1,5 +1,5 @@ import { ButtonPrimary } from '@components/common/button/Button'; -import { useState, useEffect, ChangeEvent } from 'react'; +import { useState, useEffect } from 'react'; import { contentState, keywordsState } from '@recoil/review'; import { useRecoilState, useRecoilValue } from 'recoil'; @@ -9,7 +9,7 @@ interface ButtonProps { const ReviewButton = (props: ButtonProps) => { const { onClick } = props; - const [content, setContent] = useRecoilState(contentState); + const [content] = useRecoilState(contentState); const keywords = useRecoilValue(keywordsState); const [isContentValid, setIsContentValid] = useState(false); const [isKeywordsValid, setIsKeywordsValid] = useState(false); diff --git a/src/components/Review/ReviewComments.tsx b/src/components/Review/ReviewComments.tsx index 4d845de6..de67591e 100644 --- a/src/components/Review/ReviewComments.tsx +++ b/src/components/Review/ReviewComments.tsx @@ -2,18 +2,17 @@ import { getReviewComments } from '@api/review'; import { useQuery } from '@tanstack/react-query'; import { useParams } from 'react-router-dom'; import CommentItem from './CommentItem'; -import { useSetRecoilState, useRecoilState } from 'recoil'; -import { isModalOpenState, titleState } from '@recoil/modal'; +import { useRecoilState } from 'recoil'; +import { isModalOpenState } from '@recoil/modal'; import { Modal } from '@components/common/modal'; -import { useEffect } from 'react'; -import { targetCommentIdState } from '@recoil/review'; +// import { targetCommentIdState } from '@recoil/review'; export default function ReviewComments() { const params = useParams(); const reviewId = Number(params.id); const [isModalOpen, setIsModalOpen] = useRecoilState(isModalOpenState); - const setTitle = useSetRecoilState(titleState); - const setTargetCommentId = useSetRecoilState(targetCommentIdState); + // const setTitle = useSetRecoilState(titleState); + // const setTargetCommentId = useSetRecoilState(targetCommentIdState); const { data: reviewComments } = useQuery({ queryKey: ['reviewComments'], diff --git a/src/components/common/back/Back.tsx b/src/components/common/back/Back.tsx index 65b1a6e0..aea4e544 100644 --- a/src/components/common/back/Back.tsx +++ b/src/components/common/back/Back.tsx @@ -1,4 +1,4 @@ -import { useNavigate, useNavigation } from 'react-router-dom'; +import { useNavigate } from 'react-router-dom'; import { LeftIcon } from '../icons/Icons'; const Back = () => { diff --git a/src/components/common/modal/Modal.tsx b/src/components/common/modal/Modal.tsx index ef6b825d..82def6d5 100644 --- a/src/components/common/modal/Modal.tsx +++ b/src/components/common/modal/Modal.tsx @@ -1,25 +1,25 @@ -import React, { useEffect } from 'react'; +import React from 'react'; import Modal from 'react-modal'; import { DeleteIcon, PenIcon } from '@components/common/icons/Icons'; import { useRecoilValue, useSetRecoilState } from 'recoil'; import { titleState, isModalOpenState } from '@recoil/modal'; -import { deleteReview, putReview } from '@api/review'; -import { deleteComments, putComments } from '@api/comments'; +import { deleteReview } from '@api/review'; +import { deleteComments } from '@api/comments'; import { ratingState, keywordsState, contentState, - commentState, + // commentState, targetReviewIdState, - reviewDataState, + // reviewDataState, targetCommentIdState, - commentContentState, + // commentContentState, isModifyingCommentState, isModifyingReviewState, tourItemIdState, contentTypeIdState, } from '@recoil/review'; -import { Navigate, useNavigate } from 'react-router-dom'; +import { useNavigate } from 'react-router-dom'; interface ModalProps { isOpen: boolean; @@ -30,12 +30,12 @@ const ModalComponent: React.FC = ({ isOpen, closeModal }) => { const rating = useRecoilValue(ratingState); const keywords = useRecoilValue(keywordsState); const content = useRecoilValue(contentState); - const comment = useRecoilValue(commentState); + // const comment = useRecoilValue(commentState); const title = useRecoilValue(titleState); const targetReviewId = useRecoilValue(targetReviewIdState); - const reviewData = useRecoilValue(reviewDataState); + // const reviewData = useRecoilValue(reviewDataState); const targetCommentId = useRecoilValue(targetCommentIdState); - const commentContent = useRecoilValue(commentContentState); + // const commentContent = useRecoilValue(commentContentState); const tourItemId = useRecoilValue(tourItemIdState); const contentTypeId = useRecoilValue(contentTypeIdState); const setIsModifyingReview = useSetRecoilState(isModifyingReviewState); diff --git a/src/pages/signup/signup.page.tsx b/src/pages/signup/signup.page.tsx index 883628dd..67322569 100644 --- a/src/pages/signup/signup.page.tsx +++ b/src/pages/signup/signup.page.tsx @@ -2,7 +2,7 @@ import { UserEmailInputBox, UserPwInputBox } from '@components/user'; import { useState } from 'react'; const Signup = () => { - const [isActive, setIsActive] = useState(false); + const [isActive] = useState(false); return (
@@ -27,4 +27,4 @@ const Signup = () => { ); }; -export default Signup; \ No newline at end of file +export default Signup;