Skip to content

Commit 2b2c871

Browse files
committed
feat: added icons to the event details displayed in event modal
1 parent 4f30504 commit 2b2c871

2 files changed

Lines changed: 52 additions & 8 deletions

File tree

src/components/CommunityPortal/Calendar/CommunityCalendar.jsx

Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@ import ReactCalendar from 'react-calendar';
44
import 'react-calendar/dist/Calendar.css';
55
import CalendarActivitySection from './CalendarActivitySection';
66
import styles from './CommunityCalendar.module.css';
7+
import {
8+
FaCalendarAlt,
9+
FaClock,
10+
FaMapMarkerAlt,
11+
FaTag,
12+
FaAlignLeft,
13+
FaVideo,
14+
FaUsers,
15+
FaGlassCheers,
16+
} from 'react-icons/fa';
17+
import { GrWorkshop } from 'react-icons/gr';
718

819
const STATUSES = ['New', 'Needs Attendees', 'Filling Fast', 'Full Event'];
920
const EVENT_TYPES = ['Workshop', 'Webinar', 'Meeting', 'Social Gathering'];
@@ -261,6 +272,21 @@ function CommunityCalendar() {
261272
[darkMode],
262273
);
263274

275+
const getTypeIcon = type => {
276+
switch (type) {
277+
case 'Workshop':
278+
return <GrWorkshop />;
279+
case 'Webinar':
280+
return <FaVideo />;
281+
case 'Meeting':
282+
return <FaUsers />;
283+
case 'Social Gathering':
284+
return <FaGlassCheers />;
285+
default:
286+
return null;
287+
}
288+
};
289+
264290
return (
265291
<div className={calendarClasses.container}>
266292
{/* Inline styles to ensure selected date number is visible in dark mode - force dark background */}
@@ -478,20 +504,28 @@ function CommunityCalendar() {
478504

479505
<div className={styles.eventDetailsGrid}>
480506
{[
481-
['Type', selectedEvent.type],
482-
['Location', selectedEvent.location],
483-
['Date', selectedEvent.date.toLocaleDateString()],
484-
['Time', selectedEvent.time],
485-
].map(([label, value]) => (
507+
[FaTag, 'Type', selectedEvent.type],
508+
[FaMapMarkerAlt, 'Location', selectedEvent.location],
509+
[FaCalendarAlt, 'Date', selectedEvent.date.toLocaleDateString()],
510+
[FaClock, 'Time', selectedEvent.time],
511+
].map(([Icon, label, value]) => (
486512
<div key={label} className={styles.detailItem}>
487-
<span className={styles.detailLabel}>{label}:</span>
488-
<span>{value}</span>
513+
<span className={styles.detailLabel}>
514+
<Icon className={styles.detailIcon} />
515+
{label}:
516+
</span>
517+
<span>
518+
{label === 'Type' ? getTypeIcon(selectedEvent.type) : null} {value}
519+
</span>
489520
</div>
490521
))}
491522
</div>
492523

493524
<div className={styles.eventDescription}>
494-
<span className={styles.detailLabel}>Description:</span>
525+
<span className={styles.detailLabel}>
526+
<FaAlignLeft className={styles.detailIcon} />
527+
Description:
528+
</span>
495529
<p>{selectedEvent.description}</p>
496530
</div>
497531
</div>

src/components/CommunityPortal/Calendar/CommunityCalendar.module.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,3 +1083,13 @@
10831083
letter-spacing: 0.5px;
10841084
display: block;
10851085
}
1086+
.detailIcon {
1087+
margin-right: 8px;
1088+
vertical-align: middle;
1089+
color: #718096;
1090+
font-size: 1rem;
1091+
}
1092+
1093+
.eventModalDark .detailIcon {
1094+
color: #cbd5e0;
1095+
}

0 commit comments

Comments
 (0)