From ec5e95422f1916e3da8d127dc106b7e920c7b931 Mon Sep 17 00:00:00 2001 From: xihxxn Date: Sun, 7 Jun 2026 11:49:56 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[Feat]=20=EC=84=B8=EC=85=98=20=EC=83=81?= =?UTF-8?q?=ED=83=9C=EB=B3=84=20=EC=BB=A4=EB=A6=AC=ED=81=98=EB=9F=BC=20?= =?UTF-8?q?=EC=BD=98=ED=85=90=EC=B8=A0=20=EB=85=B8=EC=B6=9C=20=EB=B6=84?= =?UTF-8?q?=EA=B8=B0=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/pages/curriculum/CurriculumPage.js | 48 +++++++++++-------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/frontend/src/pages/curriculum/CurriculumPage.js b/frontend/src/pages/curriculum/CurriculumPage.js index 2627f39..f6ffb3c 100644 --- a/frontend/src/pages/curriculum/CurriculumPage.js +++ b/frontend/src/pages/curriculum/CurriculumPage.js @@ -9,8 +9,8 @@ import Toggle1 from '../../assets/images/icon_togle1.svg'; const role = localStorage.getItem('role') || 'MEMBER'; const DAY_LABEL = { SUNDAY: '일요일', MONDAY: '월요일', TUESDAY: '화요일', WEDNESDAY: '수요일', THURSDAY: '목요일', FRIDAY: '금요일', SATURDAY: '토요일' }; -const STATUS_OPTIONS = ['BEFORE', 'ONGOING', 'AFTER']; -const STATUS_LABEL = { BEFORE: '세션 전', ONGOING: '세션 중', AFTER: '세션 후' }; +const STATUS_OPTIONS = ['BEFORE_SESSION', 'IN_SESSION', 'AFTER_SESSION']; +const STATUS_LABEL = { BEFORE_SESSION: '세션 전', IN_SESSION: '세션 중', AFTER_SESSION: '세션 후' }; // sessionDate(yyyy-mm-dd)에서 요일 계산 function getWeekDayFromDate(dateStr) { @@ -25,28 +25,35 @@ function getWeekDayFromDate(dateStr) { function SessionInfo({ session, isAdmin }) { const icon = session.dayPart === 'AM' ? AmImg : PmImg; const label = session.dayPart === 'AM' ? '오전 세션' : '오후 세션'; + const status = session.status; + const showDetail = isAdmin || status === 'IN_SESSION' || status === 'AFTER_SESSION'; + const showRecording = isAdmin || status === 'AFTER_SESSION'; return (
{label} {session.title} - {session.hostName} -
-
- 세션 자료 - {session.sessionMaterialUrl - ? {session.sessionMaterialName || '링크'} - : {session.sessionMaterialName || '-'} - } -
-
- {session.recordingUrl - ? 녹화본 - : - - } - {session.recordingPassword && PW : {session.recordingPassword}} + {showDetail && {session.hostName}}
+ {showDetail && ( +
+ 세션 자료 + {session.sessionMaterialUrl + ? {session.sessionMaterialName || '링크'} + : {session.sessionMaterialName || '-'} + } +
+ )} + {showRecording && ( +
+ {session.recordingUrl + ? 녹화본 + : - + } + {session.recordingPassword && PW : {session.recordingPassword}} +
+ )}
); } @@ -57,6 +64,7 @@ function MemberSessionCard({ day }) { const amSession = day.sessions?.find(s => s.dayPart === 'AM'); const pmSession = day.sessions?.find(s => s.dayPart === 'PM'); const weekDay = getWeekDayFromDate(day.sessionDate) || DAY_LABEL[day.dayOfWeek] || ''; + const showAssignment = amSession?.status === 'AFTER_SESSION' && pmSession?.status === 'AFTER_SESSION'; return (
@@ -73,7 +81,7 @@ function MemberSessionCard({ day }) {
{amSession && } {pmSession && } - {(day.assignmentName || day.assignmentUrl) && ( + {showAssignment && (day.assignmentName || day.assignmentUrl) && (
과제 {day.assignmentUrl @@ -143,14 +151,14 @@ function SessionForm({ day, week, onClose, onSave }) { amMaterialName: day?.sessions?.find(s => s.dayPart === 'AM')?.sessionMaterialName || '', amRecordingUrl: day?.sessions?.find(s => s.dayPart === 'AM')?.recordingUrl || '', amRecordingPw: day?.sessions?.find(s => s.dayPart === 'AM')?.recordingPassword || '', - amStatus: day?.sessions?.find(s => s.dayPart === 'AM')?.status || 'BEFORE', + amStatus: day?.sessions?.find(s => s.dayPart === 'AM')?.status || 'BEFORE_SESSION', pmTitle: day?.sessions?.find(s => s.dayPart === 'PM')?.title || '', pmHost: day?.sessions?.find(s => s.dayPart === 'PM')?.hostName || '', pmMaterialUrl: day?.sessions?.find(s => s.dayPart === 'PM')?.sessionMaterialUrl || '', pmMaterialName: day?.sessions?.find(s => s.dayPart === 'PM')?.sessionMaterialName || '', pmRecordingUrl: day?.sessions?.find(s => s.dayPart === 'PM')?.recordingUrl || '', pmRecordingPw: day?.sessions?.find(s => s.dayPart === 'PM')?.recordingPassword || '', - pmStatus: day?.sessions?.find(s => s.dayPart === 'PM')?.status || 'BEFORE', + pmStatus: day?.sessions?.find(s => s.dayPart === 'PM')?.status || 'BEFORE_SESSION', assignmentUrl: day?.assignmentUrl || '', assignmentName: day?.assignmentName || '', }); From 5677e697a11e9d85833e451bd0453cfb18ffe0da Mon Sep 17 00:00:00 2001 From: xihxxn Date: Sun, 7 Jun 2026 12:03:03 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[Fix]=20role=20=EC=83=81=ED=83=9C=EB=A5=BC?= =?UTF-8?q?=20useState=EB=A1=9C=20=EC=9D=B4=EB=8F=99=ED=95=98=EC=97=AC=20?= =?UTF-8?q?=EC=B2=AB=20=EB=A0=8C=EB=8D=94=EB=A7=81=20=EC=8B=9C=20=EA=B6=8C?= =?UTF-8?q?=ED=95=9C=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/curriculum/CurriculumPage.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/curriculum/CurriculumPage.js b/frontend/src/pages/curriculum/CurriculumPage.js index f6ffb3c..d7dc328 100644 --- a/frontend/src/pages/curriculum/CurriculumPage.js +++ b/frontend/src/pages/curriculum/CurriculumPage.js @@ -6,8 +6,6 @@ import AmImg from '../../assets/images/am.png'; import PmImg from '../../assets/images/pm.png'; import Toggle1 from '../../assets/images/icon_togle1.svg'; -const role = localStorage.getItem('role') || 'MEMBER'; - const DAY_LABEL = { SUNDAY: '일요일', MONDAY: '월요일', TUESDAY: '화요일', WEDNESDAY: '수요일', THURSDAY: '목요일', FRIDAY: '금요일', SATURDAY: '토요일' }; const STATUS_OPTIONS = ['BEFORE_SESSION', 'IN_SESSION', 'AFTER_SESSION']; const STATUS_LABEL = { BEFORE_SESSION: '세션 전', IN_SESSION: '세션 중', AFTER_SESSION: '세션 후' }; @@ -320,11 +318,18 @@ function SessionForm({ day, week, onClose, onSave }) { // ── 메인 컴포넌트 ───────────────────────────────────── function CurriculumPage() { + const [role, setRole] = useState(localStorage.getItem('role') || 'MEMBER'); const [days, setDays] = useState([]); const [showForm, setShowForm] = useState(false); const [editDay, setEditDay] = useState(null); const [createWeek, setCreateWeek] = useState(null); + useEffect(() => { + const handleStorage = () => setRole(localStorage.getItem('role') || 'MEMBER'); + window.addEventListener('storage', handleStorage); + return () => window.removeEventListener('storage', handleStorage); + }, []); + const fetchDays = async () => { try { const res = await authFetch('/api/curriculums');