diff --git a/src/app/story/[storylineId]/page.tsx b/src/app/story/[storylineId]/page.tsx index 3f80dead..e83eb57b 100644 --- a/src/app/story/[storylineId]/page.tsx +++ b/src/app/story/[storylineId]/page.tsx @@ -357,7 +357,7 @@ function StoryHeader({ ) : storyline.last_plot_time ? ( <>
- +
Deadline
diff --git a/src/components/DeadlineCountdown.tsx b/src/components/DeadlineCountdown.tsx index 1cf0ee92..dcd93a18 100644 --- a/src/components/DeadlineCountdown.tsx +++ b/src/components/DeadlineCountdown.tsx @@ -5,7 +5,15 @@ import { useState, useEffect } from "react"; export const DEADLINE_HOURS = 168; export const DEADLINE_MS = DEADLINE_HOURS * 60 * 60 * 1000; -export function DeadlineCountdown({ lastPlotTime, hideLabel }: { lastPlotTime: string; hideLabel?: boolean }) { +export function DeadlineCountdown({ + lastPlotTime, + hideLabel, + valueClassName, +}: { + lastPlotTime: string; + hideLabel?: boolean; + valueClassName?: string; +}) { const [remaining, setRemaining] = useState(null); useEffect(() => { @@ -17,11 +25,14 @@ export function DeadlineCountdown({ lastPlotTime, hideLabel }: { lastPlotTime: s return () => clearInterval(interval); }, [lastPlotTime]); + const defaultValueClass = "text-accent font-medium"; + const activeClass = valueClassName ?? defaultValueClass; + if (remaining === null) { return (
{!hideLabel && <>Deadline:{" "}} - -- + --
); } @@ -30,7 +41,7 @@ export function DeadlineCountdown({ lastPlotTime, hideLabel }: { lastPlotTime: s return (
{!hideLabel && <>Deadline:{" "}} - expired + expired
); } @@ -52,7 +63,7 @@ export function DeadlineCountdown({ lastPlotTime, hideLabel }: { lastPlotTime: s return (
{!hideLabel && <>Deadline:{" "}} - {formatted} + {formatted}
); }