add days back to upcoming events, tidy up design a little
This commit is contained in:
@ -51,32 +51,39 @@ export const EventItem = ({
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.time}>
|
<div className={styles.text}>
|
||||||
{mode === "list" && nextOccurrence && (
|
{mode === "singular-time-only" &&
|
||||||
<div className={styles.dates}>
|
|
||||||
{groupedOccurrences.slice(0, DATE_PILLS_TO_SHOW).map((group) => (
|
|
||||||
<span key={group[0]} className={styles.datePill}>
|
|
||||||
{formatDateRange(group)}
|
|
||||||
</span>
|
|
||||||
))}
|
|
||||||
{groupedOccurrences.length > DATE_PILLS_TO_SHOW && (
|
|
||||||
<span className={styles.moreDates}>{`+${groupedOccurrences
|
|
||||||
.slice(DATE_PILLS_TO_SHOW)
|
|
||||||
.reduce((sum, group) => sum + group.length, 0)}`}</span>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{(mode === "calendar" || mode === "singular-time-only") &&
|
|
||||||
"occurrence" in event &&
|
"occurrence" in event &&
|
||||||
event.occurrence?.start && (
|
event.occurrence?.start && (
|
||||||
<p className={styles.dates}>
|
<p className={styles.day}>
|
||||||
{formatDate(event.occurrence?.start, "'kl.' HH:mm")}
|
{formatDate(event.occurrence?.start, "eeee dd.MM.")}
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
</div>
|
|
||||||
<div className={styles.text}>
|
|
||||||
<h1 className={styles.title}>{event.title}</h1>
|
<h1 className={styles.title}>{event.title}</h1>
|
||||||
<p className={styles.details}>Evt. andre detaljer</p>
|
<p className={styles.details}>Evt. andre detaljer</p>
|
||||||
|
<div className={styles.time}>
|
||||||
|
{mode === "list" && nextOccurrence && (
|
||||||
|
<div className={styles.dates}>
|
||||||
|
{groupedOccurrences.slice(0, DATE_PILLS_TO_SHOW).map((group) => (
|
||||||
|
<span key={group[0]} className={styles.datePill}>
|
||||||
|
{formatDateRange(group)}
|
||||||
|
</span>
|
||||||
|
))}
|
||||||
|
{groupedOccurrences.length > DATE_PILLS_TO_SHOW && (
|
||||||
|
<span className={styles.moreDates}>{`+${groupedOccurrences
|
||||||
|
.slice(DATE_PILLS_TO_SHOW)
|
||||||
|
.reduce((sum, group) => sum + group.length, 0)}`}</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{(mode === "calendar" || mode === "singular-time-only") &&
|
||||||
|
"occurrence" in event &&
|
||||||
|
event.occurrence?.start && (
|
||||||
|
<p className={styles.dates}>
|
||||||
|
{formatDate(event.occurrence?.start, "'kl.' HH:mm")}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Link href={`/arrangementer/${event.slug}`} className="hiddenLink">
|
<Link href={`/arrangementer/${event.slug}`} className="hiddenLink">
|
||||||
Mer om arrangementet {event.title}
|
Mer om arrangementet {event.title}
|
||||||
|
@ -28,12 +28,12 @@ export const UpcomingEvents = ({ events }: { events: EventFragment[] }) => {
|
|||||||
const eventsThisDay = eventsByDate[day];
|
const eventsThisDay = eventsByDate[day];
|
||||||
return (
|
return (
|
||||||
<div key={day}>
|
<div key={day}>
|
||||||
<h3>
|
{/*<h3>
|
||||||
{formatDate(
|
{formatDate(
|
||||||
parse(day, "yyyy-MM-dd", new Date()),
|
parse(day, "yyyy-MM-dd", new Date()),
|
||||||
"eeee dd.MM."
|
"eeee dd.MM."
|
||||||
)}
|
)}
|
||||||
</h3>
|
</h3>*/}
|
||||||
<ul>
|
<ul>
|
||||||
{eventsThisDay.map((event) => (
|
{eventsThisDay.map((event) => (
|
||||||
<EventItem
|
<EventItem
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
|
|
||||||
&.medium {
|
&.medium {
|
||||||
--size-image-width: 8rem;
|
--size-image-width: 8rem;
|
||||||
grid-template-rows: 1fr 2fr;
|
|
||||||
grid-template-columns: var(--size-image-width) auto;
|
grid-template-columns: var(--size-image-width) auto;
|
||||||
column-gap: .6rem;
|
column-gap: .6rem;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -28,7 +27,6 @@
|
|||||||
|
|
||||||
.image {
|
.image {
|
||||||
width: var(--size-image-width);
|
width: var(--size-image-width);
|
||||||
grid-row: span 2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.dates,
|
.dates,
|
||||||
@ -37,6 +35,18 @@
|
|||||||
font-size: var(--font-size-body);
|
font-size: var(--font-size-body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.day {
|
||||||
|
&:first-letter {
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
font-family: var(--font-serif);
|
||||||
|
font-size: var(--font-size-caption);
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
margin: .2em 0;
|
||||||
|
}
|
||||||
|
|
||||||
.dates {
|
.dates {
|
||||||
font-size: var(--font-size-caption);
|
font-size: var(--font-size-caption);
|
||||||
}
|
}
|
||||||
|
@ -31,12 +31,16 @@
|
|||||||
|
|
||||||
.eventList {
|
.eventList {
|
||||||
--size-item-width: 20rem;
|
--size-item-width: 20rem;
|
||||||
padding: var(--spacing-s) 0;
|
margin-bottom: var(--spacing-xs);
|
||||||
list-style: none;
|
list-style: none;
|
||||||
display: flex;
|
display: flex;
|
||||||
width: calc(var(--size-item-width) * 10);
|
width: calc(var(--size-item-width) * 10);
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
|
ul {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
li {
|
li {
|
||||||
padding-right: var(--spacing-s);
|
padding-right: var(--spacing-s);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user