('');
-
- useEffect(() => {
- const fetchReview = async () => {
- try {
- setIsLoading(true);
-
- const result = await getDetailedReviewApi({ reviewId: Number(id), memberId: Number(memberId) });
- setDetailReview(result);
- setErrorMessage('');
- } catch (error) {
- setErrorMessage('리뷰를 불러오는 데 실패했습니다.');
- } finally {
- setIsLoading(false);
- }
- };
-
- fetchReview();
- }, [id]);
+ const memberId = queryParams.get(DETAILED_REVIEW_API_PARAMS.queryString.memberId);
- if (isLoading) return ;
+ const fetchDetailedReview = async (reviewId: number, memberId: number) => {
+ const result = await getDetailedReviewApi({ reviewId, memberId });
+ return result;
+ };
- if (errorMessage) return Error: {errorMessage}
;
- if (!detailedReview) return Error: 상세보기 리뷰 데이터를 가져올 수 없어요.
;
+ const { data: detailedReview } = useSuspenseQuery({
+ queryKey: [REVIEW_QUERY_KEYS.detailedReview, id, memberId],
+ queryFn: () => fetchDetailedReview(Number(id), Number(memberId)),
+ });
+ if (!detailedReview) throw new Error(' 상세보기 리뷰 데이터를 가져올 수 없어요.');
+ // TODO: 리뷰 공개/비공개 토글 버튼 기능
return (
console.log('click toggle ')}
/>
-
- {detailedReview.reviews.map((item, index) => (
-
+ {/* 시연 때 숨김 */}
+ {detailedReview.contents.map(({ id, question, answer }, index) => (
+
))}
-
+
);
};
diff --git a/frontend/src/pages/ErrorPage/index.tsx b/frontend/src/pages/ErrorPage/index.tsx
index 52d300c90..c773148c3 100644
--- a/frontend/src/pages/ErrorPage/index.tsx
+++ b/frontend/src/pages/ErrorPage/index.tsx
@@ -1,13 +1,9 @@
import { useNavigate } from 'react-router';
-import { Main, PageLayout, SideModal, Sidebar, Topbar } from '@/components';
+import { Main, PageLayout, SideModal, Sidebar, Topbar, ErrorSection } from '@/components';
import { useSidebar } from '@/hooks';
-import ErrorSection from './components/ErrorSection';
-
-const ERROR_MESSAGE = {
- serverUnstable: '서버와의 통신이 불안정합니다.',
-};
+const ERROR_MESSAGE = '찾으시는 페이지가 없어요.';
const ErrorPage = () => {
const { isSidebarHidden, isSidebarModalOpen, closeSidebar, openSidebar } = useSidebar();
@@ -24,17 +20,13 @@ const ErrorPage = () => {
return (
{isSidebarModalOpen && (
-
+
)}
-
+
);
diff --git a/frontend/src/styles/theme.ts b/frontend/src/styles/theme.ts
index 493bbf850..8ffdb9bcc 100644
--- a/frontend/src/styles/theme.ts
+++ b/frontend/src/styles/theme.ts
@@ -3,7 +3,7 @@ import { CSSProperties } from 'react';
import { ThemeProperty } from '../types';
-export const formWidth = '86.7rem';
+export const formWidth = '65rem';
export const sidebarWidth: ThemeProperty = {
desktop: '25rem',
mobile: '100vw',
@@ -15,6 +15,7 @@ export const breakpoints: ThemeProperty = {
};
// NOTE: 1rem = 10px
export const fontSize: ThemeProperty = {
+ small: '1.4rem',
basic: '1.6rem',
medium: '2.4rem',
large: '3.2rem',
diff --git a/frontend/src/types/review.ts b/frontend/src/types/review.ts
index cae033a13..a42d80417 100644
--- a/frontend/src/types/review.ts
+++ b/frontend/src/types/review.ts
@@ -9,21 +9,22 @@ export interface ReviewItem {
}
export interface DetailReviewContent {
+ id: number;
question: string;
answer: string;
}
+// NOTE: 3차-1주차 시현 시 리뷰 상세페이지 API 데이터의 형식이 변경되었는데, keyword부분이 다를 데이터에서 어떻게 변경될 지 몰라서 리뷰 상세페이지의 키워드만을 위한 타입을 따로 만들었어요.
+export interface DetailReviewKeyword {
+ id: number;
+ detail: string;
+}
export interface DetailReviewData {
id: number;
createdAt: Date;
- isPublic: boolean;
- reviewerGroup: {
- id: number;
- name: string;
- description: string;
- thumnailUrl: string;
- };
- reviews: DetailReviewContent[];
- keywords: string[];
+ projectName: string;
+ revieweeName: string;
+ contents: DetailReviewContent[];
+ keywords: DetailReviewKeyword[];
}
// api
diff --git a/frontend/yarn.lock b/frontend/yarn.lock
index 66d2ad309..710d2bb82 100644
--- a/frontend/yarn.lock
+++ b/frontend/yarn.lock
@@ -1098,9 +1098,9 @@
regenerator-runtime "^0.14.0"
"@babel/runtime@^7.9.2":
- version "7.24.8"
- resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.24.8.tgz#5d958c3827b13cc6d05e038c07fb2e5e3420d82e"
- integrity sha512-5F7SDGs1T72ZczbRwbGO9lQi0NLjQxzl6i4lJxLxfW9U5UluCSyEJeniWvnhl3/euNiqQVbo8zruhsDfid0esA==
+ version "7.25.0"
+ resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.25.0.tgz#3af9a91c1b739c569d5d80cc917280919c544ecb"
+ integrity sha512-7dRy4DwXwtzBrPbZflqxnvfxLF8kdZXPkhymtDeFoFqE6ldzjQFgYTtYIFARcLEYDrqfBfYcZt1WqFxRoyC9Rw==
dependencies:
regenerator-runtime "^0.14.0"
@@ -1824,7 +1824,7 @@
lz-string "^1.5.0"
pretty-format "^27.0.2"
-"@testing-library/jest-dom@^6.4.7":
+"@testing-library/jest-dom@^6.4.8":
version "6.4.8"
resolved "https://registry.yarnpkg.com/@testing-library/jest-dom/-/jest-dom-6.4.8.tgz#9c435742b20c6183d4e7034f2b329d562c079daa"
integrity sha512-JD0G+Zc38f5MBHA4NgxQMR5XtO5Jx9g86jqturNTt2WUfRmLDIY7iKkWHDCCTiDuFMre6nxAD5wHw9W5kI4rGw==
@@ -6577,6 +6577,13 @@ react-dom@^18.3.1:
loose-envify "^1.1.0"
scheduler "^0.23.2"
+react-error-boundary@^4.0.13:
+ version "4.0.13"
+ resolved "https://registry.yarnpkg.com/react-error-boundary/-/react-error-boundary-4.0.13.tgz#80386b7b27b1131c5fbb7368b8c0d983354c7947"
+ integrity sha512-b6PwbdSv8XeOSYvjt8LpgpKrZ0yGdtZokYwkwV2wlcZbxgopHX/hgPl5VgpnoVOWd868n1hktM8Qm4b+02MiLQ==
+ dependencies:
+ "@babel/runtime" "^7.12.5"
+
react-is@^16.13.1, react-is@^16.7.0:
version "16.13.1"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"