A footer on every page

The root layout draws one footer for every page (the app pages, the
chart page and admin had none): the free content pages, Kapcsolat (the
feedback page when logged in, /kapcsolat otherwise), ÁSZF, Adatvédelem,
and Belépés when logged out. The pages drop their own; the home page
keeps its payment partners above it. The recommendation box sits right
before it on every page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
feco
2026-11-24 07:21:19 +00:00
co-authored by Claude Opus 5.5
parent 2eaae68271
commit 3a38518d07
14 changed files with 35 additions and 61 deletions
@@ -1,20 +1,15 @@
"use client";
import { usePathname } from "next/navigation";
import { useEffect, useState } from "react";
import { useState } from "react";
import { api, errorText } from "@/lib/api";
/**
* "Would you recommend us?" (0–10), once, as a box at the bottom of the page,
* after its content (no pop-up, no e-mail). Not on pages with the public
* footer (it would come under it): the next app page shows it. Closing it
* after its content and before the footer (no pop-up, no e-mail). Closing it
* counts: it does not come again.
*/
export function NpsBanner() {
const pathname = usePathname();
const [footer, setFooter] = useState(true);
useEffect(() => setFooter(document.querySelector(".lp-footer") !== null), [pathname]);
const [shown, setShown] = useState(true);
const [score, setScore] = useState<number | null>(null);
const [comment, setComment] = useState("");
@@ -41,7 +36,7 @@ export function NpsBanner() {
}
}
if (!shown || footer) return null;
if (!shown) return null;
if (thanks) {
return (
<aside className="nps" aria-label="Köszönjük">
@@ -2,10 +2,14 @@ import Link from "next/link";
import { Logo } from "@/components/SiteHeader";
/** The footer of the public content pages (calculator, signs): their links help visitors and search engines. */
export function PublicFooter() {
/**
* The footer of every page (the root layout draws it): the free content
* pages (they help visitors and search engines), contact and the legal
* pages. Contact leads a logged-in user straight to the feedback page.
*/
export function SiteFooter({ loggedIn }: { loggedIn: boolean }) {
return (
<footer className="lp-footer">
<footer className="lp-footer site-footer">
<div className="lp-wrap lp-footer-inner">
<Logo />
<nav aria-label="Lábléc" className="lp-footer-nav">
@@ -16,9 +20,10 @@ export function PublicFooter() {
<Link href="/retrograd">Retrográd bolygók</Link>
<Link href="/pelda">Példaelemzés</Link>
<Link href="/kartyajoslas/pelda">Példajóslás</Link>
<Link href="/kapcsolat">Kapcsolat</Link>
<Link href={loggedIn ? "/visszajelzes" : "/kapcsolat"}>Kapcsolat</Link>
<Link href="/aszf">ÁSZF</Link>
<Link href="/adatvedelem">Adatvédelem</Link>
{!loggedIn && <Link href="/belepes">Belépés</Link>}
</nav>
<span className="hint">© {new Date().getFullYear()} Sorsfonalak</span>
</div>