diff --git a/src/pages/events.tsx b/src/pages/events.tsx index e7a2e32..a0a5f42 100644 --- a/src/pages/events.tsx +++ b/src/pages/events.tsx @@ -147,6 +147,7 @@ export function EventItem({ }: Event & { cardClasses?: string[] }) { const endDate = new Date(attributes.end_date); const startDate = new Date(attributes.start_date); + const isInFuture = startDate > new Date(); const isEnded = endDate.getTime() <= Date.now(); const isNearlyEnded = differenceInDays(endDate, new Date()) <= 7; const [ref, { entry }] = useIntersectionObserver(); @@ -159,9 +160,12 @@ export function EventItem({ cardClasses, "relative bg-grey-dark border transition-all hover:border-opacity-100", { - "border-beige border-opacity-20": isEnded, - "border-green-300 border-opacity-60": !isEnded && !isNearlyEnded, - "border-orange-300 border-opacity-60": isNearlyEnded && !isEnded, + "border-beige border-opacity-20": isEnded && !isInFuture, + "border-green-300 border-opacity-60": + !isEnded && !isNearlyEnded && !isInFuture, + "border-orange-300 border-opacity-60": + isNearlyEnded && !isEnded && !isInFuture, + "border-violet-400": isInFuture, } )} > @@ -169,9 +173,10 @@ export function EventItem({

{attributes.title} @@ -254,6 +259,12 @@ export function EventItem({ Ends in {formatDistanceToNow(endDate)}! )} + + {isInFuture && ( + + Starts in {formatDistanceToNow(startDate)}! + + )} {isVisible && }