diff --git a/frontend/src/Router.jsx b/frontend/src/Router.jsx
index 0e47bde..583d228 100644
--- a/frontend/src/Router.jsx
+++ b/frontend/src/Router.jsx
@@ -68,11 +68,11 @@ const router = createBrowserRouter([
element: ,
},
{
- path: 'lecture/:lectureId/info',
+ path: 'lecture/:lectureId',
element: ,
},
{
- path: 'lecture/:lectureId',
+ path: 'lecture/:lectureId/class',
element: ,
children: [
{
diff --git a/frontend/src/components/Article/ArticleDetail/ArticleDetail.jsx b/frontend/src/components/Article/ArticleDetail/ArticleDetail.jsx
index 139d35c..0d6150e 100644
--- a/frontend/src/components/Article/ArticleDetail/ArticleDetail.jsx
+++ b/frontend/src/components/Article/ArticleDetail/ArticleDetail.jsx
@@ -4,10 +4,21 @@ import styles from './ArticleDetail.module.css';
import ArticleDetailAnswer from './ArticleDetailAnswer/ArticleDetailAnswer';
import ArticleDetailAnswerInput from './ArticleDetailAnswer/ArticleDetailAnswerInput';
import { useState, useEffect } from 'react';
+import useBoundStore from '../../../store';
-export default function ArticleDetail({ topic, title, author = null, content, answer = null, onDelete, isQna = true }) {
+export default function ArticleDetail({
+ topic,
+ title,
+ author = null,
+ content,
+ answer = null,
+ onDelete,
+ isMine = false,
+ isQna = true,
+}) {
const [submittedAnswer, setSubmittedAnswer] = useState(answer);
const [isEditing, setIsEditing] = useState(false);
+ const userType = useBoundStore((state) => state.userType);
useEffect(() => {
setSubmittedAnswer(answer);
@@ -44,20 +55,24 @@ export default function ArticleDetail({ topic, title, author = null, content, an
-
- 수정
-
-
+ {(isMine || userType === 'teacher') && (
+ <>
+
+ 수정
+
+
+ >
+ )}
diff --git a/frontend/src/components/ClassInfo/ClassInfo.jsx b/frontend/src/components/ClassInfo/ClassInfo.jsx
index cf7d207..68e6cc1 100644
--- a/frontend/src/components/ClassInfo/ClassInfo.jsx
+++ b/frontend/src/components/ClassInfo/ClassInfo.jsx
@@ -15,15 +15,17 @@ export default function ClassInfo({ classTerm, classTime, status = 'NOT_ENROLLED
{classTime}
-
+ {status !== 'MANAGED_BY_OTHERS' && (
+
+ )}
);
}
diff --git a/frontend/src/components/Layout/LectureLayout.jsx b/frontend/src/components/Layout/LectureLayout.jsx
index db8874e..4202c14 100644
--- a/frontend/src/components/Layout/LectureLayout.jsx
+++ b/frontend/src/components/Layout/LectureLayout.jsx
@@ -3,7 +3,7 @@ import { Outlet, useParams } from 'react-router-dom';
import LectureHeader from '../LectureHeader/LectureHeader';
import { SideBar, SideLink, SideItem } from '../SideBar';
import MaxWidthLayout from './MaxWidthLayout';
-import { Suspense } from 'react';
+import { Suspense, useEffect } from 'react';
import useBoundStore from '../../store';
import { useLectureInfo } from '../../hooks/api/useLectureInfo';
import LoadingIndicator from '../LoadingIndicator.jsx/LoadingIndicator';
@@ -34,6 +34,12 @@ export default function LectureLayout() {
time: lecture.time,
};
+ useEffect(() => {
+ if (['NOT_ENROLLED', 'MANAGED_BY_OTHERS', 'PENDING'].includes(lecture.status)) {
+ navigate('..');
+ }
+ }, [lecture.status, navigate]);
+
return (
<>
state.userType);
+ const myLectureTitle = userType === 'student' ? '수강중인 강의' : '내 강의';
+
return (
<>
@@ -15,7 +19,7 @@ export default function MyPageLayout() {
to={''}
end
>
- 수강중인 강의
+ {myLectureTitle}
개인정보 변경
비밀번호 변경
diff --git a/frontend/src/hooks/api/useAnswerDelete.js b/frontend/src/hooks/api/useAnswerDelete.js
index 39c303e..30c06c0 100644
--- a/frontend/src/hooks/api/useAnswerDelete.js
+++ b/frontend/src/hooks/api/useAnswerDelete.js
@@ -6,7 +6,7 @@ export function useAnswerDelete() {
const newAnswer = {
answer: null,
};
- return instance.post(`${API_URL}/qna/answer/create/${questionId}`, newAnswer);
+ return instance.post(`${API_URL}/qna/answer/delete/${questionId}`, newAnswer);
};
return { answerDelete };
diff --git a/frontend/src/pages/DefaultHomePage/DefaultHomePage.jsx b/frontend/src/pages/DefaultHomePage/DefaultHomePage.jsx
index db1a1e5..bc86d1f 100644
--- a/frontend/src/pages/DefaultHomePage/DefaultHomePage.jsx
+++ b/frontend/src/pages/DefaultHomePage/DefaultHomePage.jsx
@@ -14,7 +14,7 @@ export default function StudentHomePage() {
{allClasses.map?.((lecture) => (
{lecture.title}
diff --git a/frontend/src/pages/LearningLecturesPage/LearningLecturesPage.jsx b/frontend/src/pages/LearningLecturesPage/LearningLecturesPage.jsx
index 2b6be71..d3ab6ed 100644
--- a/frontend/src/pages/LearningLecturesPage/LearningLecturesPage.jsx
+++ b/frontend/src/pages/LearningLecturesPage/LearningLecturesPage.jsx
@@ -3,21 +3,24 @@ import { Link } from 'react-router-dom';
import { useMyLectures } from '../../hooks/api/useMyLectures';
import CompassIcon from '/src/assets/icons/compass.svg?react';
import { STATIC_URL } from '../../constants';
+import useBoundStore from '../../store';
export default function LearningLecturesPage() {
const { data } = useMyLectures();
const onGoingClasses = data?.data ?? [];
const hasOnGoingClasses = onGoingClasses.length > 0;
+ const userType = useBoundStore((state) => state.userType);
+ const myLectureTitle = userType === 'student' ? '수강중인 강의' : '내 강의';
return (
- 수강중인 강의
+ {myLectureTitle}
{hasOnGoingClasses ? (
onGoingClasses.map?.((lecture) => (
{lecture.image ? (
diff --git a/frontend/src/pages/LectureInfoPage/LectureInfoPage.jsx b/frontend/src/pages/LectureInfoPage/LectureInfoPage.jsx
index 5b674e4..838cc1f 100644
--- a/frontend/src/pages/LectureInfoPage/LectureInfoPage.jsx
+++ b/frontend/src/pages/LectureInfoPage/LectureInfoPage.jsx
@@ -24,7 +24,7 @@ export default function LectureInfoPage() {
}
if (status === 'ENROLLED') {
- navigate(`/lecture/${lectureId}`);
+ navigate(`/lecture/${lectureId}/class`);
}
if (status === 'NOT_ENROLLED') {
diff --git a/frontend/src/pages/NoticeDetailPage/NoticeDetailPage.jsx b/frontend/src/pages/NoticeDetailPage/NoticeDetailPage.jsx
index 727845f..6d91d0d 100644
--- a/frontend/src/pages/NoticeDetailPage/NoticeDetailPage.jsx
+++ b/frontend/src/pages/NoticeDetailPage/NoticeDetailPage.jsx
@@ -23,6 +23,7 @@ export default function NoticeDetailPage() {
content={notice.content}
onDelete={handleDelete}
isQna={false}
+ isMine={notice.mine}
/>
);
}
diff --git a/frontend/src/pages/StudentHomePage/StudentHomePage.jsx b/frontend/src/pages/StudentHomePage/StudentHomePage.jsx
index 4d75deb..43be65d 100644
--- a/frontend/src/pages/StudentHomePage/StudentHomePage.jsx
+++ b/frontend/src/pages/StudentHomePage/StudentHomePage.jsx
@@ -20,7 +20,7 @@ export default function StudentHomePage() {
onGoingClasses.map?.((lecture) => (
{lecture.title}
@@ -34,7 +34,7 @@ export default function StudentHomePage() {
{allClasses.map?.((lecture) => (
{lecture.title}
diff --git a/frontend/src/pages/TeacherHomePage/TeacherHomePage.jsx b/frontend/src/pages/TeacherHomePage/TeacherHomePage.jsx
index cc730ec..650aaf1 100644
--- a/frontend/src/pages/TeacherHomePage/TeacherHomePage.jsx
+++ b/frontend/src/pages/TeacherHomePage/TeacherHomePage.jsx
@@ -16,7 +16,7 @@ export default function TeacherHomePage() {
{onGoingClasses.map((lecture) => (
{lecture.title}
diff --git a/frontend/src/pages/TeacherHomePage/TeacherHomePage.module.css b/frontend/src/pages/TeacherHomePage/TeacherHomePage.module.css
index fa3c693..2e5837d 100644
--- a/frontend/src/pages/TeacherHomePage/TeacherHomePage.module.css
+++ b/frontend/src/pages/TeacherHomePage/TeacherHomePage.module.css
@@ -5,8 +5,8 @@
align-items: center;
gap: 20px;
margin-bottom: 32px;
- width: 295px;
- height: 220px;
+ width: 100%;
+ aspect-ratio: 4/3;
background-color: var(--background);
color: var(--text-color);
stroke: var(--text-color);