@@ -111,11 +111,12 @@ function ListView(props) {
111111 className = "text-gray-600"
112112 dangerouslySetInnerHTML = { {
113113 __html : readMore [ course . code ]
114- ? course . description
115- : ( course . description . slice ( 0 , 200 ) + "..." ) ,
114+ ? ( course . description || "No description available" )
115+ : ( ( course . description ? course . description . slice ( 0 , 200 ) + "..." : "No description available" ) ) ,
116116 } }
117117 />
118- { course . description . length > 150 && (
118+
119+ { course . description && course . description . length > 150 && (
119120 < span
120121 className = "text-blue-500 cursor-pointer"
121122 onClick = { ( e ) => {
@@ -144,25 +145,31 @@ function ListView(props) {
144145 transition-all duration-300 ease-in-out
145146 font-semibold text-sm shadow-sm
146147 ${ props . favouriteCourses . some ( ( fav ) => fav . code === course . code )
147- ? 'bg-yellow-400 /90 hover:bg-yellow-500/90 border-2 border-yellow-600 hover:border-yellow-700 text-yellow-900'
148- : 'bg-yellow-200/90 hover:bg-yellow-300 border-2 border-yellow-400 hover:border-yellow-500 text-yellow-600 hover:text-yellow-700'
149- } `}
148+ ? 'bg-yellow-400 /90 hover:bg-yellow-500/90 border-2 border-yellow-600 hover:border-yellow-700 text-yellow-900'
149+ : 'bg-yellow-200/90 hover:bg-yellow-300 border-2 border-yellow-400 hover:border-yellow-500 text-yellow-600 hover:text-yellow-700'
150+ } `}
150151 onClick = { ( e ) => {
151152 e . stopPropagation ( ) ;
152153 handleFavouriteClick ( course ) ;
153154 } }
154155 >
155156 { props . favouriteCourses . some ( ( fav ) => fav . code === course . code ) ? (
156157 < >
157- < svg xmlns = "http://www.w3.org/2000/svg" className = "h-5 w-5 fill-yellow-900" viewBox = "0 0 20 20" >
158- < path d = "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" />
158+ < svg xmlns = "http://www.w3.org/2000/svg"
159+ className = "h-5 w-5 fill-yellow-900" viewBox = "0 0 20 20" >
160+ < path
161+ d = "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" />
159162 </ svg >
160163 Remove from Favourites
161164 </ >
162165 ) : (
163166 < >
164- < svg xmlns = "http://www.w3.org/2000/svg" className = "h-5 w-5 stroke-yellow-500" fill = "none" viewBox = "0 0 24 24" stroke = "currentColor" >
165- < path strokeLinecap = "round" strokeLinejoin = "round" strokeWidth = { 2 } d = "M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z" />
167+ < svg xmlns = "http://www.w3.org/2000/svg"
168+ className = "h-5 w-5 stroke-yellow-500" fill = "none"
169+ viewBox = "0 0 24 24" stroke = "currentColor" >
170+ < path strokeLinecap = "round" strokeLinejoin = "round"
171+ strokeWidth = { 2 }
172+ d = "M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z" />
166173 </ svg >
167174 Add to Favourites
168175 </ >
@@ -176,9 +183,9 @@ function ListView(props) {
176183 </ div >
177184 ) }
178185 { props . popup }
179- { ! isLoading && props . targetScroll > 1000 && (
180- < button
181- onClick = { ( ) => props . setTargetScroll ( 0 ) }
186+ { ! isLoading && props . targetScroll > 1000 && (
187+ < button
188+ onClick = { ( ) => props . setTargetScroll ( 0 ) }
182189 className = "fixed bottom-6 right-6 z-50 bg-[#000061] text-white p-3 rounded-full shadow-lg hover:bg-[#1a1a80] transition-all"
183190 title = "Scroll to top"
184191 >
0 commit comments