fix: updated event design

This commit is contained in:
Benno Tielen 2026-04-18 11:18:45 +02:00
parent f489ac9d9b
commit fbcc46eafc
5 changed files with 133 additions and 83 deletions

View file

@ -2,6 +2,7 @@
display: flex; display: flex;
gap: 20px; gap: 20px;
align-items: center; align-items: center;
justify-content: center;
} }
.photo { .photo {

View file

@ -9,6 +9,7 @@
.subtitle { .subtitle {
position: relative; position: relative;
font-weight: 500;
top: -20px; top: -20px;
} }

View file

@ -76,3 +76,43 @@ export const WithPhoto: Story = {
photo: photo photo: photo
} }
} }
export const WithOccurrences: Story = {
args: {
...Default.args,
upcomingOccurrences: [
{
id: 'o1',
date: '2024-12-09T09:21:19Z',
title: 'Sing & Pray',
href: '/veranstaltungen/sing-and-pray-2',
location: 'St. Richard',
cancelled: false,
},
{
id: 'o2',
date: '2024-12-16T09:21:19Z',
title: 'Sing & Pray',
href: '/veranstaltungen/sing-and-pray-3',
location: 'St. Richard',
cancelled: true,
},
{
id: 'o3',
date: '2024-12-23T09:21:19Z',
title: 'Sing & Pray',
href: '/veranstaltungen/sing-and-pray-4',
location: 'St. Richard',
cancelled: false,
},
{
id: 'o4',
date: '2024-12-30T09:21:19Z',
title: 'Sing & Pray',
href: '/veranstaltungen/sing-and-pray-5',
location: 'St. Richard',
cancelled: false,
},
],
},
}

View file

