diff --git a/src/content/App.tsx b/src/content/App.tsx index 5fb48a3..1576028 100644 --- a/src/content/App.tsx +++ b/src/content/App.tsx @@ -149,184 +149,192 @@ export default function App() { })); }; + useEffect(() => { + if (isOpen) { + document.body.style.overflow = 'hidden'; + } else { + document.body.style.overflow = ''; + } + + return () => { + document.body.style.overflow = ''; + }; + }, [isOpen]); + return ( <> - { - // 필요한 경우 강제 종료 처리 - console.log("사용자가 다이얼로그를 닫았습니다") - }} - /> - - - {isOpen ? ( - { - setIsOpen(!isOpen); - e.preventDefault(); - }} - draggable={false} - className="rounded-2xl w-32 h-32 shadow-xl cursor-pointer" - alt="Close" - /> - ) : ( - { - setIsOpen(!isOpen); - e.preventDefault(); - }} - draggable={false} - className="rounded-2xl w-32 h-32 shadow-xl cursor-pointer" - alt="Open" - /> - )} - - -
-
-
- {activeTab === 'VIDEO' - ? '온라인 강의 목록' - : activeTab === 'ASSIGN' - ? '과제 목록' - : activeTab === 'QUIZ' - ? '퀴즈 목록' - : '오류'} + {}} /> + + + {isOpen ? ( + { + setIsOpen(!isOpen); + e.preventDefault(); + }} + draggable={false} + className="rounded-2xl w-32 h-32 shadow-xl cursor-pointer" + alt="Close" + /> + ) : ( + { + setIsOpen(!isOpen); + e.preventDefault(); + }} + draggable={false} + className="rounded-2xl w-32 h-32 shadow-xl cursor-pointer" + alt="Open" + /> + )} + + +
+
+
+ {activeTab === 'VIDEO' + ? '온라인 강의 목록' + : activeTab === 'ASSIGN' + ? '과제 목록' + : activeTab === 'QUIZ' + ? '퀴즈 목록' + : '오류'} +
+
+ {/* refreshTime 대신 남은 시간을 표시 */} + = 30 + ? 'text-amber-500 font-semibold' + : 'text-zinc-400' + : Math.floor(remainingTime / 60) >= 1 + ? 'text-amber-500 font-semibold' + : 'text-zinc-400' + }`} + > + {remainingTime < 60 + ? `${Math.round(remainingTime)}분 전` + : `${Math.floor(remainingTime / 60)}시간 전`} + + +
-
- {/* refreshTime 대신 남은 시간을 표시 */} - = 30 - ? 'text-amber-500 font-semibold' - : 'text-zinc-400' - : Math.floor(remainingTime / 60) >= 1 - ? 'text-amber-500 font-semibold' - : 'text-zinc-400' - }`} - > - {remainingTime < 60 ? `${Math.round(remainingTime)}분 전` : `${Math.floor(remainingTime / 60)}시간 전`} - - +
+ + setSearchTerm(e.target.value)} + autoFocus={true} + className="bg-zinc-50 rounded-xl border border-zinc-300 w-full text-lg h-12 pl-12 pr-4 placeholder-gray-400 font-medium py-0 outline-none focus:ring-0 focus:border-zinc-300 focus:bg-slate-50 transition-all duration-200" + />
-
-
- - setSearchTerm(e.target.value)} - autoFocus={true} - className="bg-zinc-50 rounded-xl border border-zinc-300 w-full text-lg h-12 pl-12 pr-4 placeholder-gray-400 font-medium py-0 outline-none focus:ring-0 focus:border-zinc-300 focus:bg-slate-50 transition-all duration-200" - /> -
-
-
- {filters[activeTab].courseTitles.map((title) => ( - handleCourseTitleChange(title)} /> - ))} - {activeTab === 'VIDEO' && - filters[activeTab].attendanceStatuses && - filters[activeTab].attendanceStatuses.map((status) => ( - handleAttendanceFilterChange(status)} - /> +
+
+ {filters[activeTab].courseTitles.map((title) => ( + handleCourseTitleChange(title)} /> ))} - {activeTab === 'ASSIGN' && - filters[activeTab].submitStatuses && - filters[activeTab].submitStatuses.map((status) => ( - handleSubmitFilterChange(status)} - /> - ))} -
+ {activeTab === 'VIDEO' && + filters[activeTab].attendanceStatuses && + filters[activeTab].attendanceStatuses.map((status) => ( + handleAttendanceFilterChange(status)} + /> + ))} + {activeTab === 'ASSIGN' && + filters[activeTab].submitStatuses && + filters[activeTab].submitStatuses.map((status) => ( + handleSubmitFilterChange(status)} + /> + ))} +
- {/* 고정된 필터 아이콘 영역 */} -
- - - - - - - - - - + {/* 고정된 필터 아이콘 영역 */} +
+ + + + + + + + + + +
-
-
- {isPending ? ( -
- -
- ) : ( - <> - {activeTab === 'VIDEO' &&
- - - +
+ {isPending ? ( +
+ +
+ ) : ( + <> + {activeTab === 'VIDEO' &&
+ + + ); } diff --git a/src/content/components/Assignment.tsx b/src/content/components/Assignment.tsx index df71ab9..3b10573 100644 --- a/src/content/components/Assignment.tsx +++ b/src/content/components/Assignment.tsx @@ -62,6 +62,7 @@ export default function Assignment({ courseData }: Props) { paddingLeft: '4px', paddingRight: '4px', clipPath: 'inset(0 0 0 0);', + zIndex: '9999', }} > {calculateRemainingTime(course.dueDate)} diff --git a/src/content/components/QuizTab.tsx b/src/content/components/QuizTab.tsx index e2753d7..0935562 100644 --- a/src/content/components/QuizTab.tsx +++ b/src/content/components/QuizTab.tsx @@ -61,6 +61,7 @@ export default function QuizTab({ courseData }: Props) { paddingBottom: '1px', paddingLeft: '4px', paddingRight: '4px', + zIndex: '9999', }} > {calculateRemainingTime(course.dueDate)} diff --git a/src/content/components/Video.tsx b/src/content/components/Video.tsx index 47ac710..4f8005f 100644 --- a/src/content/components/Video.tsx +++ b/src/content/components/Video.tsx @@ -128,6 +128,7 @@ export default function Video({ courseData }: Props) { paddingBottom: '1px', paddingLeft: '4px', paddingRight: '4px', + zIndex: '9999', }} > {calculateRemainingTimeByRange(vods[0].range)} diff --git a/src/hooks/useCourseData.tsx b/src/hooks/useCourseData.tsx index d03fef9..3d0bfa1 100644 --- a/src/hooks/useCourseData.tsx +++ b/src/hooks/useCourseData.tsx @@ -32,52 +32,52 @@ export function useCourseData(courses: any[]) { result.vodDataArray.forEach((vodData) => { if (isCurrentDateInRange(vodData.range)) { - result.vodAttendanceArray.forEach((vodAttendanceData) => { - if (vodAttendanceData.title === vodData.title && vodAttendanceData.week === vodData.week) { - tempVods.push({ - courseId: course.courseId, - prof: course.prof, - courseTitle: course.courseTitle, - week: vodAttendanceData.week, - title: vodAttendanceData.title, - isAttendance: vodAttendanceData.isAttendance, - weeklyAttendance: vodAttendanceData.weeklyAttendance, - length: vodData.length, - range: vodData.range, - subject: vodData.subject, - url: vodData.url, - }); - } - }); + result.vodAttendanceArray.forEach((vodAttendanceData) => { + if (vodAttendanceData.title === vodData.title && vodAttendanceData.week === vodData.week) { + tempVods.push({ + courseId: course.courseId, + prof: course.prof, + courseTitle: course.courseTitle, + week: vodAttendanceData.week, + title: vodAttendanceData.title, + isAttendance: vodAttendanceData.isAttendance, + weeklyAttendance: vodAttendanceData.weeklyAttendance, + length: vodData.length, + range: vodData.range, + subject: vodData.subject, + url: vodData.url, + }); + } + }); } }); result.assignDataArray.forEach((assignData) => { if (isCurrentDateByDate(assignData.dueDate)) { - tempAssigns.push({ - courseId: course.courseId, - prof: course.prof, - courseTitle: course.courseTitle, - subject: assignData.subject, - title: assignData.title, - dueDate: assignData.dueDate, - isSubmit: assignData.isSubmit, - url: assignData.url, - }); + tempAssigns.push({ + courseId: course.courseId, + prof: course.prof, + courseTitle: course.courseTitle, + subject: assignData.subject, + title: assignData.title, + dueDate: assignData.dueDate, + isSubmit: assignData.isSubmit, + url: assignData.url, + }); } }); result.quizDataArray.forEach((quizData) => { if (isCurrentDateByDate(quizData.dueDate)) { - tempQuizes.push({ - courseId: course.courseId, - prof: course.prof, - courseTitle: course.courseTitle, - subject: quizData.subject, - title: quizData.title, - dueDate: quizData.dueDate, - url: quizData.url, - }); + tempQuizes.push({ + courseId: course.courseId, + prof: course.prof, + courseTitle: course.courseTitle, + subject: quizData.subject, + title: quizData.title, + dueDate: quizData.dueDate, + url: quizData.url, + }); } }); }) @@ -142,5 +142,5 @@ export function useCourseData(courses: any[]) { }); } }, [courses, updateData]); - return { vods, assigns, quizes, isPending, remainingTime, refreshTime, updateData, setIsPending }; + return { vods, assigns, quizes, isPending, remainingTime, refreshTime, updateData, setIsPending }; }