special handling for "Hele huset"
This commit is contained in:
@ -14,6 +14,7 @@ import Link from "next/link";
|
|||||||
const DateListItem = ({ occurrence }: { occurrence: EventOccurrence }) => {
|
const DateListItem = ({ occurrence }: { occurrence: EventOccurrence }) => {
|
||||||
const dateFormat = "EEEE d. MMMM yyyy";
|
const dateFormat = "EEEE d. MMMM yyyy";
|
||||||
const timeFormat = "'kl.' HH:mm";
|
const timeFormat = "'kl.' HH:mm";
|
||||||
|
const wholeCastle = occurrence.venue?.slug === "hele-huset";
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<li className={styles.date}>
|
<li className={styles.date}>
|
||||||
@ -24,13 +25,18 @@ const DateListItem = ({ occurrence }: { occurrence: EventOccurrence }) => {
|
|||||||
<span className={styles.hour}>
|
<span className={styles.hour}>
|
||||||
{formatDate(occurrence.start, timeFormat)}
|
{formatDate(occurrence.start, timeFormat)}
|
||||||
</span>{" "}
|
</span>{" "}
|
||||||
|
{wholeCastle && <span className={styles.venue}>på Chateau Neuf</span>}
|
||||||
|
{!wholeCastle && (
|
||||||
<span className={styles.venue}>
|
<span className={styles.venue}>
|
||||||
{occurrence.venue?.preposition + " " ?? ""}
|
{occurrence.venue?.preposition + " " ?? ""}
|
||||||
{occurrence.venue?.url && (
|
{occurrence.venue?.url && (
|
||||||
<Link href={occurrence.venue?.url}>{occurrence.venue?.title}</Link>
|
<Link href={occurrence.venue?.url}>
|
||||||
|
{occurrence.venue?.title}
|
||||||
|
</Link>
|
||||||
)}
|
)}
|
||||||
{!occurrence.venue?.url && <>{occurrence.venue?.title}</>}
|
{!occurrence.venue?.url && <>{occurrence.venue?.title}</>}
|
||||||
</span>
|
</span>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
);
|
);
|
||||||
@ -52,7 +58,7 @@ export const DateList = ({ event }: { event: EventFragment }) => {
|
|||||||
|
|
||||||
const [showAllDates, setShowAllDates] = useState(false);
|
const [showAllDates, setShowAllDates] = useState(false);
|
||||||
function toggleDates() {
|
function toggleDates() {
|
||||||
setShowAllDates(!showAllDates)
|
setShowAllDates(!showAllDates);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -70,11 +76,13 @@ export const DateList = ({ event }: { event: EventFragment }) => {
|
|||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
{futureOccurrences.length > 4 && (<div className={styles.showMore}>
|
{futureOccurrences.length > 4 && (
|
||||||
|
<div className={styles.showMore}>
|
||||||
<button onClick={() => toggleDates()} className="button tertiary">
|
<button onClick={() => toggleDates()} className="button tertiary">
|
||||||
<span>Vis alle kommende datoer ({futureOccurrences.length})</span>
|
<span>Vis alle kommende datoer ({futureOccurrences.length})</span>
|
||||||
</button>
|
</button>
|
||||||
</div>)}
|
</div>
|
||||||
|
)}
|
||||||
{/* <div onClick={() => setShowPast(!showPast)}>
|
{/* <div onClick={() => setShowPast(!showPast)}>
|
||||||
{showPast ? "Skjul" : "Vis"} tidligere
|
{showPast ? "Skjul" : "Vis"} tidligere
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user