Skip to content

Commit 53df810

Browse files
Merge pull request #4666 from OneCommunityGlobal/vinay_dark_mode
Vinay K Dark Mode in Total Construction Summary
2 parents 6aecb34 + c8a5190 commit 53df810

2 files changed

Lines changed: 33 additions & 33 deletions

File tree

src/components/BMDashboard/WeeklyProjectSummary/WeeklyProjectSummary.jsx

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// export default WeeklyProjectSummary;
2+
13
/* eslint-disable import/no-unresolved */
24
import { useState, useEffect, useMemo, useRef } from 'react';
35
import { useDispatch, useSelector } from 'react-redux';
@@ -161,7 +163,6 @@ export function WeeklyProjectSummaryContent() {
161163
: `${monthOverMonth > 0 ? '+' : ''}${monthOverMonth}% month over month`}
162164
</div>
163165

164-
{/* Tooltip for Additional Info */}
165166
{showTooltip && Object.keys(additionalInfo).length > 0 && (
166167
<div className="financial-card-tooltip">
167168
{Object.entries(additionalInfo).map(([key]) => (
@@ -185,6 +186,7 @@ function WeeklyProjectSummary() {
185186
const projectFilter = useSelector(state => state.weeklyProjectSummary?.projectFilter || '');
186187
const dateRangeFilter = useSelector(state => state.weeklyProjectSummary?.dateRangeFilter || '');
187188
const containerRef = useRef(null);
189+
188190
useEffect(() => {
189191
if (materials.length === 0) {
190192
dispatch(fetchAllMaterials());
@@ -224,19 +226,16 @@ function WeeklyProjectSummary() {
224226
<div
225227
key={uniqueId}
226228
className={`${styles.weeklyProjectSummaryCard} ${styles.statusCard}`}
227-
style={{ backgroundColor: button.bgColor }} // Dynamic Background
229+
style={{ backgroundColor: button.bgColor }}
228230
>
229231
<div className={`${styles.weeklyCardTitle}`}>{button.title}</div>
230232
<div
231233
className={`${styles.weeklyStatusButton}`}
232-
style={{ backgroundColor: button.buttonColor }} // Dynamic Oval Color
234+
style={{ backgroundColor: button.buttonColor }}
233235
>
234236
<span className={`${styles.weeklyStatusValue}`}>{button.value}</span>
235237
</div>
236-
<div
237-
className="weekly-status-change"
238-
style={{ color: button.textColor }} // Dynamic Change Color
239-
>
238+
<div className="weekly-status-change" style={{ color: button.textColor }}>
240239
{button.change}
241240
</div>
242241
</div>
@@ -245,7 +244,6 @@ function WeeklyProjectSummary() {
245244
</div>
246245
),
247246
},
248-
// New Issues Breakdown card
249247
{
250248
title: 'Issues Breakdown',
251249
key: 'Issues Breakdown',
@@ -463,7 +461,6 @@ function WeeklyProjectSummary() {
463461
// Clone the content
464462
const clonedContent = contentElement.cloneNode(true);
465463

466-
// Remove buttons and controls not needed in PDF
467464
clonedContent
468465
.querySelectorAll(
469466
'button, .weekly-project-summary-dropdown-icon, .no-print, .weekly-summary-header-controls',
@@ -538,7 +535,6 @@ function WeeklyProjectSummary() {
538535
: dateStr;
539536
const fileName = `weekly-project-summary-${projectName}-${dateRange}.pdf`;
540537

541-
// Save the PDF
542538
pdf.save(fileName);
543539

544540
// Clean up
@@ -583,7 +579,9 @@ function WeeklyProjectSummary() {
583579
return (
584580
<div
585581
ref={containerRef}
586-
className={`${styles.weeklyProjectSummaryContainer} ${darkMode ? styles.darkMode : ''}`}
582+
className={`weekly-project-summary-container ${styles.weeklyProjectSummaryContainer} ${
583+
darkMode ? styles.darkMode : ''
584+
}`}
587585
data-testid="weekly-project-summary-container"
588586
>
589587
<WeeklyProjectSummaryHeader

src/components/BMDashboard/WeeklyProjectSummary/WeeklyProjectSummary.module.css

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
padding: 0;
1313
}
1414

15+
/* ---------------- DASHBOARD CONTAINER ---------------- */
1516
.weeklyProjectSummaryDashboardContainer {
1617
width: 95%;
1718
margin: auto;
@@ -154,7 +155,7 @@
154155
display: inline-block;
155156
width: 14px;
156157
height: 14px;
157-
border: 2px solid rgba(255, 255, 255, 0.3);
158+
border: 2px solid rgb(255 255 255 / 30%);
158159
border-radius: 50%;
159160
border-top-color: white;
160161
animation: spin 0.8s linear infinite;
@@ -168,8 +169,7 @@
168169
}
169170
}
170171

171-
/* ---------------- DASHBOARD ---------------- */
172-
172+
/* ---------------- GRID ---------------- */
173173
.weeklyProjectSummaryDashboardGrid {
174174
display: grid;
175175
grid-template-columns: repeat(4, 1fr);
@@ -215,7 +215,6 @@
215215
grid-column: span 1;
216216
}
217217

218-
219218
.weekly-project-summary-card.financial-big {
220219
grid-column: span 4;
221220
min-height: 600px;
@@ -233,7 +232,6 @@
233232
margin: 0;
234233
font-weight: normal;
235234
font-size: 24px;
236-
237235
}
238236

239237
.fullCard {
@@ -266,6 +264,7 @@
266264
grid-column: span 4;
267265
}
268266

267+
/* ---------------- SECTION ---------------- */
269268
.weeklyProjectSummaryDashboardSection {
270269
background: var(--section-bg);
271270
border-radius: 8px;
@@ -336,15 +335,24 @@
336335
--focus-border-color: #e8a71c;
337336
}
338337

338+
/* MERGED: keep background + FORCE all title text visible in dark mode */
339339
.darkMode .weeklyProjectSummaryDashboardCategoryTitle {
340-
color: #ffffff;
341340
background: #2d4059;
341+
color: #ffffff;
342342
}
343343

344344
.darkMode .weeklyProjectSummaryDashboardCategoryTitle:hover {
345345
background: #3a506b;
346346
}
347347

348+
.darkMode .weeklyProjectSummaryDashboardCategoryTitle span {
349+
color: #ffffff;
350+
}
351+
352+
.darkMode .weeklyProjectSummaryDashboardCategoryTitle * {
353+
color: #ffffff;
354+
}
355+
348356
.darkMode .weeklyProjectSummaryDashboardCategoryContent {
349357
background-color: var(--section-bg);
350358
border-top: 1px solid rgba(255, 255, 255, 0.2);
@@ -355,17 +363,18 @@
355363
color: var(--text-color);
356364
}
357365

358-
/* First, set a max-height and make it scrollable */
366+
/* ---------------- TOOLTIP SCROLL FIX ---------------- */
359367
.quantityOfMaterialsUsedChartTooltip {
360-
max-height: 80vh !important; /* Limit to 80% of viewport height */
361-
overflow-y: auto !important; /* Enable vertical scrolling */
362-
padding-right: 15px !important; /* Add some padding for the scrollbar */
363-
/* Support for Firefox */
368+
max-height: 80vh !important;
369+
overflow-y: auto !important;
370+
padding-right: 15px !important;
371+
372+
/* Firefox */
364373
scrollbar-width: thin;
365374
scrollbar-color: rgba(0, 0, 0, 0.3) rgba(0, 0, 0, 0.1);
366375
}
367376

368-
/* Style the scrollbar for better visibility - Webkit browsers */
377+
/* Chrome/Safari scrollbar */
369378
.quantityOfMaterialsUsedChartTooltip::-webkit-scrollbar {
370379
width: 8px;
371380
}
@@ -392,9 +401,8 @@
392401
.darkMode .quantityOfMaterialsUsedChartTooltip {
393402
scrollbar-color: rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.1);
394403
}
395-
/* ---------------- RESPONSIVE DESIGN ---------------- */
396404

397-
/* Medium Screens - Wrap Items */
405+
/* ---------------- RESPONSIVE DESIGN ---------------- */
398406
@media (max-width: 1024px) {
399407
.weeklySummaryHeaderContainer {
400408
flex-direction: column;
@@ -413,7 +421,6 @@
413421
}
414422
}
415423

416-
/* Small Screens - Make Dropdowns Vertical */
417424
@media (max-width: 768px) {
418425
.weeklySummaryHeaderContainer {
419426
flex-direction: column;
@@ -426,7 +433,6 @@
426433
width: 100%;
427434
}
428435

429-
/* Make Dropdowns Full Width */
430436
.weeklySummaryHeaderControls select {
431437
width: 100%;
432438
max-width: none;
@@ -436,7 +442,6 @@
436442
max-width: none;
437443
}
438444

439-
/* Make Button Full Width */
440445
.weeklySummaryShareBtn {
441446
width: 100%;
442447
}
@@ -451,10 +456,6 @@
451456
.weeklyProjectSummaryDashboardSection.small {
452457
grid-column: span 1;
453458
}
454-
455-
.projectStatusGrid {
456-
grid-template-columns: 1fr;
457-
}
458459
}
459460

460461
/* ---------------- STATUS CARD ---------------- */
@@ -475,6 +476,7 @@
475476
}
476477

477478
/* ---------------- RESPONSIVE GRID LAYOUT ---------------- */
479+
/* MERGED: keep ONLY one projectStatusGrid */
478480
.projectStatusGrid {
479481
display: grid;
480482
grid-template-columns: repeat(5, 1fr);
@@ -545,4 +547,4 @@
545547
.projectStatusGrid {
546548
grid-template-columns: repeat(1, 1fr);
547549
}
548-
}
550+
}

0 commit comments

Comments
 (0)