Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QA용 임시 로그인 기능 구현 #59

Closed
wants to merge 33 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
53ae880
Conf: HTML 언어 ko로 변경
jseo9732 Jan 2, 2024
049910a
Design: 회원가입 1차 마크업
jseo9732 Jan 3, 2024
85c4064
Design: 임시 InputBox 컴포넌트
jseo9732 Jan 3, 2024
894cb7d
Merge branch 'FE-13--feat/User' into FE-20--feat/User/signup
jseo9732 Jan 3, 2024
889dfa9
Merge pull request #24 from FinalDoubleTen/FE-20--feat/User/signup
jseo9732 Jan 3, 2024
9da1d6d
Design: 누락된 리스트 추가
jseo9732 Jan 3, 2024
6d689c7
Merge pull request #26 from FinalDoubleTen/FE-20--feat/User/signup
jseo9732 Jan 3, 2024
b9a529c
Design: 아이콘 컴포넌트 추가
jseo9732 Jan 3, 2024
cbaedfe
Design: 버튼 컴포넌트 수정
jseo9732 Jan 3, 2024
577dac5
Fix: 버튼 컴포넌트 수정에 따른 코드 수정
jseo9732 Jan 3, 2024
6fbbdb3
Design: 로그인 페이지 1차 마크업
jseo9732 Jan 3, 2024
a96bb13
Design: 여행지 css 수정
suehub Jan 3, 2024
3cb05ee
Merge pull request #45 from FinalDoubleTen/FE-21--feat/User/signin
jseo9732 Jan 3, 2024
dcbd6cc
Design: 회원가입 페이지 뒤로가기 버튼, 프로그래스바 마크업 추가
jseo9732 Jan 3, 2024
2f608cd
Feat: 여행지 무한스크롤 구현
suehub Jan 3, 2024
997a430
Feat: 라우팅 시 스크롤 상단 이동
suehub Jan 3, 2024
1ea06bf
Merge branch 'dev' of https://github.com/FinalDoubleTen/TenTenFE into…
suehub Jan 3, 2024
79d3a6b
Merge pull request #48 from FinalDoubleTen/FE-31--feat/Tours/Infinity…
suehub Jan 3, 2024
b6ed154
Design: 회원가입 유저 정보 페이지 1차 마크업
jseo9732 Jan 4, 2024
0ceb32d
Design: 여정생성 버튼추가
suehub Jan 4, 2024
ceafddf
Merge branch dev of https://github.com/FinalDoubleTen/TenTenFE into F…
suehub Jan 4, 2024
afe58bc
Revert "Merge branch dev of https://github.com/FinalDoubleTen/TenTenF…
suehub Jan 4, 2024
4d9794a
Design: 메인페이지 css 수정
suehub Jan 4, 2024
f4b214a
Design: 메인페이지 css 수정
suehub Jan 4, 2024
deb39c6
Merge pull request #53 from FinalDoubleTen/FE-30-feat/Tours/CreateTri…
suehub Jan 4, 2024
6cc9791
Merge branch dev of https://github.com/FinalDoubleTen/TenTenFE into F…
suehub Jan 4, 2024
db0ad75
Merge branch 'FE-6--feat/Tours' of https://github.com/FinalDoubleTen/…
suehub Jan 4, 2024
acfaf0f
Docs: 리드미 수정
suehub Jan 4, 2024
bbbe049
Merge pull request #54 from FinalDoubleTen/FE-6--feat/Tours
suehub Jan 4, 2024
ce260e1
Feat: 로그인 임시 구현
jseo9732 Jan 4, 2024
8a6c7ba
Merge pull request #57 from FinalDoubleTen/FE-21--feat/User/signin
jseo9732 Jan 4, 2024
a106997
Merge pull request #58 from FinalDoubleTen/FE-20--feat/User/signup
jseo9732 Jan 4, 2024
691f398
Merge branch 'dev' into FE-13--feat/User
jseo9732 Jan 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@
- Chore : 빌드 관련 코드 수정
- Rename : 파일 및 폴더명 수정.
- Remove : 파일 삭제.
...
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!doctype html>
<html lang="en">
<html lang="ko">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.jpeg" />
Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"react-dom": "^18.2.0",
"react-infinite-scroller": "^1.2.6",
"react-kakao-maps-sdk": "^1.1.24",
"react-modal": "^3.16.1",
"react-router-dom": "^6.21.1",
"recoil": "^0.7.7",
"styled-components": "^6.1.3",
Expand All @@ -35,7 +34,6 @@
"@types/react-dom": "^18.2.17",
"@types/react-infinite-scroller": "^1.2.5",
"@types/uuid": "^9.0.7",
"@types/react-modal": "^3.16.3",
"@typescript-eslint/eslint-plugin": "^6.14.0",
"@typescript-eslint/parser": "^6.14.0",
"@vitejs/plugin-react": "^4.2.1",
Expand Down
3 changes: 3 additions & 0 deletions src/api/client.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import axios from 'axios';

const accessToken = window.localStorage.getItem('accessToken');

