21 lines
618 B
TypeScript
21 lines
618 B
TypeScript
import { getToday } from "@/lib/today";
|
|
import { Header } from "./Header";
|
|
|
|
// The logo's hats depend on today's date, which the prerendered Header
|
|
// (a Client Component) can't read itself
|
|
export async function SeasonalHeader() {
|
|
const today = await getToday();
|
|
|
|
// let's add a santa hat during December
|
|
const christmas = today.getMonth() === 11;
|
|
|
|
// let's add the student hat during STUDiO 2026
|
|
const studentHat =
|
|
today.getFullYear() === 2026 &&
|
|
today.getMonth() === 7 &&
|
|
today.getDate() >= 10 &&
|
|
today.getDate() <= 16;
|
|
|
|
return <Header christmas={christmas} studentHat={studentHat} />;
|
|
}
|