Skip to content

Commit 1092fee

Browse files
committed
fixed dark mode and mobile responsiveness for weekly project summary
1 parent 3021f4b commit 1092fee

File tree

3 files changed

+17
-22
lines changed

3 files changed

+17
-22
lines changed

src/components/BMDashboard/WeeklyProjectSummary/TotalMaterialCostPerProject/TotalMaterialCostPerProject.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,14 +214,14 @@ function TotalMaterialCostPerProject() {
214214
whiteSpace: 'nowrap',
215215
maxWidth: '100%',
216216
position: 'relative',
217-
scrollbarWidth: 'thin',
217+
scrollbarWidth: 'none',
218218
}),
219219
}),
220220
[darkMode],
221221
);
222222

223223
return (
224-
<div style={{ maxWidth: '300px', minWidth: '200px' }}>
224+
<div>
225225
<div className={styles.totalMaterialCostPerProjectChartTitle}>
226226
Total Material Cost Per Project
227227
</div>

src/components/BMDashboard/WeeklyProjectSummary/WeeklyProjectSummary.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ function WeeklyProjectSummary() {
247247
{
248248
title: 'Material Consumption',
249249
key: 'Material Consumption',
250-
className: 'large',
250+
className: 'full',
251251
content: [1, 2, 3].map((_, index) => {
252252
let content;
253253
if (index === 1) {
@@ -474,7 +474,7 @@ function WeeklyProjectSummary() {
474474
};
475475

476476
return (
477-
<div className={`weekly-project-summary-container ${darkMode ? 'dark-mode' : ''}`}>
477+
<div className={`${styles.weeklyProjectSummaryContainer} ${darkMode ? styles.darkMode : ''}`}>
478478
<WeeklyProjectSummaryHeader handleSaveAsPDF={handleSaveAsPDF} />
479479
<div className={`${styles.weeklyProjectSummaryDashboardContainer}`}>
480480
<div className={`${styles.weeklyProjectSummaryDashboardGrid}`}>

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

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

15-
.weeklyProjectSummaryDashboardContainer {
16-
width: 100%;
17-
background: var(--bg-color);
18-
}
1915

2016
.weeklyProjectSummaryHeaderWrapper {
2117
background-color: var(--bg-color) !important;
@@ -120,12 +116,6 @@
120116
}
121117

122118
/* ---------------- CARDS ---------------- */
123-
.projectStatusGrid {
124-
display: grid;
125-
grid-template-columns: repeat(6, 1fr);
126-
grid-template-rows: repeat(2, auto);
127-
gap: 10px;
128-
}
129119

130120
.weeklyProjectSummaryCard {
131121
background: var(--card-bg);
@@ -223,7 +213,7 @@
223213
.weeklyProjectSummaryDashboardCategoryContent {
224214
padding: 15px;
225215
display: grid;
226-
grid-template-columns: repeat(4, 1fr);
216+
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
227217
gap: 20px;
228218
border-top: 1px solid var(--card-shadow);
229219
animation: fadeIn 0.3s ease-in-out;
@@ -284,19 +274,22 @@
284274
color: var(--text-color);
285275
}
286276

287-
.weeklySummaryShareBtn {
277+
/* .weeklySummaryShareBtn {
288278
background-color: var(--button-bg) !important;
289279
}
290280
291281
.weeklySummaryShareBtn:hover {
292282
background-color: var(--button-hover) !important;
293-
}
283+
} */
294284

295285
/* First, set a max-height and make it scrollable */
296286
.quantityOfMaterialsUsedChartTooltip {
297287
max-height: 80vh !important; /* Limit to 80% of viewport height */
298288
overflow-y: auto !important; /* Enable vertical scrolling */
299289
padding-right: 15px !important; /* Add some padding for the scrollbar */
290+
/* Support for Firefox */
291+
scrollbar-width: thin;
292+
scrollbar-color: rgba(0, 0, 0, 0.3) rgba(0, 0, 0, 0.1);
300293
}
301294

302295
/* Style the scrollbar for better visibility */
@@ -314,11 +307,7 @@
314307
border-radius: 4px;
315308
}
316309

317-
/* Support for Firefox */
318-
.quantityOfMaterialsUsedChartTooltip {
319-
scrollbar-width: thin;
320-
scrollbar-color: rgba(0, 0, 0, 0.3) rgba(0, 0, 0, 0.1);
321-
}
310+
322311

323312
/* Additional adjustments for dark mode if needed */
324313
.darkMode .quantityOfMaterialsUsedChartTooltip::-webkit-scrollbar-track {
@@ -419,6 +408,12 @@
419408
max-width: 1600px;
420409
margin: auto;
421410
}
411+
/* .projectStatusGrid {
412+
display: grid;
413+
grid-template-columns: repeat(6, 1fr);
414+
grid-template-rows: repeat(2, auto);
415+
gap: 10px;
416+
} */
422417

423418
/* ---------------- OVAL STATUS BUTTON ---------------- */
424419
.weeklyStatusButton {

0 commit comments

Comments
 (0)