add classes future/past to date list items
This commit is contained in:
@ -16,7 +16,11 @@ const DateListItem = ({ occurrence }: { occurrence: EventOccurrence }) => {
|
|||||||
const wholeCastle = occurrence.venue?.slug === "hele-huset";
|
const wholeCastle = occurrence.venue?.slug === "hele-huset";
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<li className={styles.date}>
|
<li
|
||||||
|
className={`${styles.date} ${
|
||||||
|
isTodayOrFuture(occurrence.start) ? styles.future : styles.past
|
||||||
|
}`}
|
||||||
|
>
|
||||||
<div className={styles.time}>
|
<div className={styles.time}>
|
||||||
<span className={styles.day}>
|
<span className={styles.day}>
|
||||||
{formatExtendedDateTime(occurrence.start, true)}
|
{formatExtendedDateTime(occurrence.start, true)}
|
||||||
|
@ -4,12 +4,6 @@
|
|||||||
|
|
||||||
.dateList {
|
.dateList {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
|
|
||||||
&[data-showall=true] {
|
|
||||||
.date {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.date {
|
.date {
|
||||||
@ -21,12 +15,6 @@
|
|||||||
line-height: 1.4;
|
line-height: 1.4;
|
||||||
padding: var(--spacing-s) 0;
|
padding: var(--spacing-s) 0;
|
||||||
border-bottom: var(--border);
|
border-bottom: var(--border);
|
||||||
|
|
||||||
display: none;
|
|
||||||
|
|
||||||
&:nth-of-type(1), &:nth-of-type(2), &:nth-of-type(3), &:nth-of-type(4) {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.header {
|
.header {
|
||||||
|
Reference in New Issue
Block a user