Skip to content

Commit 21da057

Browse files
Improved Tag-Based Filtering & Discoverability in Lesson List
1 parent 47a3b88 commit 21da057

4 files changed

Lines changed: 250 additions & 124 deletions

File tree

src/components/BMDashboard/LessonList/LessonCard.jsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ function LessonCard({ filteredLessons, onEditLessonSummary, onDeliteLessonCard,
150150
</>
151151
) : (
152152
<span>
153-
{parse(
153+
{ReactHtmlParser(
154154
(lesson?.content || '').length > maxSummaryLength
155155
? `${lesson.content.slice(0, maxSummaryLength)}...`
156156
: lesson.content || '',
@@ -235,10 +235,18 @@ function LessonCard({ filteredLessons, onEditLessonSummary, onDeliteLessonCard,
235235
return (
236236
<div>
237237
<div style={{ textAlign: 'right' }}>
238-
<button type="submit" onClick={() => expandAll()} className={`${styles.expandLessons}`}>
238+
<button
239+
type="submit"
240+
onClick={() => expandAll()}
241+
className={`${styles.expandLessons} ${darkMode ? styles.darkExpandLessons : ''}`}
242+
>
239243
Expand All
240244
</button>
241-
<button type="submit" onClick={() => collapseAll()} className={`${styles.expandLessons}`}>
245+
<button
246+
type="submit"
247+
onClick={() => collapseAll()}
248+
className={`${styles.expandLessons} ${darkMode ? styles.darkExpandLessons : ''}`}
249+
>
242250
Collapse All
243251
</button>
244252
</div>

src/components/BMDashboard/LessonList/LessonCard.module.css

Lines changed: 100 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -5,71 +5,24 @@
55
overflow: hidden;
66
}
77

8-
.darkCard {
9-
background-color: #1e1e1e !important;
10-
color: #f5f5f5 !important;
11-
border-color: #333 !important;
12-
}
13-
14-
.darkCard .lessonCardHeader {
15-
background-color: #2a2a2a !important;
16-
color: #ffffff !important;
17-
border-bottom: 1px solid #333 !important;
18-
}
19-
20-
.darkCard .scrollableCardBody {
21-
background-color: #1e1e1e !important;
22-
color: #e6e6e6 !important;
23-
}
24-
25-
.darkCard span,
26-
.darkCard p,
27-
.darkCard div {
28-
color: #e6e6e6 !important;
29-
}
30-
31-
.darkCard .tagItem {
32-
color: #bfbfbf !important;
33-
}
34-
35-
.darkCard .lessonCardFooter {
36-
background-color: #2a2a2a !important;
37-
color: #cccccc !important;
38-
border-top: 1px solid #333 !important;
39-
}
40-
41-
.darkCard textarea.editable-lesson-summary {
42-
background-color: #2a2a2a !important;
43-
color: #ffffff !important;
44-
border: 1px solid #555 !important;
45-
}
8+
/* ================= BASE STYLES FIRST ================= */
469

4710
.lessonCardHeader {
4811
background-color: #78bdda !important;
4912
padding: 0.3rem 1.25rem !important;
5013
}
5114

15+
.lessonCardHeader:first-child {
16+
border-radius: 0 !important;
17+
}
18+
5219
.lessonCardBody {
5320
min-height: 20vh;
5421
display: flex;
5522
flex-direction: column;
5623
justify-content: space-between;
5724
}
5825

59-
.cardTagAndFile {
60-
font-size: small;
61-
color: #78bdda;
62-
}
63-
64-
.cardTagAndFile .tagItem {
65-
display: inline-block;
66-
margin-right: 5px;
67-
}
68-
69-
.lessonCardHeader:first-child {
70-
border-radius: 0 !important;
71-
}
72-
7326
.lessonCardFooter {
7427
background-color: #e8f4f9 !important;
7528
display: flex;
@@ -83,6 +36,26 @@
8336
border-radius: 0 !important;
8437
}
8538

39+
.scrollableCardBody {
40+
max-height: 400px;
41+
overflow-y: auto;
42+
}
43+
44+
.tagItem {
45+
font-size: small;
46+
white-space: nowrap;
47+
}
48+
49+
.cardTagAndFile {
50+
font-size: small;
51+
color: #78bdda;
52+
}
53+
54+
.cardTagAndFile .tagItem {
55+
display: inline-block;
56+
margin-right: 5px;
57+
}
58+
8659
.lessonCardTag {
8760
display: flex;
8861
flex-direction: row;
@@ -92,11 +65,6 @@
9265
overflow-x: auto;
9366
}
9467

95-
.scrollableCardBody {
96-
max-height: 400px;
97-
overflow-y: auto;
98-
}
99-
10068
.footerItemsAuthorAndFrom {
10169
margin-right: 5px;
10270
}
@@ -136,11 +104,6 @@
136104
overflow-y: auto;
137105
}
138106

139-
.tagItem {
140-
font-size: small;
141-
white-space: nowrap;
142-
}
143-
144107
.lessonFile {
145108
font-size: small;
146109
}
@@ -179,6 +142,12 @@
179142
color: #495057;
180143
margin-right: 5px;
181144
border-radius: 5px;
145+
transition: all 0.2s ease-in-out;
146+
}
147+
148+
.expandLessons:hover {
149+
background-color: #e2e2e2 !important;
150+
color: #212529;
182151
}
183152

184153
.validationError {
@@ -194,24 +163,85 @@
194163
color: #a00;
195164
}
196165

197-
@media (max-width: 768px) {
166+
/* ================= DARK MODE (AFTER BASE) ================= */
167+
168+
.darkCard {
169+
background-color: #1e1e1e !important;
170+
color: #f5f5f5 !important;
171+
border-color: #333 !important;
172+
}
173+
174+
.darkCard .lessonCardHeader {
175+
background-color: #2a2a2a !important;
176+
color: #fff !important;
177+
border-bottom: 1px solid #333 !important;
178+
}
179+
180+
.darkCard .scrollableCardBody {
181+
background-color: #1e1e1e !important;
182+
color: #e6e6e6 !important;
183+
}
184+
185+
.darkCard span,
186+
.darkCard p,
187+
.darkCard div {
188+
color: #e6e6e6 !important;
189+
}
190+
191+
.darkCard .tagItem {
192+
color: #bfbfbf !important;
193+
}
194+
195+
.darkCard .lessonCardFooter {
196+
background-color: #2a2a2a !important;
197+
color: #ccc !important;
198+
border-top: 1px solid #333 !important;
199+
}
200+
201+
.darkCard textarea.editable-lesson-summary {
202+
background-color: #2a2a2a !important;
203+
color: #fff !important;
204+
border: 1px solid #555 !important;
205+
}
206+
207+
.darkExpandLessons {
208+
background-color: #2c3e50 !important;
209+
color: #e9ecef !important;
210+
border: 1px solid #495057 !important;
211+
}
212+
213+
.darkExpandLessons:hover {
214+
background-color: #34495e !important;
215+
color: #f8f9fa !important;
216+
}
217+
218+
/* ================= RESPONSIVE ================= */
219+
220+
@media (width <= 768px) {
198221
.lessonCardFooter {
199222
flex-direction: column;
200223
align-items: flex-start;
201224
}
202225

203226
.lessonCardNav {
204227
height: auto;
205-
display: flex;
206-
flex-direction: column;
207228
}
208229

209230
.lessonCardFooterItems {
210231
justify-content: flex-start;
211232
}
233+
234+
.lessonFooter {
235+
flex-direction: column;
236+
align-items: flex-start;
237+
}
238+
239+
.footerItemsActions {
240+
justify-content: flex-start;
241+
}
212242
}
213243

214-
@media (max-width: 570px) {
244+
@media (width <= 570px) {
215245
.formSelectContainer {
216246
flex-direction: column;
217247
}
@@ -221,21 +251,21 @@
221251
}
222252
}
223253

224-
@media (max-width: 767px) {
254+
@media (width <= 767px) {
225255
.cardText {
226256
padding: 10px;
227257
font-size: small;
228258
}
229259
}
230260

231-
@media (max-width: 859px) {
261+
@media (width <= 859px) {
232262
.navTitleAndDate {
233263
flex-direction: column;
234264
align-items: flex-start;
235265
}
236266
}
237267

238-
@media only screen and (max-width: 600px) {
268+
@media (width <= 600px) {
239269
.nav {
240270
height: auto;
241271
}
@@ -244,15 +274,4 @@
244274
display: block;
245275
margin-top: 5px;
246276
}
247-
}
248-
249-
@media (max-width: 768px) {
250-
.lessonFooter {
251-
flex-direction: column;
252-
align-items: flex-start;
253-
}
254-
255-
.footerItemsActions {
256-
justify-content: flex-start;
257-
}
258-
}
277+
}

0 commit comments

Comments
 (0)