2026-11-15 21:00:50 +00:00
|
|
|
|
import type { Metadata } from "next";
|
|
|
|
|
|
import { Cormorant_Garamond, Inter } from "next/font/google";
|
2026-11-20 06:41:21 +00:00
|
|
|
|
import { Suspense } from "react";
|
2026-11-15 21:00:50 +00:00
|
|
|
|
|
2026-11-21 21:23:52 +00:00
|
|
|
|
import { NightSky } from "@/components/NightSky";
|
2026-11-24 07:01:40 +00:00
|
|
|
|
import { NpsBanner } from "@/components/NpsBanner";
|
2026-11-20 06:41:21 +00:00
|
|
|
|
import { PaymentReturn } from "@/components/PaymentReturn";
|
2026-11-24 07:21:19 +00:00
|
|
|
|
import { SiteFooter } from "@/components/PublicFooter";
|
2026-11-15 21:00:50 +00:00
|
|
|
|
import { SiteHeader } from "@/components/SiteHeader";
|
2026-11-22 10:14:15 +00:00
|
|
|
|
import { ValidationMessages } from "@/components/ValidationMessages";
|
2026-11-15 21:00:50 +00:00
|
|
|
|
import { getMe } from "@/lib/server";
|
2026-11-24 09:17:48 +00:00
|
|
|
|
import { loadSky } from "@/lib/sky";
|
2026-11-21 20:31:45 +00:00
|
|
|
|
import { siteUrl } from "@/lib/share";
|
2026-11-15 21:00:50 +00:00
|
|
|
|
|
|
|
|
|
|
import "./globals.css";
|
|
|
|
|
|
|
|
|
|
|
|
const cormorant = Cormorant_Garamond({
|
|
|
|
|
|
subsets: ["latin", "latin-ext"],
|
|
|
|
|
|
weight: ["500", "600"],
|
|
|
|
|
|
variable: "--font-cormorant",
|
|
|
|
|
|
});
|
|
|
|
|
|
const inter = Inter({ subsets: ["latin", "latin-ext"], variable: "--font-inter" });
|
|
|
|
|
|
|
2026-11-21 20:31:45 +00:00
|
|
|
|
export async function generateMetadata(): Promise<Metadata> {
|
|
|
|
|
|
return {
|
|
|
|
|
|
// Relative canonical and alternate addresses resolve against the site's address.
|
|
|
|
|
|
metadataBase: new URL(await siteUrl()),
|
|
|
|
|
|
title: { default: "Sorsfonalak", template: "%s · Sorsfonalak" },
|
|
|
|
|
|
description: "Születési képlet, szinasztria és közösség – egy helyen.",
|
|
|
|
|
|
};
|
|
|
|
|
|
}
|
2026-11-15 21:00:50 +00:00
|
|
|
|
|
|
|
|
|
|
export default async function RootLayout({ children }: { children: React.ReactNode }) {
|
|
|
|
|
|
const me = await getMe();
|
2026-11-24 09:17:48 +00:00
|
|
|
|
// The Moon today in the header (cached for five minutes).
|
|
|
|
|
|
const sky = me ? await loadSky() : null;
|
2026-11-15 21:00:50 +00:00
|
|
|
|
return (
|
|
|
|
|
|
<html lang="hu" className={`${cormorant.variable} ${inter.variable}`}>
|
|
|
|
|
|
<body>
|
2026-11-21 21:23:52 +00:00
|
|
|
|
<NightSky />
|
2026-11-22 10:14:15 +00:00
|
|
|
|
<ValidationMessages />
|
2026-11-24 09:17:48 +00:00
|
|
|
|
{me && <SiteHeader me={me} sky={sky} />}
|
2026-11-15 21:00:50 +00:00
|
|
|
|
{children}
|
2026-11-24 07:17:58 +00:00
|
|
|
|
{/* At the very bottom, apart from the page content: up top it drew the eye away. */}
|
|
|
|
|
|
{me?.nps_due && <NpsBanner />}
|
2026-11-24 07:21:19 +00:00
|
|
|
|
<SiteFooter loggedIn={me !== null} />
|
2026-11-20 06:41:21 +00:00
|
|
|
|
{me && (
|
|
|
|
|
|
<Suspense fallback={null}>
|
|
|
|
|
|
<PaymentReturn />
|
|
|
|
|
|
</Suspense>
|
|
|
|
|
|
)}
|
2026-11-15 21:00:50 +00:00
|
|
|
|
</body>
|
|
|
|
|
|
</html>
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|