@@ -2,21 +2,6 @@ import Image from "next/image";
22import type { ReactNode } from "react" ;
33import { fetchContent } from "@/app/actions" ;
44
5- const EVENT_DETAILS_SECTION_STYLES =
6- "flex w-full flex-col items-center bg-white" ;
7- const EVENT_DETAILS_CONTENT_STYLES =
8- "bg-pastel-pink border-4 border-dark-pink rounded-3xl mt-4 mb-8 xl:mt-8 xl:mb-12 flex flex-col xl:flex-row w-4/5 shadow-[15px_15px_0px_0px_dark-pink]" ;
9- const EVENT_IMAGE_CONTAINER_STYLES =
10- "bg-dark-grey border-b-4 border-dark-pink size-full xl:size-1/2 rounded-t-2xl xl:rounded-tr-none xl:rounded-l-2xl xl:border-b-0 xl:border-r-4 " ;
11- const EVENT_IMAGE_STYLES =
12- "w-full h-full object-cover rounded-bl-none rounded-t-2xl xl:rounded-tr-none xl:rounded-l-2xl" ;
13- const EVENT_DETAILS_CONTAINER_STYLES =
14- "flex items-center w-full xl:w-1/2 rounded-b-20 md:rounded-bl-none md:rounded-r-2xl" ;
15- const EVENT_DETAIL_STYLES = "flex items-center ml-10" ;
16- const EVENT_DETAIL_TITLE_STYLES =
17- "text-lg text-dark-grey font-extrabold leading-tight" ;
18- const ICON_CONTAINER_STYLES = "bg-white rounded-xl p-1 m-4" ;
19-
205const icons = {
216 date : "/svgs/aboutEventTile/date_icon.svg" ,
227 location : "/svgs/aboutEventTile/location_icon.svg" ,
@@ -30,15 +15,20 @@ interface EventDetailProps {
3015 children : ReactNode ;
3116}
3217
33- const EventDetail = ( props : EventDetailProps ) => {
34- const { iconSrc, iconName, children } = props ;
35-
18+ const EventDetail = ( { iconSrc, iconName, children } : EventDetailProps ) => {
3619 return (
37- < div className = { EVENT_DETAIL_STYLES } >
38- < div className = { ICON_CONTAINER_STYLES } >
39- < Image src = { iconSrc } alt = { `${ iconName } icon` } width = { 35 } height = { 35 } />
20+ < div className = "ml-10 flex items-center" >
21+ < div className = "m-4 rounded-xl bg-white p-1" >
22+ < Image
23+ src = { iconSrc || "/placeholder.svg" }
24+ alt = { `${ iconName } icon` }
25+ width = { 35 }
26+ height = { 35 }
27+ />
4028 </ div >
41- < h2 className = { EVENT_DETAIL_TITLE_STYLES } > { children } </ h2 >
29+ < h2 className = "text-lg font-extrabold leading-tight text-dark-grey" >
30+ { children }
31+ </ h2 >
4232 </ div >
4333 ) ;
4434} ;
@@ -54,22 +44,22 @@ export default async function AboutEventTile() {
5444 } ) ;
5545
5646 return (
57- < div className = { EVENT_DETAILS_SECTION_STYLES } >
58- < div className = { EVENT_DETAILS_CONTENT_STYLES } >
59- < div className = { EVENT_IMAGE_CONTAINER_STYLES } >
47+ < div className = "flex w-full flex-col items-center bg-white" >
48+ < div className = "z-100 mb-8 mt-4 flex w-4/5 flex-row rounded-3xl border-4 border-dark-pink bg-pastel-pink shadow-[15px_15px_0px_0px_dark-pink] xl:mb-12 xl:mt-8" >
49+ < div className = "relative flex aspect-[16/9] w-full max-w-xl items-center justify-center overflow-hidden rounded-l-2xl bg-dark-grey" >
6050 < Image
61- className = { EVENT_IMAGE_STYLES }
6251 src = {
6352 eventDetails . locationImage . fields . file ?. url
6453 ?. toString ( )
6554 . replace ( "//" , "https://" ) ?? ""
6655 }
6756 alt = { eventDetails . locationName }
68- width = { 500 }
69- height = { 500 }
57+ fill
58+ sizes = "(max-width: 768px) 100vw, 345px"
59+ priority
7060 />
7161 </ div >
72- < div className = { EVENT_DETAILS_CONTAINER_STYLES } >
62+ < div className = "flex w-full items-center rounded-b-20 md:rounded-r-2xl md:rounded-bl-none xl:w-1/2" >
7363 < div >
7464 < EventDetail iconSrc = { icons . date } iconName = "date" >
7565 { formattedDate }
0 commit comments