Skip to content

Commit 0cbebd3

Browse files
Merge pull request #4793 from OneCommunityGlobal/Akshith-Add-Activity-list-icons
Akshith - Added icons to the event details in activity list
2 parents 65ffbf9 + dc5511b commit 0cbebd3

2 files changed

Lines changed: 108 additions & 7 deletions

File tree

src/components/CommunityPortal/Activities/ActivityList.jsx

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,15 @@ import { useState, useEffect, useMemo } from 'react';
33
import { useSelector } from 'react-redux';
44
import { Modal, ModalHeader, ModalBody, ModalFooter, Button } from 'reactstrap';
55
import styles from './ActivityList.module.css';
6-
// import { useHistory } from 'react-router-dom';
6+
import {
7+
FaTag,
8+
FaCalendarAlt,
9+
FaMapMarkerAlt,
10+
FaDumbbell,
11+
FaUsers,
12+
FaGraduationCap,
13+
FaPalette,
14+
} from 'react-icons/fa';
715
import { fuzzySearch } from '../../../utils/fuzzySearch';
816
import { mockActivities } from './mockActivities';
917

@@ -126,6 +134,21 @@ function ActivityList() {
126134
setModalOpen(false);
127135
};
128136

137+
const getTypeIcon = type => {
138+
switch (type) {
139+
case 'Fitness':
140+
return <FaDumbbell className={styles.activityIcon} />;
141+
case 'Social':
142+
return <FaUsers className={styles.activityIcon} />;
143+
case 'Educational':
144+
return <FaGraduationCap className={styles.activityIcon} />;
145+
case 'Art':
146+
return <FaPalette className={styles.activityIcon} />;
147+
default:
148+
return <FaTag className={styles.activityIcon} />;
149+
}
150+
};
151+
129152
const startOfToday = useMemo(() => {
130153
const d = new Date();
131154
d.setHours(0, 0, 0, 0);
@@ -308,9 +331,25 @@ function ActivityList() {
308331
>
309332
<li className={`${styles.activityItem} ${darkMode ? styles.darkModeItem : ''}`}>
310333
<strong>{activity.name}</strong>
311-
<span>
312-
{activity.type}{activity.date}{activity.location}
313-
</span>
334+
335+
{/* Type */}
336+
<div className={styles.altypeRow}>
337+
{getTypeIcon(activity.type)}
338+
<span className={styles.altypeText}>{activity.type}</span>
339+
</div>
340+
341+
{/* Location + Date */}
342+
<div className={styles.allocationDateRow}>
343+
<div className={styles.allocation}>
344+
<FaMapMarkerAlt className={styles.alactivityIcon} />
345+
<span>{activity.location}</span>
346+
</div>
347+
348+
<div className={styles.aldate}>
349+
<FaCalendarAlt className={styles.alactivityIcon} />
350+
<span>{activity.date}</span>
351+
</div>
352+
</div>
314353
</li>
315354
</div>
316355
))}

src/components/CommunityPortal/Activities/ActivityList.module.css

Lines changed: 65 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
color-scheme: dark;
103103
}
104104

105-
.darkModeInput[type="date"]::-webkit-calendar-picker-indicator {
105+
.darkModeInput[type='date']::-webkit-calendar-picker-indicator {
106106
filter: invert(1);
107107
cursor: pointer;
108108
}
@@ -211,7 +211,9 @@
211211
border: 1px solid #e5e7eb;
212212
border-radius: 8px;
213213
background-color: #f9fafb;
214-
transition: transform 0.2s ease, box-shadow 0.2s ease;
214+
transition:
215+
transform 0.2s ease,
216+
box-shadow 0.2s ease;
215217
}
216218

217219
.activityItem:hover {
@@ -282,7 +284,10 @@
282284
font-size: 1rem;
283285
font-weight: 500;
284286
cursor: pointer;
285-
transition: transform 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
287+
transition:
288+
transform 0.2s ease,
289+
background-color 0.2s ease,
290+
opacity 0.2s ease;
286291
}
287292

288293
.clearFiltersButton:disabled {
@@ -445,4 +450,61 @@
445450
flex-direction: column;
446451
padding: 10px;
447452
}
453+
}
454+
455+
/* Activity Icons */
456+
.alactivityIcon {
457+
color: #2c3e50;
458+
margin-top: 2px;
459+
margin-right: 4px;
460+
flex-shrink: 0;
461+
font-size: 1rem;
462+
}
463+
464+
.activityRow {
465+
display: flex;
466+
justify-content: space-between;
467+
align-items: center;
468+
gap: 16px;
469+
}
470+
471+
.leftInfo {
472+
display: flex;
473+
align-items: center;
474+
gap: 16px;
475+
flex-wrap: wrap;
476+
}
477+
478+
.rightInfo {
479+
display: flex;
480+
align-items: center;
481+
gap: 6px;
482+
white-space: nowrap;
483+
}
484+
485+
.altypeRow {
486+
display: flex;
487+
align-items: center;
488+
gap: 8px;
489+
margin-top: 4px;
490+
}
491+
492+
.altypeText {
493+
margin-top: 4px;
494+
color: #6b7280;
495+
font-style: italic;
496+
}
497+
498+
.allocationDateRow {
499+
display: flex;
500+
justify-content: space-between;
501+
align-items: center;
502+
margin-top: 10px;
503+
}
504+
505+
.allocation,
506+
.aldate {
507+
display: flex;
508+
align-items: center;
509+
gap: 6px;
448510
}

0 commit comments

Comments
 (0)