Skip to content

Commit c9bfc1d

Browse files
Merge pull request #4796 from OneCommunityGlobal/feature/skills-dashboard-theme-fixes
Namitha: Fix theme colors and responsive layout for HGN Skills Dashboard
2 parents 6eded8d + 55ce550 commit c9bfc1d

9 files changed

Lines changed: 103 additions & 177 deletions

File tree

src/components/HGNSkillsDashboard/SkillsProfilePage/components/RadarChart.jsx

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
Legend,
1111
} from 'chart.js';
1212
import { useState, useEffect } from 'react';
13+
import PropTypes from 'prop-types';
1314
import styles from '../styles/RadarChart.module.css';
1415

1516
ChartJS.register(RadialLinearScale, PointElement, LineElement, Filler, Tooltip, Legend);
@@ -224,24 +225,21 @@ function RadarChart({ profileData, compact = true }) {
224225
);
225226
}
226227

228+
const { general = {}, frontend = {}, backend = {} } = profileData?.skillInfo || {};
229+
227230
const chartData = {
228231
labels: skillsData.map(skill => (compact ? skill.shortLabel || skill.label : skill.label)),
229232
datasets: [
230233
{
231234
label: 'Skills',
232-
data: skillsData.map(skill => skill.score),
233-
backgroundColor: compact ? 'rgba(133, 146, 226, 0.35)' : 'rgba(62, 160, 203, 0.2)',
234-
borderColor: compact ? 'rgba(110, 125, 215, 0.9)' : 'rgba(62, 160, 203, 1)',
235-
borderWidth: compact ? 2 : 3,
236-
pointBackgroundColor: compact ? 'rgba(110, 125, 215, 0.95)' : 'rgba(62, 160, 203, 1)',
237-
pointBorderColor: '#fff',
238-
pointHoverBackgroundColor: '#fff',
239-
pointHoverBorderColor: compact ? 'rgba(110,125,215,1)' : 'rgba(62,160,203,1)',
240-
pointRadius: compact ? 4 : 6,
241-
pointHoverRadius: compact ? 6 : 8,
242-
pointBorderWidth: 1.5,
243-
pointHoverBorderWidth: 2,
244-
fill: true,
235+
data: SKILL_MAPPINGS.map(skill => skill.value(general, frontend, backend) ?? 0),
236+
backgroundColor: 'rgba(37, 99, 235, 0.16)',
237+
borderColor: '#2563eb',
238+
borderWidth: 2,
239+
pointBackgroundColor: '#1d4ed8',
240+
pointBorderColor: '#eff6ff',
241+
pointHoverBackgroundColor: '#eff6ff',
242+
pointHoverBorderColor: '#1d4ed8',
245243
},
246244
],
247245
};
@@ -295,11 +293,7 @@ function RadarChart({ profileData, compact = true }) {
295293
suggestedMax: 10,
296294
ticks: {
297295
stepSize: 2,
298-
display: compact ? false : true,
299-
color: '#666',
300-
font: {
301-
size: 10,
302-
},
296+
display: false,
303297
},
304298
},
305299
},
@@ -338,6 +332,9 @@ function RadarChart({ profileData, compact = true }) {
338332
return tooltipItem.parsed.r > 0;
339333
},
340334
},
335+
datalabels: {
336+
display: false,
337+
},
341338
},
342339
interaction: {
343340
intersect: false,
@@ -356,4 +353,15 @@ function RadarChart({ profileData, compact = true }) {
356353
);
357354
}
358355

356+
RadarChart.propTypes = {
357+
profileData: PropTypes.shape({
358+
skillInfo: PropTypes.shape({
359+
general: PropTypes.object,
360+
frontend: PropTypes.object,
361+
backend: PropTypes.object,
362+
}),
363+
}),
364+
compact: PropTypes.bool,
365+
};
366+
359367
export default RadarChart;

