diff --git a/astro/src/components/web/UpcomingEvents.astro b/astro/src/components/web/UpcomingEvents.astro index fee6fd1..a368620 100644 --- a/astro/src/components/web/UpcomingEvents.astro +++ b/astro/src/components/web/UpcomingEvents.astro @@ -1,6 +1,7 @@ --- import CalendarIcon from '@/icons/CalendarIcon.astro'; import { Image } from 'astro:assets'; +import { upcomingEvent as UpcomingEvent } from './subcomponents/UpcomingEvent'; interface Props { upcomingEvents: UpcomingEventsComponent; @@ -24,7 +25,7 @@ const upcomingEvents = Astro.props.upcomingEvents; alt="" /> -
+

{event.title}

@@ -34,6 +35,9 @@ const upcomingEvents = Astro.props.upcomingEvents;

{event.startDate}

) }
+
+ +
)) } diff --git a/astro/src/components/web/subcomponents/UpcomingEvent.tsx b/astro/src/components/web/subcomponents/UpcomingEvent.tsx new file mode 100644 index 0000000..52b3a36 --- /dev/null +++ b/astro/src/components/web/subcomponents/UpcomingEvent.tsx @@ -0,0 +1,45 @@ +import { CalendarIcon } from "@/icons/jsx/calendarIcon"; +import { useEffect, useState } from "preact/hooks" + +export function upcomingEvent(props: { event: UpcomingEvent }) { + const [ isOpen, setIsOpen ] = useState(false); + + useEffect(() => { + console.log(isOpen); + }, [ isOpen ]) + + return ( +
+
setIsOpen(true)}>{"Read more >>"}
+ + { isOpen && ( +
setIsOpen(false)} + className="fixed inset-0 flex items-center justify-center bg-[#000000bb] shadow-md z-999999999999" + > +
e.stopPropagation()} + className="relative bg-white rounded-2xl shadow-xl max-w-md w-full p-6 animate-in fade-in zoom-in-95" + > +
+

{props.event.title}

+
+ + + { props.event.endDate !== null ? ( +

{props.event.startDate} - {props.event.endDate}

+ ) : ( +

{props.event.startDate}

+ ) } +
+ +
+ { props.event.description } +
+
+
+
+ ) } +
+ ) +} diff --git a/astro/src/icons/jsx/calendarIcon.tsx b/astro/src/icons/jsx/calendarIcon.tsx new file mode 100644 index 0000000..87b2bdf --- /dev/null +++ b/astro/src/icons/jsx/calendarIcon.tsx @@ -0,0 +1,5 @@ +export function CalendarIcon(props: { width?: number, height?: number }) { + return ( + + ) +}