const client = axios.create({
baseURL: import.meta.env.VITE_SERVER_URL,
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${accessToken}`,
},
withCredentials: true,
});
Expand Down
6 changes: 3 additions & 3 deletions src/api/comments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ import client from './client';
// 댓글 관련 API

// 댓글수정
export const putComments = async (content: string, commentId: number) => {
export const putComments = async (content: string, commentId: string) => {
const res = await client.put(`comments/${commentId}`, {
content,
});
return res;
};

// 댓글삭제
export const deleteComments = async (commentId: number) => {
export const deleteComments = async (commentId: string) => {
const res = await client.delete(`comments/${commentId}`);
return res;
};

// 댓글작성
export const postComments = async (content: string, reviewId: number) => {
const res = await client.post(`comments`, {
const res = await client.post(`comments/`, {
content: content,
reviewId: reviewId,
});
Expand Down
4 changes: 2 additions & 2 deletions src/api/member.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const getMemberReviews = async () => {
};

// 나의 관심 여행지 삭제
export const deleteMemberTours = async (tourItemId: number) => {
const res = await client.delete(`member/tours/${tourItemId}`);
export const deleteMemberTours = async (tourId: number) => {
const res = await client.delete(`member/tours/${tourId}`);
return res;
};
4 changes: 2 additions & 2 deletions src/api/review.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const getReviewComments = async (reviewId: number) => {
};

// 리뷰키워드조회
export const getReviewKeywords = async (keywordType: string) => {
const res = await client.get(`reviews/keywords?keywordType=${keywordType}`);
export const getReviewKeywords = async (code: number) => {
const res = await client.get(`reviews/keywords?code=${code}`);
return res;
};
2 changes: 2 additions & 0 deletions src/api/tours.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ export const getDetailTours = async (tourItemId: number) => {
// 여행 상품 리뷰 조회
export const getToursReviews = async (tourItemId: number) => {
const res = await client.get(`tours/${tourItemId}/reviews`);
console.log('res', res);
console.log('res.data.data.reviewInfos', res.data.data.reviewInfos);
return res;
};

Expand Down
7 changes: 7 additions & 0 deletions src/assets/images/ProgressBarIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions src/assets/images/profileImg.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
85 changes: 85 additions & 0 deletions src/components/DetailSectionBottom/DetailReview.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
// import { getToursReviews } from '@api/tours';
// import { useEffect, useState } from 'react';
// import InfiniteScroll from 'react-infinite-scroller';
// import { useInfiniteQuery } from '@tanstack/react-query';
// import ReviewItem from './ReviewItem';
// import { StarIcon } from '@components/common/icons/Icons';

// export default function DetailReview() {
// const [reviewDataLength, setReviewDataLength] = useState<number>(0);
// const tourItemId = 1;

// const {
// data: toursReviews,
// fetchNextPage,
// hasNextPage,
// } = useInfiniteQuery({
// queryKey: ['toursReviews'],
// queryFn: ({ pageParam }) => getToursReviews(tourItemId),
// initialPageParam: 0,
// getNextPageParam: (lastPage, allPages, lastPageParam) => {
// const lastData = lastPage?.data?.data?.reviewInfos;
// return lastData && lastData.length === 4 ? lastPageParam + 1 : undefined;
// },
// });

// useEffect(() => {
// if (toursReviews) {
// const totalCount = toursReviews.pages.reduce(
// (accumulator, page) =>
// accumulator + (page?.data?.data?.reviewInfos?.length || 0),
// 0,
// );
// setReviewDataLength(totalCount);
// }
// }, [toursReviews]);

// return (
// <>
// <div className="mb-4 mt-2 text-lg font-bold">
// 리뷰 <span className="text-gray3">{reviewDataLength}</span>
// </div>
// {reviewDataLength > 0 && (
// <InfiniteScroll
// hasMore={hasNextPage}
// loadMore={() => fetchNextPage()}
// initialLoad={false}>
// {toursReviews?.pages?.map((page, pageIndex) => (
// <div key={pageIndex}>
// {page?.data?.data?.reviewInfos?.map(
// (item: any, index: number) => (
// <ReviewItem
// key={item.reviewId}
// authorNickname={item.authorNickname}
// authorProfileImageUrl={item.authorProfileImageUrl}
// rating={item.rating}
// createdTime={item.createdTime}
// content={item.content}
// keywords={item.keywords} // keywordId, content, type
// commentCount={2} //commentCount가 swagger에는 있는데 response에는 없음
// />
// ),
// )}
// </div>
// ))}
// </InfiniteScroll>
// )}
// {reviewDataLength == 0 && (
// <div className="flex flex-col items-center justify-center">
// <div className="mb-2 flex">
// {Array.from({ length: 5 }, (_, index) => (
// <StarIcon
// key={index}
// size={30}
// color="none"
// fill={'#EDEDED'}
// className="cursor-pointer"
// />
// ))}
// </div>
// <div className="text-sm text-gray3">첫번째 리뷰를 남겨주세요!</div>
// </div>
// )}
// </>
// );
// }
29 changes: 8 additions & 21 deletions src/components/DetailSectionBottom/DetailSectionBottom.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,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';
import { DetailReviewStats } from '.';

// 담당 컴포넌트들 호출하는 컴포넌트(분업 때문에 페이지 느낌으로 나눠봤습니다), API 호출 컴포넌트,
export default function DetailSectionBottom() {
const params = useParams();
const tourItemId = Number(params.id);
const { isError, isLoading, isFetching, data } = useQuery({
queryKey: ['details', tourItemId],
queryFn: () => getDetailTours(tourItemId),
});
if (data) {
return (
<>
<DetailReviewStats />
<DetailReviews reviewData={data} />
</>
);
}

if (isError) console.log('error');
return (
<>
<DetailReviewStats />
{/* <DetailReview /> */}
</>
);
}
Loading