Skip to content

Commit 3524523

Browse files
Merge pull request #4776 from OneCommunityGlobal/Akshith-add-event-modal-icons
Akshith - Event Details Popup Add Icons in Community Calendar
2 parents 63ec810 + 848a1d3 commit 3524523

2 files changed

Lines changed: 110 additions & 45 deletions

File tree

src/components/CommunityPortal/Calendar/CommunityCalendar.jsx

Lines changed: 48 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@ import axios from 'axios';
66
import { ENDPOINTS } from '../../../utils/URL';
77
import CalendarActivitySection from './CalendarActivitySection';
88
import styles from './CommunityCalendar.module.css';
9+
import {
10+
FaCalendarAlt,
11+
FaClock,
12+
FaMapMarkerAlt,
13+
FaTag,
14+
FaAlignLeft,
15+
FaVideo,
16+
FaUsers,
17+
FaGlassCheers,
18+
} from 'react-icons/fa';
19+
import { GrWorkshop } from 'react-icons/gr';
920
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
1021
import { faClock, faLocationDot, faTag, faCircleCheck } from '@fortawesome/free-solid-svg-icons';
1122

@@ -455,6 +466,21 @@ export default function CommunityCalendar() {
455466
[darkMode],
456467
);
457468

469+
const getTypeIcon = type => {
470+
switch (type) {
471+
case 'Workshop':
472+
return <GrWorkshop />;
473+
case 'Webinar':
474+
return <FaVideo />;
475+
case 'Meeting':
476+
return <FaUsers />;
477+
case 'Social Gathering':
478+
return <FaGlassCheers />;
479+
default:
480+
return null;
481+
}
482+
};
483+
458484
return (
459485
<div className={calendarClasses.container}>
460486
{/* Inline styles to ensure selected date number is visible in dark mode - force dark background */}
@@ -741,26 +767,31 @@ export default function CommunityCalendar() {
741767
</div>
742768

743769
<div className={styles.eventDetailsGrid}>
744-
<div className={styles.detailItem}>
745-
<span>Type:</span>
746-
<span>{selectedEvent.type}</span>
747-
</div>
748-
<div className={styles.detailItem}>
749-
<span>Location:</span>
750-
<span>{selectedEvent.location}</span>
751-
</div>
752-
<div className={styles.detailItem}>
753-
<span>Date:</span>
754-
<span>{selectedEvent.date.toLocaleDateString()}</span>
755-
</div>
756-
<div className={styles.detailItem}>
757-
<span>Time:</span>
758-
<span>{selectedEvent.time}</span>
759-
</div>
770+
{[
771+
[FaTag, 'Type', selectedEvent.type],
772+
[FaMapMarkerAlt, 'Location', selectedEvent.location],
773+
[FaCalendarAlt, 'Date', selectedEvent.date.toLocaleDateString()],
774+
[FaClock, 'Time', selectedEvent.time],
775+
].map(([Icon, label, value]) => (
776+
<div key={label} className={styles.detailItem}>
777+
<span className={styles.detailLabel}>
778+
<Icon className={styles.detailIcon} />
779+
{label}:
780+
</span>
781+
782+
<span>
783+
{label === 'Type' ? getTypeIcon(selectedEvent.type) : null} {value}
784+
</span>
785+
</div>
786+
))}
760787
</div>
761788

762789
<div className={styles.eventDescription}>
763-
<span>Description:</span>
790+
<span className={styles.detailLabel}>
791+
<FaAlignLeft className={styles.detailIcon} />
792+
Description:
793+
</span>
794+
764795
<p>{selectedEvent.description}</p>
765796
</div>
766797
</div>

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

Lines changed: 62 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
.calendarContainer {
33
display: flex;
44
flex-direction: row;
5-
min-width: 100%;
5+
width: 100%;
6+
min-width: 0;
67
align-items: stretch;
78
gap: 20px;
89
}
@@ -22,6 +23,7 @@
2223
box-sizing: border-box;
2324
display: flex;
2425
flex-direction: column;
26+
min-width: 0;
2527
}
2628

2729
.calendarActivitySectionDarkMode,
@@ -68,8 +70,6 @@
6870
font-size: 1.2rem;
6971
border: 2px solid #ddd;
7072
border-radius: 8px;
71-
72-
/* overflow: hidden; */
7373
background-color: #fff;
7474
padding: 2rem;
7575
}
@@ -158,21 +158,13 @@
158158
margin-bottom: 0 !important;
159159
}
160160

161-
.reactCalendar :global(.react-calendar__tile) {
162-
display: grid;
163-
height: 100px;
164-
border: 1px solid #dee2e6 !important;
165-
box-sizing: border-box;
166-
transition: background 0.3s, border-color 0.3s ease;
167-
overflow: visible !important;
168-
position: relative;
169-
padding: 4px;
170-
color: #1a202c;
171-
}
172-
161+
.reactCalendar :global(.react-calendar__tile),
173162
.reactCalendarDarkMode :global(.react-calendar__tile) {
174-
background: transparent;
175-
color: #fff;
163+
height: 110px !important;
164+
max-height: 110px !important;
165+
overflow: hidden !important;
166+
display: flex !important;
167+
flex-direction: column !important;
176168
}
177169

