@@ -139,31 +139,41 @@ export function CourseDashboard() {
139139 ) ;
140140
141141 const myCourses = courseInfo . map ( ( course ) => (
142- < a href = { `/courses/${ course . ID } ` } key = { course . ID } className = "max-w-[40vw]" >
142+ < a href = { `/courses/${ course . ID } ` } key = { course . ID } className = "max-w-[40vw] aspect-[9/8] " >
143143 < div className = "bg-gray-100 rounded shadow hover:bg-gray-300 flex flex-col h-full w-full outline outline-1 outline-black/25" >
144144 < div className = "h-[60%] " >
145145 < img
146- className = "rounded outline outline-1 outline-black/40 object-fill w-full h-full block aspect-[16/9] "
146+ className = "rounded outline outline-1 outline-black/40 object-fill w-full h-full block aspect-[16/9]"
147147 src = { process . env . PUBLIC_URL + `/content/${ course . ID } /thumbnail.png` }
148148 onError = { ( e ) => { e . target . onError = null ; e . target . className = "invisible" } }
149149 alt = "Thumbnail"
150150 />
151151 </ div >
152- < div className = "p-4 " >
153- < h3 className = "text-xl font-semibold truncate overflow-hidden" > { course . title } </ h3 >
154- < p className = "mt-2 truncate overflow-hidden" > { course . description } </ p >
152+ < div className = "h-[40%] p-2 md:p-4 xl:p-2 overflow-hidden " >
153+ < h3 className = "text-base font-semibold truncate overflow-hidden" > { course . title } </ h3 >
154+ < p className = "truncate overflow-hidden" > { course . description } </ p >
155155 </ div >
156156 </ div >
157157 </ a >
158158 ) ) ;
159159
160160 const allCourses = filteredCourses . map ( ( course ) => (
161- < div key = { course . ID } className = "course-box" >
162- < a href = { `/courses/${ course . ID } ` } key = { course . ID } >
163- < h3 > < b > { course . title } </ b > </ h3 >
164- < p > { course . description } </ p >
165- </ a >
166- </ div >
161+ < a href = { `/courses/${ course . ID } ` } key = { course . ID } className = "max-w-[40vw] aspect-[9/8]" >
162+ < div className = "bg-gray-100 rounded shadow hover:bg-gray-300 flex flex-col h-full w-full outline outline-1 outline-black/25" >
163+ < div className = "h-[60%] " >
164+ < img
165+ className = "rounded outline outline-1 outline-black/40 object-fill w-full h-full block aspect-[16/9]"
166+ src = { process . env . PUBLIC_URL + `/content/${ course . ID } /thumbnail.png` }
167+ onError = { ( e ) => { e . target . onError = null ; e . target . className = "invisible" } }
168+ alt = "Thumbnail"
169+ />
170+ </ div >
171+ < div className = "h-[40%] pl-2 p-1 overflow-hidden" >
172+ < h3 className = "text-base font-semibold truncate overflow-hidden" > { course . title } </ h3 >
173+ < p className = "truncate overflow-hidden" > { course . description } </ p >
174+ </ div >
175+ </ div >
176+ </ a >
167177 ) )
168178
169179 return (
@@ -189,18 +199,16 @@ export function CourseDashboard() {
189199 { /* All Courses Section */ }
190200 < div className = "mt-10" >
191201 < h2 className = "text-xl font-semibold mb-4" > All Courses</ h2 >
192- < div className = "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6" >
193- < div className = "course-list" >
194- { loading ? (
195- < p > Loading courses...</ p >
196- ) : filteredCourses . length > 0 ? (
197- allCourses
198- ) : (
199- < div className = "course-box" >
200- < p > Nothing to show, yet</ p >
201- </ div >
202- ) }
203- </ div >
202+ < div className = "grid grid-cols-2 sm:grid-cols-2 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-8 gap-7" >
203+ { loading ? (
204+ < p > Loading courses...</ p >
205+ ) : filteredCourses . length > 0 ? (
206+ allCourses
207+ ) : (
208+ < div className = "course-box" >
209+ < p > Nothing to show, yet</ p >
210+ </ div >
211+ ) }
204212 </ div >
205213 </ div >
206214 </ div >
0 commit comments