This commit is contained in:
정기영 2024-08-08 12:23:40 +09:00
commit 99e3cb5248
7 changed files with 36 additions and 13 deletions

View File

@ -12,14 +12,12 @@
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
width: 295px; width: 100%;
height: 220px; aspect-ratio: 4/3;
border-radius: 20px; border-radius: 20px;
background-color: var(--background-secondary); background-color: var(--background-secondary);
stroke: var(--text-color); border: 1px solid var(--background-secondary);
object-fit: contain;
stroke: var(--text-color-secondary);
box-sizing: border-box; box-sizing: border-box;
} }
img.thumbnail {
border: 1px solid var(--border-color);
}

View File

@ -8,7 +8,7 @@
.grid { .grid {
display: grid; display: grid;
grid-template-columns: repeat(auto-fill, minmax(295px, auto)); grid-template-columns: repeat(5, 1fr);
gap: 20px; gap: 20px;
justify-content: start; justify-content: start;
margin-bottom: 40px; margin-bottom: 40px;

View File

@ -26,8 +26,10 @@
width: 120px; width: 120px;
height: 120px; height: 120px;
border-radius: 16px; border-radius: 16px;
stroke: var(--text-color); stroke: var(--text-color-secondary);
border: 1px solid var(--border-color); object-fit: contain;
background-color: var(--background-secondary);
border: 1px solid var(--background-secondary);
} }
.info { .info {
@ -63,6 +65,7 @@
width: 48px; width: 48px;
height: 48px; height: 48px;
border-radius: 50%; border-radius: 50%;
object-fit: cover;
stroke: var(--text-color-secondary); stroke: var(--text-color-secondary);
border: 1px solid var(--border-color); border: 1px solid var(--border-color);
} }

View File

@ -37,6 +37,7 @@
margin: 10px auto; margin: 10px auto;
border-radius: 8px; border-radius: 8px;
background-color: var(--background-secondary); background-color: var(--background-secondary);
object-fit: contain;
cursor: pointer; cursor: pointer;
} }

View File

@ -40,7 +40,9 @@
height: 220px; height: 220px;
margin: 10px auto; margin: 10px auto;
border-radius: 8px; border-radius: 8px;
object-fit: contain;
background-color: var(--background-secondary); background-color: var(--background-secondary);
border: 1px solid var(--background-secondary);
} }
.grid { .grid {

View File

@ -1,6 +1,8 @@
import styles from './LearningLecturesPage.module.css'; import styles from './LearningLecturesPage.module.css';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { useMyLectures } from '../../hooks/api/useMyLectures'; import { useMyLectures } from '../../hooks/api/useMyLectures';
import CompassIcon from '/src/assets/icons/compass.svg?react';
import { STATIC_URL } from '../../constants';
export default function LearningLecturesPage() { export default function LearningLecturesPage() {
const { data } = useMyLectures(); const { data } = useMyLectures();
@ -18,7 +20,17 @@ export default function LearningLecturesPage() {
to={`/lecture/${lecture.id}`} to={`/lecture/${lecture.id}`}
className={styles.card} className={styles.card}
> >
<div className={styles.thumbnail} /> {lecture.image ? (
<img
src={`${STATIC_URL}${lecture.image}`}
alt={lecture.title}
className={styles.thumbnail}
/>
) : (
<div className={styles.thumbnail}>
<CompassIcon />
</div>
)}
<div>{lecture.title}</div> <div>{lecture.title}</div>
</Link> </Link>
)) ))

View File

@ -8,7 +8,7 @@
.grid { .grid {
display: grid; display: grid;
grid-template-columns: repeat(auto-fill, minmax(285px, auto)); grid-template-columns: repeat(4, 1fr);
gap: 20px; gap: 20px;
justify-content: start; justify-content: start;
margin-bottom: 40px; margin-bottom: 40px;
@ -25,8 +25,15 @@
} }
.thumbnail { .thumbnail {
height: 220px; display: flex;
justify-content: center;
align-items: center;
width: 100%;
aspect-ratio: 4/3;
border-radius: 20px; border-radius: 20px;
background-color: var(--background-secondary); background-color: var(--background-secondary);
border: 1px solid var(--background-secondary);
object-fit: contain;
stroke: var(--text-color-secondary);
box-sizing: border-box; box-sizing: border-box;
} }