178170
.reactCalendar :global(.react-calendar__tile):hover {
@@ -1374,33 +1366,57 @@
13741366
display: block;
13751367
}
13761368

1369+
.detailIcon {
1370+
margin-right: 8px;
1371+
vertical-align: middle;
1372+
color: #718096;
1373+
font-size: 1rem;
1374+
}
1375+
1376+
.eventModalDark .detailIcon {
1377+
color: #cbd5e0;
1378+
}
1379+
1380+
.weekGridRoot {
1381+
display: flex;
1382+
flex-direction: column;
1383+
width: 100%;
1384+
min-width: 0;
1385+
}
1386+
13771387
/* Week Grid Styles */
1378-
.weekGridContainer {
1388+
.weekGridRoot .weekGridContainer {
13791389
display: flex;
13801390
flex-direction: column;
13811391
background: #fff;
13821392
border: 1px solid #e2e8f0;
13831393
border-radius: 12px;
13841394
height: 700px;
1395+
max-width: 100%;
13851396
overflow: hidden;
13861397
margin-bottom: 20px;
13871398
}
13881399

1389-
.weekGridBody {
1400+
.weekGridRoot .weekGridBody {
13901401
flex: 1;
1391-
overflow-y: scroll;
1402+
overflow-y: auto;
13921403
background: #fff;
1404+
min-width: 0;
13931405
}
13941406

13951407
@media (width <= 1024px) {
1396-
.calendarContainer{
1408+
.calendarContainer {
13971409
flex-direction: column;
13981410
}
13991411

14001412
.reactCalendar {
14011413
padding: 1rem;
14021414
}
14031415

1416+
.weekGridRoot .weekGridContainer {
1417+
height: auto;
1418+
min-height: 500px;
1419+
}
14041420
}
14051421

14061422
.dateLabel {
@@ -1409,11 +1425,12 @@
14091425
color: #1e293b;
14101426
}
14111427

1412-
.hourRow {
1428+
.weekGridRoot .hourRow {
14131429
display: grid;
1414-
grid-template-columns: 80px repeat(7, 1fr);
1430+
grid-template-columns: 80px repeat(7, minmax(0, 1fr));
14151431
min-height: 80px;
14161432
border-bottom: 1px solid #f1f5f9;
1433+
width: 100%;
14171434
}
14181435

14191436
.timeLabel {
@@ -1426,26 +1443,40 @@
14261443
border-right: 1px solid #e2e8f0;
14271444
}
14281445

1429-
.gridCell {
1446+
.weekGridRoot .gridCell {
1447+
min-width: 0; /* CRITICAL */
1448+
max-width: 100%; /* CRITICAL */
1449+
overflow: hidden; /* prevents bleed */
14301450
border-left: 1px solid #f1f5f9;
14311451
position: relative;
14321452
padding: 4px;
1433-
transition: background 0.2s;
1453+
box-sizing: border-box;
1454+
display: flex;
1455+
flex-direction: column;
14341456
}
14351457

14361458
.gridCell:hover {
14371459
background-color: #f8fafc;
14381460
}
14391461

14401462
.gridEvent {
1463+
width: 100%;
1464+
max-width: 100%;
1465+
min-width: 0;
1466+
overflow: hidden; /* CRITICAL */
1467+
box-sizing: border-box;
14411468
background: #dcfce7;
14421469
border-left: 4px solid #22c55e;
14431470
border-radius: 6px;
14441471
padding: 6px;
14451472
font-size: 0.75rem;
14461473
cursor: pointer;
1447-
box-shadow: 0 1px 2px rgb(0 0 0 / 5%);
1448-
margin-bottom: 4px;
1474+
display: flex;
1475+
flex-direction: column;
1476+
}
1477+
1478+
.gridEvent * {
1479+
min-width: 0;
14491480
}
14501481

14511482
.gridEventTitle {
@@ -1514,9 +1545,9 @@
15141545
display: flex;
15151546
align-items: center;
15161547
gap: 4px;
1548+
min-width: 0; /* CRITICAL */
15171549
overflow: hidden;
15181550
}
1519-
15201551
.eventIcon {
15211552
font-size: 0.75rem;
15221553
flex-shrink: 0;
@@ -1525,6 +1556,8 @@
15251556
}
15261557

15271558
.eventTitleText {
1559+
flex: 1;
1560+
min-width: 0; /* CRITICAL */
15281561
overflow: hidden;
15291562
text-overflow: ellipsis;
15301563
white-space: nowrap;
@@ -1536,3 +1569,4 @@
15361569
gap: 4px;
15371570
font-weight: 600;
15381571
}
1572+

0 commit comments

Comments
 (0)