src/components/HGNSkillsDashboard/SkillsProfilePage/styles/LeftSection.module.css

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
.leftSection {
2-
padding: 8px 8px 24px 8px;
3-
text-align: center;
4-
display: flex;
5-
flex-direction: column;
6-
align-items: center;
7-
justify-content: flex-start;
8-
background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
9-
border: 1px solid #e5e7eb;
10-
border-radius: 8px;
1+
.leftSection h1 {
2+
margin: 5px 0;
3+
color: #111827;
4+
}
5+
6+
.leftSection h3 {
7+
margin: 0;
8+
font-size: 20px;
9+
color: #1f2933;
1110
}
1211

1312
.profilePic {
@@ -18,18 +17,7 @@
1817
margin-bottom: 15px;
1918
}
2019

21-
.leftSection h1 {
22-
margin: 5px 0;
23-
color: #333;
24-
}
25-
26-
.leftSection h3 {
27-
margin: 0;
28-
font-size: 20px;
29-
color: #666;
30-
}
31-
32-
@media (max-width: 768px) {
20+
@media (max-width: 1100px) {
3321
.leftSection {
3422
width: 100%;
3523
padding: 16px 0 12px;

src/components/HGNSkillsDashboard/SkillsProfilePage/styles/ProfileDetails.module.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
flex-wrap: wrap;
2828
gap: 15px;
2929
font-size: 16px;
30-
color: #333;
30+
color: #1f2933;
3131
margin-bottom: 10px;
3232
}
3333

@@ -38,7 +38,7 @@
3838

3939
.teamInfo strong,
4040
.contactsInfo strong {
41-
color: #869aa3;
41+
color: #0f2f4a;
4242
}
4343

4444
.teamInfo .value,
@@ -47,7 +47,7 @@
4747
}
4848

4949
.value {
50-
color: #666;
50+
color: #111827;
5151
display: inline-block;
5252
font-family: 'Arial', sans-serif;
5353
}

src/components/HGNSkillsDashboard/SkillsProfilePage/styles/RadarChart.module.css

Lines changed: 24 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,27 @@
44
flex-direction: column;
55
justify-content: center;
66
align-items: center;
7-
padding: 20px;
8-
background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
9-
border-radius: 12px;
10-
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
11-
border: 1px solid rgba(62, 160, 203, 0.1);
12-
min-height: 500px;
13-
position: relative;
7+
padding: 10px 0;
8+
margin: 0 auto;
9+
max-width: 720px;
10+
width: 100%;
1411
}
1512

16-
.radarChart.compact {
17-
padding: 0;
18-
background: transparent;
19-
box-shadow: none;
20-
border: none;
21-
min-height: auto;
22-
align-items: stretch;
13+
.radarChart canvas {
14+
width: 100% !important;
15+
height: auto !important;
16+
max-width: 720px;
17+
max-height: 640px;
18+
}
19+
20+
@media (max-width: 1100px) {
21+
.radarChart {
22+
padding: 12px 0;
23+
}
24+
25+
.radarChart canvas {
26+
max-height: 540px;
27+
}
2328
}
2429

2530
.chartTitle {
@@ -125,87 +130,17 @@
125130
/* Responsive breakpoints */
126131
@media (max-width: 768px) {
127132
.radarChart {
128-
padding: 15px;
129-
min-height: 450px;
133+
padding: 10px 0;
130134
}
131135

132-
.chartTitle h4 {
133-
font-size: 20px;
134-
}
135-
136-
.chartTitle p {
137-
font-size: 13px;
138-
}
139-
140-
.chartContainer {
141-
max-width: clamp(280px, 58vw, 500px);
142-
}
143-
144-
.legendItem {
145-
font-size: 13px;
136+
.radarChart canvas {
137+
max-height: 460px;
146138
}
147139
}
148140

149141
@media (max-width: 480px) {
150-
.radarChart {
151-
padding: 10px;
152-
min-height: 400px;
153-
}
154-
155-
.chartTitle h4 {
156-
font-size: 18px;
157-
}
158-
159-
.chartTitle p {
160-
font-size: 12px;
161-
}
162-
163-
.chartContainer {
164-
max-width: clamp(240px, 78vw, 420px);
165-
}
166-
167-
.chartLegend {
168-
flex-direction: column;
169-
gap: 10px;
170-
margin-top: 15px;
171-
}
172-
173-
.legendItem {
174-
font-size: 12px;
175-
}
176-
177-
.legendColor {
178-
width: 16px;
179-
height: 16px;
180-
}
181-
}
182-
183-
/* High DPI displays */
184-
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
185-
.chartContainer canvas {
186-
image-rendering: -webkit-optimize-contrast;
187-
image-rendering: crisp-edges;
188-
}
189-
}
190-
191-
/* Dark theme support (optional) */
192-
@media (prefers-color-scheme: dark) {
193-
.radarChart {
194-
background: linear-gradient(145deg, #2d3748 0%, #1a202c 100%);
195-
border-color: rgba(62, 160, 203, 0.3);
196-
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
197-
}
198-
199-
.chartTitle h4 {
200-
color: #63b3ed;
201-
}
202-
203-
.chartTitle p {
204-
color: #a0aec0;
205-
}
206-
207-
.legendItem {
208-
color: #e2e8f0;
142+
.radarChart canvas {
143+
max-height: 380px;
209144
}
210145
}
211146

src/components/HGNSkillsDashboard/SkillsProfilePage/styles/RightSection.module.css

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,15 @@
11
.rightSection {
2-
padding: 0 4px;
2+
width: 78%;
3+
padding: 0 20px;
34
display: flex;
45
flex-direction: column;
56
min-width: 0; /* allow children to shrink */
67
}
78

89
.skillsAndChart {
910
display: flex;
10-
gap: 18px;
11-
align-items: stretch;
12-
}
13-
14-
.skillsAndChart > *:first-child { /* Skills buttons */
15-
flex: 0 0 180px;
16-
}
17-
18-
.skillsAndChart > *:last-child { /* Chart / content */
19-
flex: 1 1 auto;
20-
min-width: 0;
11+
gap: 16px;
12+
align-items: flex-start;
2113
}
2214

2315
h3 {
@@ -26,10 +18,21 @@ h3 {
2618
margin-bottom: 10px;
2719
}
2820

29-
@media (max-width: 768px) {
21+
@media (max-width: 1100px) {
22+
.rightSection {
23+
width: 100%;
24+
padding: 0 10px;
25+
}
26+
3027
.skillsAndChart {
3128
flex-direction: column;
32-
gap: 24px;
29+
align-items: stretch;
30+
}
31+
}
32+
33+
@media (max-width: 768px) {
34+
.rightSection {
35+
padding: 0 0 10px;
3336
}
3437
.skillsAndChart > *:first-child { flex: 0 0 auto; }
3538
}

src/components/HGNSkillsDashboard/SkillsProfilePage/styles/Skills.module.css

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,19 @@
3333
color: #168dc0;
3434
}
3535

36-
@media (width <= 768px) {
36+
@media (max-width: 1100px) {
37+
.skills {
38+
width: 100%;
39+
align-items: center;
40+
}
41+
42+
.skills button {
43+
width: 100%;
44+
max-width: 460px;
45+
}
46+
}
47+
48+
@media (max-width: 768px) {
3749
.skills {
3850
width: 100%;
3951
flex-direction: column;

0 commit comments

Comments
 (0)