Merge pull request #129 from TeamBNBN/fe/fixNoContents
[Front-End] fix: 컨텐츠 없을 때 에러 발생하는 문제 해결
This commit is contained in:
commit
6f2da2a7b6
@ -13,7 +13,7 @@ export default function ArticlePreview({ to, title, contents = [] }) {
|
||||
<RightIcon />
|
||||
</Link>
|
||||
<div className={styles.main}>
|
||||
{contents.map((content) => {
|
||||
{contents.map?.((content) => {
|
||||
return (
|
||||
<Link
|
||||
to={`${to}/${content.id}`}
|
||||
|
@ -14,7 +14,7 @@ export default function ChatRoom() {
|
||||
className={styles.messageList}
|
||||
ref={chatListRef}
|
||||
>
|
||||
{messages.map((message) => (
|
||||
{messages.map?.((message) => (
|
||||
<li
|
||||
key={message.id}
|
||||
className={message.isMine ? styles.my : styles.your}
|
||||
|
@ -11,7 +11,6 @@
|
||||
.title {
|
||||
margin: 0;
|
||||
padding: 16px;
|
||||
z-index: 9;
|
||||
}
|
||||
|
||||
.messageList {
|
||||
@ -97,7 +96,6 @@
|
||||
border-radius: 12px;
|
||||
box-shadow: var(--shadow);
|
||||
overflow: hidden;
|
||||
z-index: 9;
|
||||
|
||||
& > input[type='text'] {
|
||||
flex: 1;
|
||||
|
@ -14,7 +14,7 @@ export default function LearningLecturesPage() {
|
||||
<section>
|
||||
<h2 className={styles.title}>수강중인 강의</h2>
|
||||
<div className={styles.grid}>
|
||||
{onGoingClasses.map((lecture) => (
|
||||
{onGoingClasses.map?.((lecture) => (
|
||||
<Link
|
||||
key={lecture.lecture_id}
|
||||
to={`/lecture/${lecture.lecture_id}`}
|
||||
|
@ -13,7 +13,7 @@ export default function NoticeListPage() {
|
||||
title="공지사항"
|
||||
canCreate={false}
|
||||
>
|
||||
{notices?.map((notice) => (
|
||||
{notices?.map?.((notice) => (
|
||||
<ArticleLink
|
||||
key={`${notice.id}`}
|
||||
title={notice.title}
|
||||
|
@ -13,7 +13,7 @@ export default function QuestionListPage() {
|
||||
title="Q&A"
|
||||
canCreate={true}
|
||||
>
|
||||
{questions.map((question) => (
|
||||
{questions.map?.((question) => (
|
||||
<ArticleLink
|
||||
key={`${question.title}${question.createtAt}`}
|
||||
title={question.title}
|
||||
|
@ -13,12 +13,12 @@ export default function StudentHomePage() {
|
||||
};
|
||||
|
||||
const { data } = useLectures();
|
||||
const allClasses = data?.data;
|
||||
const allClasses = data?.data ?? [];
|
||||
|
||||
return (
|
||||
<MaxWidthLayout>
|
||||
<ClassGrid title="수강중인 강의">
|
||||
{onGoingClasses.map((lecture) => (
|
||||
{onGoingClasses.map?.((lecture) => (
|
||||
<ClassCard
|
||||
key={lecture.lecture_id}
|
||||
path={`/lecture/${lecture.lecture_id}`}
|
||||
@ -28,7 +28,7 @@ export default function StudentHomePage() {
|
||||
))}
|
||||
</ClassGrid>
|
||||
<ClassGrid title="전체 강의">
|
||||
{allClasses?.map((lecture) => (
|
||||
{allClasses.map?.((lecture) => (
|
||||
<ClassCard
|
||||
key={lecture.id}
|
||||
path={`/lecture/${lecture.id}/info`}
|
||||
|
@ -14,7 +14,7 @@ export default function StudentListPage() {
|
||||
|
||||
return (
|
||||
<ArticleBoard title="수강생 관리">
|
||||
{students.map((student) => {
|
||||
{students.map?.((student) => {
|
||||
return (
|
||||
<ArticleLink
|
||||
key={`${student.name}${student.sub}`}
|
||||
|
@ -16,7 +16,7 @@ export default function TeacherNoticeListPage() {
|
||||
title="공지사항"
|
||||
canCreate={true}
|
||||
>
|
||||
{notices.map((notice) => {
|
||||
{notices.map?.((notice) => {
|
||||
if (notice.sub && notice.title) {
|
||||
return (
|
||||
<ArticleLink
|
||||
|
Loading…
Reference in New Issue
Block a user