From 0dbdaf59f7d7ffc596d07e09e8495aa18760c173 Mon Sep 17 00:00:00 2001 From: TheMaddax Date: Sat, 19 Oct 2024 18:12:45 -0600 Subject: [PATCH] Update events, minutes viewing, and facebook logo --- client/src/components/Footer.tsx | 4 +- client/src/components/Minutes.tsx | 81 +++++++++++++++++++++++++++---- client/src/eventData.ts | 50 ------------------- 3 files changed, 73 insertions(+), 62 deletions(-) diff --git a/client/src/components/Footer.tsx b/client/src/components/Footer.tsx index 4149318..48a9126 100644 --- a/client/src/components/Footer.tsx +++ b/client/src/components/Footer.tsx @@ -102,8 +102,8 @@ const Footer: React.FC = () => { className="inline-block mt-4 transition-transform duration-300 ease-in-out transform hover:scale-110" > Facebook { const [sortColumn, setSortColumn] = useState('date'); const [sortDirection, setSortDirection] = useState<'asc' | 'desc'>('desc'); + const [selectedMinutes, setSelectedMinutes] = useState(null); + const [isMobile, setIsMobile] = useState(false); + + useEffect(() => { + const checkMobile = () => { + setIsMobile(window.innerWidth < 768); + }; + + checkMobile(); + window.addEventListener('resize', checkMobile); + + return () => window.removeEventListener('resize', checkMobile); + }, []); const sortedMinutes = [...minutesData].sort((a, b) => { if (a[sortColumn] < b[sortColumn]) return sortDirection === 'asc' ? -1 : 1; @@ -37,6 +50,18 @@ const Minutes: React.FC = () => { } }; + const handleMinutesClick = (entry: MinuteEntry) => { + if (isMobile) { + window.open(entry.fileUrl, '_blank'); + } else { + setSelectedMinutes(entry); + } + }; + + const closePopup = () => { + setSelectedMinutes(null); + }; + return (
{ - {sortedMinutes.map((entry, index) => ( + {sortedMinutes.map((entry, index) => ( + {entry.date} {entry.meetingType} {entry.location} - handleMinutesClick(entry)} + className="bg-[#8C1D40] text-white font-bold py-2 px-4 rounded hover:bg-[#6B1631] transition duration-300" > View Minutes - + ))} @@ -82,8 +106,45 @@ const Minutes: React.FC = () => {
+ + + {selectedMinutes && !isMobile && ( + + e.stopPropagation()} + > +

+ {selectedMinutes.meetingType} - {selectedMinutes.date} +

+
+