feat: 메인페이지 이미지 url 추가
This commit is contained in:
parent
3ef118ca0f
commit
5512f2f596
@ -1,13 +1,17 @@
|
||||
import { Link } from 'react-router-dom';
|
||||
import styles from './ClassCard.module.css';
|
||||
|
||||
export default function ClassCard({ path, children }) {
|
||||
export default function ClassCard({ img, path, children }) {
|
||||
return (
|
||||
<Link
|
||||
to={path}
|
||||
className={styles.card}
|
||||
>
|
||||
<div className={styles.thumbnail} />
|
||||
<img
|
||||
src={'img'}
|
||||
alt="강의 이미지"
|
||||
className={styles.thumbnail}
|
||||
/>
|
||||
<div>{children}</div>
|
||||
</Link>
|
||||
);
|
||||
|
@ -6,6 +6,7 @@ import { useLectures } from '../../hooks/api/useLectures';
|
||||
export default function StudentHomePage() {
|
||||
const { data: allLectures } = useLectures();
|
||||
const allClasses = allLectures?.data ?? [];
|
||||
console.log(allClasses);
|
||||
|
||||
return (
|
||||
<MaxWidthLayout>
|
||||
@ -14,6 +15,7 @@ export default function StudentHomePage() {
|
||||
<ClassCard
|
||||
key={lecture.id}
|
||||
path={`/lecture/${lecture.id}/info`}
|
||||
img={lecture.image}
|
||||
>
|
||||
{lecture.title}
|
||||
</ClassCard>
|
||||
|
@ -19,6 +19,7 @@ export default function StudentHomePage() {
|
||||
<ClassCard
|
||||
key={lecture.id}
|
||||
path={`/lecture/${lecture.id}`}
|
||||
img={lecture.image}
|
||||
>
|
||||
{lecture.title}
|
||||
</ClassCard>
|
||||
@ -29,6 +30,7 @@ export default function StudentHomePage() {
|
||||
<ClassCard
|
||||
key={lecture.id}
|
||||
path={`/lecture/${lecture.id}/info`}
|
||||
img={lecture.image}
|
||||
>
|
||||
{lecture.title}
|
||||
</ClassCard>
|
||||
|
@ -6,6 +6,7 @@ import { useMyLectures } from '../../hooks/api/useMyLectures';
|
||||
export default function TeacherHomePage() {
|
||||
const { data: myLectures } = useMyLectures();
|
||||
const onGoingClasses = myLectures?.data ?? [];
|
||||
console.log(onGoingClasses);
|
||||
// TODO: 새 강의 만들기 스타일 추가, 추가 기능 필요시 추가
|
||||
return (
|
||||
<MaxWidthLayout>
|
||||
@ -14,6 +15,7 @@ export default function TeacherHomePage() {
|
||||
<ClassCard
|
||||
key={lecture.id}
|
||||
path={`/lecture/${lecture.id}`}
|
||||
img={lecture.image}
|
||||
>
|
||||
{lecture.title}
|
||||
</ClassCard>
|
||||
|
Loading…
Reference in New Issue
Block a user