Skip to content

Commit 88f40f4

Browse files
Merge pull request #5123 from OneCommunityGlobal/Neeraj_Hotfix_HiringAnalytics_Chart
Neeraj Fix Chart Rendering Issue and Dark Mode Legend
2 parents 7e56c35 + 0fe1ea1 commit 88f40f4

1 file changed

Lines changed: 62 additions & 7 deletions

File tree

src/components/ApplicantVolunteerRatio/ApplicantVolunteerRatio.jsx

Lines changed: 62 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,15 @@ function ApplicantVolunteerRatio() {
4949

5050
if (validationError) setValidationError('');
5151

52-
if (selectedRoles.length === 0) {
53-
setData([]);
54-
return;
55-
}
5652
try {
5753
setLoading(true);
5854
const filters = {};
5955
if (startDate) filters.startDate = startDate.toISOString().split('T')[0];
6056
if (endDate) filters.endDate = endDate.toISOString().split('T')[0];
6157
if (selectedRoles.length > 0) {
6258
filters.roles = selectedRoles.map(role => role.value).join(',');
59+
} else {
60+
filters.roles = ''; // fetch all roles
6361
}
6462

6563
const response = await getAllApplicantVolunteerRatios(filters);
@@ -112,6 +110,8 @@ function ApplicantVolunteerRatio() {
112110
};
113111
}, [darkMode]);
114112

113+
const legendTextColor = darkMode ? '#e0e0e0' : '#333';
114+
115115
if (loading) {
116116
return (
117117
<div className={`${styles.page} ${darkMode ? styles.dark : ''}`}>
@@ -280,11 +280,66 @@ function ApplicantVolunteerRatio() {
280280
>
281281
{viewMode === 'count' ? (
282282
<>
283-
<span style={{ color: '#1976d2' }}>■ Total Applications</span>
284-
<span style={{ color: '#43a047' }}>■ People Hired</span>
283+
<span
284+
style={{
285+
color: legendTextColor,
286+
display: 'flex',
287+
alignItems: 'center',
288+
gap: '6px',
289+
}}
290+
>
291+
<span
292+
style={{
293+
width: '12px',
294+
height: '12px',
295+
backgroundColor: '#1976d2',
296+
display: 'inline-block',
297+
borderRadius: '2px',
298+
}}
299+
/>
300+
Total Applications
301+
</span>
302+
303+
<span
304+
style={{
305+
color: legendTextColor,
306+
display: 'flex',
307+
alignItems: 'center',
308+
gap: '6px',
309+
}}
310+
>
311+
<span
312+
style={{
313+
width: '12px',
314+
height: '12px',
315+
backgroundColor: '#43a047',
316+
display: 'inline-block',
317+
borderRadius: '2px',
318+
}}
319+
/>
320+
People Hired
321+
</span>
285322
</>
286323
) : (
287-
<span style={{ color: '#43a047' }}>■ People Hired (%)</span>
324+
<span
325+
style={{
326+
color: legendTextColor,
327+
display: 'flex',
328+
alignItems: 'center',
329+
gap: '6px',
330+
}}
331+
>
332+
<span
333+
style={{
334+
width: '12px',
335+
height: '12px',
336+
backgroundColor: '#43a047',
337+
display: 'inline-block',
338+
borderRadius: '2px',
339+
}}
340+
/>
341+
People Hired (%)
342+
</span>
288343
)}
289344
</div>
290345

0 commit comments

Comments
 (0)