Skip to content

Commit ebade00

Browse files
Merge pull request #3275 from OneCommunityGlobal/jaissica-create-button-prototype-for-summary-dashboard
Jaissica-added buttons in summary dashboard
2 parents a62c099 + 0a9f7ad commit ebade00

2 files changed

Lines changed: 204 additions & 4 deletions

File tree

src/components/BMDashboard/WeeklyProjectSummary/WeeklyProjectSummary.css

Lines changed: 86 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,4 +297,89 @@
297297
.weekly-project-summary-dashboard-grid {
298298
grid-template-columns: 1fr;
299299
}
300-
}
300+
}
301+
302+
/* ---------------- STATUS CARD ---------------- */
303+
.status-card {
304+
display: flex;
305+
flex-direction: column;
306+
align-items: center;
307+
justify-content: center;
308+
border-radius: 25px;
309+
width: 100%;
310+
max-width: 284px;
311+
height: 190px;
312+
text-align: center;
313+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
314+
padding: 20px;
315+
border: 1px solid rgba(0, 0, 0, 0.1);
316+
position: relative;
317+
}
318+
319+
/* ---------------- RESPONSIVE GRID LAYOUT ---------------- */
320+
.project-status-grid {
321+
display: grid;
322+
grid-template-columns: repeat(5, 1fr);
323+
gap: 20px;
324+
justify-content: center;
325+
align-items: center;
326+
width: 100%;
327+
max-width: 1600px;
328+
margin: auto;
329+
}
330+
331+
/* ---------------- OVAL STATUS BUTTON ---------------- */
332+
.weekly-status-button {
333+
width: 130px;
334+
height: 65px;
335+
border-radius: 50px / 32px;
336+
display: flex;
337+
align-items: center;
338+
justify-content: center;
339+
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
340+
margin: 12px 0;
341+
}
342+
343+
.weekly-card-title {
344+
color: #000;
345+
font-size: 24px;
346+
font-weight: 600;
347+
}
348+
349+
.weekly-status-value {
350+
color: #000;
351+
font-size: 40px;
352+
font-weight: 600;
353+
}
354+
355+
356+
/* ---------------- RESPONSIVE BREAKPOINTS ---------------- */
357+
@media (min-width: 1600px) {
358+
.project-status-grid {
359+
grid-template-columns: repeat(6, 1fr);
360+
}
361+
}
362+
363+
@media (max-width: 1400px) {
364+
.project-status-grid {
365+
grid-template-columns: repeat(4, 1fr);
366+
}
367+
}
368+
369+
@media (max-width: 1024px) {
370+
.project-status-grid {
371+
grid-template-columns: repeat(3, 1fr);
372+
}
373+
}
374+
375+
@media (max-width: 768px) {
376+
.project-status-grid {
377+
grid-template-columns: repeat(2, 1fr);
378+
}
379+
}
380+
381+
@media (max-width: 576px) {
382+
.project-status-grid {
383+
grid-template-columns: repeat(1, 1fr);
384+
}
385+
}

src/components/BMDashboard/WeeklyProjectSummary/WeeklyProjectSummary.jsx

Lines changed: 118 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,105 @@ import { useSelector } from 'react-redux';
44
import { v4 as uuidv4 } from 'uuid';
55
import WeeklyProjectSummaryHeader from './WeeklyProjectSummaryHeader';
66

7+
const projectStatusButtons = [
8+
{
9+
title: 'Total Projects',
10+
value: 426,
11+
change: '+16% week over week',
12+
bgColor: '#F0FFEE',
13+
buttonColor: '#BAF0B6',
14+
textColor: '#328D1B',
15+
},
16+
{
17+
title: 'Completed Projects',
18+
value: 127,
19+
change: '+14% week over week',
20+
bgColor: '#F3FCFF',
21+
buttonColor: '#C1EFFB',
22+
textColor: '#328D1B',
23+
},
24+
{
25+
title: 'Delayed Projects',
26+
value: 34,
27+
change: '-18% week over week',
28+
bgColor: '#FFE9FA',
29+
buttonColor: '#FECFF3',
30+
textColor: '#C82F2F',
31+
},
32+
{
33+
title: 'Active Projects',
34+
value: 265,
35+
change: '+3% week over week',
36+
bgColor: '#E8E8FF',
37+
buttonColor: '#CBCBFE',
38+
textColor: '#328D1B',
39+
},
40+
{
41+
title: 'Avg Project Duration',
42+
value: '17 hrs',
43+
change: '+13% week over week',
44+
bgColor: '#FFF6EE',
45+
buttonColor: '#FFD8A5',
46+
textColor: '#FFD8A5',
47+
},
48+
{
49+
title: 'Total Material Cost',
50+
value: '$27.6K',
51+
change: '+9% week over week',
52+
bgColor: '#FFF3F3',
53+
buttonColor: '#FBC1C2',
54+
textColor: '#328D1B',
55+
},
56+
{
57+
title: 'Total Material Used',
58+
value: '2714',
59+
change: '+11% week over week',
60+
bgColor: '#DAC8FF',
61+
buttonColor: '#B28ECC',
62+
textColor: '#328D1B',
63+
},
64+
{
65+
title: 'Active Projects',
66+
value: '265',
67+
change: '+3% week over week',
68+
bgColor: '#E8E8FF',
69+
buttonColor: '#CBCBFE',
70+
textColor: '#328D1B',
71+
},
72+
{
73+
title: 'Total Labor Hours Invested',
74+
value: '12.8K',
75+
change: '+17% week over week',
76+
bgColor: '#E5C1FC',
77+
buttonColor: '#F6E1FB',
78+
textColor: '#328D1B',
79+
},
80+
{
81+
title: 'Total Labor Cost',
82+
value: '$18.4K',
83+
change: '+14% week over week',
84+
bgColor: '#FFFDF3',
85+
buttonColor: '#FBF9C1',
86+
textColor: '#328D1B',
87+
},
88+
{
89+
title: 'Material Available',
90+
value: 693,
91+
change: '-8% week over week',
92+
bgColor: '#B4D9C5',
93+
buttonColor: '#31BD41',
94+
textColor: '#C82F2F',
95+
},
96+
{
97+
title: 'Material Wasted',
98+
value: 879,
99+
change: '+14% week over week',
100+
bgColor: '#EFBABB',
101+
buttonColor: '#F79395',
102+
textColor: '#328D1B',
103+
},
104+
];
105+
7106
export default function WeeklyProjectSummary() {
8107
const [openSections, setOpenSections] = useState({});
9108

@@ -23,11 +122,27 @@ export default function WeeklyProjectSummary() {
23122
className: 'full',
24123
content: (
25124
<div className="project-status-grid">
26-
{Array.from({ length: 12 }).map(() => {
125+
{projectStatusButtons.map(button => {
27126
const uniqueId = uuidv4();
28127
return (
29-
<div key={uniqueId} className="weekly-project-summary-card small-card">
30-
📊 Card
128+
<div
129+
key={uniqueId}
130+
className="weekly-project-summary-card status-card"
131+
style={{ backgroundColor: button.bgColor }} // Dynamic Background
132+
>
133+
<div className="weekly-card-title">{button.title}</div>
134+
<div
135+
className="weekly-status-button"
136+
style={{ backgroundColor: button.buttonColor }} // Dynamic Oval Color
137+
>
138+
<span className="weekly-status-value">{button.value}</span>
139+
</div>
140+
<div
141+
className="weekly-status-change"
142+
style={{ color: button.textColor }} // Dynamic Change Color
143+
>
144+
{button.change}
145+
</div>
31146
</div>
32147
);
33148
})}

0 commit comments

Comments
 (0)