@ -5,11 +5,9 @@ import { Title } from '@/components/Title/Title'
import { Container } from '@/components/Container/Container' import { Container } from '@/components/Container/Container'
import { Col } from '@/components/Flex/Col' import { Col } from '@/components/Flex/Col'
import { Pill } from '@/components/Pill/Pill' import { Pill } from '@/components/Pill/Pill'
import { HR } from '@/components/HorizontalRule/HorizontalRule'
import { useDate } from '@/hooks/useCompactDate' import { useDate } from '@/hooks/useCompactDate'
import { readableDateTime } from '@/utils/readableDate' import { readableDateTime } from '@/utils/readableDate'
import { TextDiv } from '@/components/Text/TextDiv' import { TextDiv } from '@/components/Text/TextDiv'
import { EventExcerpt, EventExcerptRow } from '@/components/EventExcerpt/EventExcerpt'
import { Button } from '@/components/Button/Button' import { Button } from '@/components/Button/Button'
import Image, { StaticImageData } from 'next/image' import Image, { StaticImageData } from 'next/image'
import { locationString } from '@/utils/dto/location' import { locationString } from '@/utils/dto/location'
@ -17,6 +15,8 @@ import { ContactPerson2 } from '@/components/ContactPerson2/ContactPerson2'
import { getPhoto } from '@/utils/dto/gallery' import { getPhoto } from '@/utils/dto/gallery'
import { AdminMenu } from '@/components/AdminMenu/AdminMenu' import { AdminMenu } from '@/components/AdminMenu/AdminMenu'
import { EventRow } from '@/components/EventRow/EventRow' import { EventRow } from '@/components/EventRow/EventRow'
import { Row } from '@/components/Flex/Row'
import classNames from 'classnames'
type UpcomingOccurrence = { type UpcomingOccurrence = {
id: string id: string
@ -71,10 +71,11 @@ export function EventPage(
const where = locationString(location); const where = locationString(location);
const contactPersonPhoto = typeof contact === "object" ? getPhoto("thumbnail", contact.photo) : undefined; const contactPersonPhoto = typeof contact === "object" ? getPhoto("thumbnail", contact.photo) : undefined;
const isRecurring = recurrenceType && recurrenceType !== 'none' const isRecurring = recurrenceType && recurrenceType !== 'none'
const hasOccurrences = upcomingOccurrences && upcomingOccurrences.length > 0;
return ( return (
<> <>
<Section paddingBottom={"small"}> <Section paddingBottom={"small"} backgroundColor={"off-white"}>
<Container> <Container>
<Title <Title
title={title} title={title}
@ -87,7 +88,7 @@ export function EventPage(
<div className={styles.header}> <div className={styles.header}>
<div className={styles.headerText}> <div className={styles.headerText}>
<p> <p>
Herzliche Einladungen an unseren kommenden Veranstaltungen und Events teilzunehmen. {shortDescription}
</p> </p>
<p className={styles.published}> <p className={styles.published}>
Publiziert am {published} Publiziert am {published}
@ -102,7 +103,7 @@ export function EventPage(
} }
</div> </div>
</div> </div>
<Col> <div>
{ photo && { photo &&
<Image <Image
src={photo} src={photo}
@ -112,34 +113,56 @@ export function EventPage(
/> />
} }
</Col>
</div> </div>
<HR /> </div>
</Section> </Section>
<Section padding={"medium"}> <Section padding={"medium"}>
<Container> <Container>
<Title <Title
size={"md"} size={"md"}
title={`${title} - ${readableDate}`} title={title}
subtitle={`${readableDate} - ${typeof location === "object" ? location.name : 'd'}`}
fontStyle={"sans-serif"} fontStyle={"sans-serif"}
align={"center"} align={"center"}
/> />
{typeof location === "object" &&
<Title
size={"md"}
title={location.name}
fontStyle={"sans-serif"}
align={"center"}
/>
}
<Section padding={"medium"}> <Section padding={"medium"}>
<div className={styles.description}> <Row>
<Col>
<Title
size={"md"}
title={"Einladung"}
fontStyle={"sans-serif"}
align={"center"}
/>
<div className={classNames({
[styles.description]: true,
[styles.padding]: !hasOccurrences
})}>
<TextDiv text={description} /> <TextDiv text={description} />
<br/>
<Title title={"Location"} size={"sm"} align={"center"} fontStyle={"sans-serif"}/>
<TextDiv text={where} />
{ typeof contact !== "undefined" &&
<>
<br/>
<Title title={"Ansprechperson"} size={"sm"} align={"center"} fontStyle={"sans-serif"}/>
<ContactPerson2
contact={contact}
photo={contactPersonPhoto}/>
</>
}
</div>
{ (typeof flyer === "object" || group || rsvpLink) && { (typeof flyer === "object" || group || rsvpLink) &&
<Section padding={"small"}> <Section padding={"small"}>
<div className={styles.buttons}> <div className={styles.buttons}>
@ -163,37 +186,15 @@ export function EventPage(
</div> </div>
</Section> </Section>
} }
</div>
</Section>
</Container>
<EventExcerpt>
<EventExcerptRow label={"Was:"}>
<TextDiv text={shortDescription} />
</EventExcerptRow>
<EventExcerptRow label={"Wo:"}>
<TextDiv text={where} />
</EventExcerptRow>
<EventExcerptRow label={"Ansprechperson:"}>
<ContactPerson2
contact={contact}
photo={contactPersonPhoto}
/>
</EventExcerptRow>
</EventExcerpt>
</Section>
</Col>
{ upcomingOccurrences && upcomingOccurrences.length > 0 && { upcomingOccurrences && upcomingOccurrences.length > 0 &&
<Section padding={"medium"}> <Col>
<Container>
<Title <Title
title={"Nächste Termine"} title={"Nächste Termine"}
size={"md"} size={"md"}
color={"contrast"} color={"contrast"}
align={"center"}
/> />
<Section padding={"small"}>
{ upcomingOccurrences.map(o => { upcomingOccurrences.map(o =>
<EventRow <EventRow
key={o.id} key={o.id}
@ -202,14 +203,16 @@ export function EventPage(
href={o.href} href={o.href}
location={o.location} location={o.location}
cancelled={o.cancelled} cancelled={o.cancelled}
color={"contrast"}
/> />
)} )}
</Col>
}
</Row>
</Section> </Section>
</Container> </Container>
</Section> </Section>
}
<Section/>
<AdminMenu <AdminMenu
collection={"event"} collection={"event"}
id={id} id={id}

View file

@ -2,7 +2,11 @@
.description { .description {
text-align: center; text-align: center;
padding: 0 100px; }
.padding {
max-width: 600px;
margin: 0 auto;
} }
.published { .published {
@ -28,6 +32,7 @@
gap: 80px; gap: 80px;
margin: 0 auto; margin: 0 auto;
overflow: hidden; overflow: hidden;
justify-content: space-between;
} }
.photo { .photo {