From 1c110b3ce1b98bed5b7e2c8f79cdfc00313093bb Mon Sep 17 00:00:00 2001 From: kdhye1119 Date: Fri, 22 May 2026 16:19:39 +0900 Subject: [PATCH 01/10] =?UTF-8?q?[feat]=20isstaff=EC=9D=BC=20=EB=95=8C=20?= =?UTF-8?q?=EC=A7=88=EB=AC=B8=20=EB=A6=AC=EC=8A=A4=ED=8A=B8=20=ED=99=94?= =?UTF-8?q?=EB=A9=B4=20=EA=B5=AC=ED=98=84=20=EC=99=84=EB=A3=8C=20#32?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/qna/QnAListPage.js | 56 ++++++++++++++----- frontend/src/pages/qna/QnAListPage.module.css | 18 +++++- 2 files changed, 59 insertions(+), 15 deletions(-) diff --git a/frontend/src/pages/qna/QnAListPage.js b/frontend/src/pages/qna/QnAListPage.js index 6ca0380..6aa0b19 100644 --- a/frontend/src/pages/qna/QnAListPage.js +++ b/frontend/src/pages/qna/QnAListPage.js @@ -2,6 +2,7 @@ import { useState } from 'react'; import styles from './QnAListPage.module.css'; import { FiChevronLeft, FiChevronRight } from 'react-icons/fi'; + const CommentImoji = () => ( @@ -71,6 +72,7 @@ const MOCK_QUESTIONS = [ text: '벤브 어떻게 활성화 시켜요?', likes: 7, iLiked: false, // 내가 좋아요 눌렀는지 + isSolved: false, // 운영진이 해결 표시했는지 image: null, // 첨부 이미지 없음 comments: [], // 댓글 없음 }, @@ -79,6 +81,7 @@ const MOCK_QUESTIONS = [ text: '오류났어요', likes: 7, iLiked: false, + isSolved: false, image: 'https://dora-guide.com/wp-content/uploads/2019/11/Visual-studio-code-%EC%84%A4%EC%B9%98-%EB%B0%8F-%EC%82%AC%EC%9A%A9%EB%B2%95.png', comments: [ { id: 1, author: '운영진1', isStaff: true, content: '사진 참고하세요' }, @@ -91,6 +94,7 @@ const MOCK_QUESTIONS = [ text: '벤브 어떻게 활성화 시켜요?', likes: 7, iLiked: false, + isSolved: false, image: null, comments: [], }, @@ -99,6 +103,7 @@ const MOCK_QUESTIONS = [ text: '벤브 어떻게 활성화 시켜요?', likes: 7, iLiked: false, + isSolved: true, image: null, comments: [], }, @@ -107,6 +112,7 @@ const MOCK_QUESTIONS = [ text: '벤브 어떻게 활성화 시켜요?', likes: 7, iLiked: false, + isSolved: true, image: null, comments: [], }, @@ -119,6 +125,7 @@ const MOCK_QUESTIONS = [ function QnAListPage({ sessionTitle = '1주차 화요일 오전 세션(HTML/CSS)', sessionId = 1, + isStaff = true, onBack, onCardClick, // 카드 클릭 시 상세 페이지 이동 (questionId를 인자로 받아) }) { @@ -128,9 +135,12 @@ function QnAListPage({ // 현재 보고 있는 이해도 체크 인덱스 (0 = '이해했다') const [understandIndex, setUnderstandIndex] = useState(0); - // 저도 궁금해요 필터 켜져 있는지 + // 저도 궁금해요 필터 켜져 있는지(부원) const [filterCurious, setFilterCurious] = useState(false); + // 미해결 질문 필터 켜져 있는지(운영진) + const [filterUnsolved, setFilterUnsolved] = useState(false); + // 정렬 방식 const [sortOrder, setSortOrder] = useState('정렬'); @@ -151,7 +161,7 @@ function QnAListPage({ // 각 질문별 댓글 입력창 텍스트 (객체로 관리: { 질문id: 입력된텍스트 }) const [commentInputs, setCommentInputs] = useState({}); - // 새 질문 입력창 텍스트 + // 새 질문 입력창 텍스트x const [newQuestion, setNewQuestion] = useState(''); // API 요청 중인지 여부 (true면 버튼 비활성화 → 중복 제출 방지) @@ -251,9 +261,11 @@ function QnAListPage({ const currentUnderstand = UNDERSTAND[understandIndex]; // 저도 궁금해요 필터가 켜져 있으면 필터링 - const displayedQuestions = filterCurious - ? questions.filter(q => q.iLiked) - : questions; + const displayedQuestions = (() => { + if (isStaff && filterUnsolved) return questions.filter(q => q.comments.length === 0 && !q.isSolved); + if (!isStaff && filterCurious) return questions.filter(q => q.iLiked); + return questions; + })(); @@ -267,15 +279,27 @@ function QnAListPage({

{sessionTitle}

- + {isStaff ? ( + + ) : ( + + )}