Merge branch 'fe/classManagePage' into 'frontend'

[Front-End] feat: 수강신청 관리 페이지 내용 없을 때 수정

See merge request s11-webmobile1-sub2/S11P12A701!118
This commit is contained in:
정기영 2024-08-08 17:57:08 +09:00
commit 4b3c2da7c8
2 changed files with 22 additions and 5 deletions

View File

@ -10,7 +10,7 @@ export default function LectureEnrollPage() {
const { data } = useLectureEnroll(lectureId);
const [newStudents, setNewStudents] = useState([]);
const [students, setStudents] = useState([]);
console.log(data);
useEffect(() => {
if (data?.data) {
setNewStudents(data.data[1]);
@ -31,7 +31,7 @@ export default function LectureEnrollPage() {
title="수강신청 관리"
canCreate={false}
>
{newStudents.length &&
{newStudents.length > 0 ? (
newStudents.map?.((student) => (
<LectureEnroll
key={`${student.id}`}
@ -40,10 +40,13 @@ export default function LectureEnrollPage() {
onDelete={handleNewDelete}
enrolled={false}
/>
))}
))
) : (
<div className={styles.emptyMessage}>수강 대기중인 학생이 없어요</div>
)}
<div>
<h3 className={styles.title}>전체 수강생 관리</h3>
{students.length &&
{students.length > 0 ? (
students.map?.((student) => (
<LectureEnroll
key={`${student.id}`}
@ -51,7 +54,10 @@ export default function LectureEnrollPage() {
userName={student.userName}
onDelete={handleDelete}
/>
))}
))
) : (
<div className={styles.emptyMessage}>현재 수강생이 없어요</div>
)}
</div>
</ArticleBoard>
);

View File

@ -4,3 +4,14 @@
font-weight: 700;
padding-left: 20px;
}
.emptyMessage {
display: flex;
justify-content: center;
align-items: center;
font-size: 16px;
line-height: 1.2;
font-weight: 400;
color: var(--text-color-tertiary);
padding: 40px 0;
}