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:
@@ -3,7 +3,7 @@ import Link from "next/link";
|
||||
import { ChartWheel } from "@/components/ChartWheel";
|
||||
import { Rich } from "@/components/Rich";
|
||||
import { TarotCard, TarotCardBack } from "@/components/tarot/TarotCard";
|
||||
import { Logo, PublicHeader } from "@/components/SiteHeader";
|
||||
import { PublicHeader } from "@/components/SiteHeader";
|
||||
import example from "@/content/pelda.json";
|
||||
import { tarotCard } from "@/lib/tarot";
|
||||
import type { AnalysisContent, ChartResult } from "@/lib/types";
|
||||
@@ -499,30 +499,15 @@ export function Landing({ inviteOnly, loggedIn = false }: { inviteOnly: boolean;
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<footer className="lp-footer">
|
||||
<div className="lp-wrap lp-partners">
|
||||
<span className="hint">Fizetés</span>
|
||||
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||
<img src="/logos/stripe.svg" alt="Stripe" width="62" height="26" className="lp-partner" />
|
||||
<span className="hint">Számlázás</span>
|
||||
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||
<img src="/logos/billingo.svg" alt="Billingo" width="80" height="26" className="lp-partner" />
|
||||
</div>
|
||||
<div className="lp-wrap lp-footer-inner">
|
||||
<Logo />
|
||||
<nav aria-label="Lábléc" className="lp-footer-nav">
|
||||
<Link href="/szuletesi-horoszkop">Születési horoszkóp</Link>
|
||||
<Link href="/csillagjegyek">Csillagjegyek</Link>
|
||||
<Link href="/pelda">Példaelemzés</Link>
|
||||
<Link href="/kartyajoslas/pelda">Példajóslás</Link>
|
||||
<Link href="/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>
|
||||
</footer>
|
||||
{/* Who takes the payments and makes the invoices, above the common footer. */}
|
||||
<div className="lp-wrap lp-partners">
|
||||
<span className="hint">Fizetés</span>
|
||||
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||
<img src="/logos/stripe.svg" alt="Stripe" width="62" height="26" className="lp-partner" />
|
||||
<span className="hint">Számlázás</span>
|
||||
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||
<img src="/logos/billingo.svg" alt="Billingo" width="80" height="26" className="lp-partner" />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { Metadata } from "next";
|
||||
import Link from "next/link";
|
||||
import { notFound } from "next/navigation";
|
||||
|
||||
import { JsonLd, PublicFooter } from "@/components/PublicFooter";
|
||||
import { JsonLd } from "@/components/PublicFooter";
|
||||
import { PublicHeader } from "@/components/SiteHeader";
|
||||
import { ZODIAC, ZODIAC_BY_SLUG } from "@/content/zodiac";
|
||||
import { SIGNS } from "@/lib/astro";
|
||||
@@ -130,7 +130,6 @@ export default async function SignPage({ params }: { params: Promise<{ jegy: str
|
||||
<Link href={`/csillagjegyek/${next.slug}`}>{next.name} →</Link>
|
||||
</nav>
|
||||
</main>
|
||||
<PublicFooter />
|
||||
<JsonLd
|
||||
data={{
|
||||
"@context": "https://schema.org",
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import type { Metadata } from "next";
|
||||
import Link from "next/link";
|
||||
|
||||
import { PublicFooter } from "@/components/PublicFooter";
|
||||
import { PublicHeader } from "@/components/SiteHeader";
|
||||
import { ZODIAC } from "@/content/zodiac";
|
||||
import { SIGNS } from "@/lib/astro";
|
||||
@@ -46,7 +45,6 @@ export default async function SignsPage() {
|
||||
))}
|
||||
</ul>
|
||||
</main>
|
||||
<PublicFooter />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1084,6 +1084,8 @@ a.pair-row:hover strong { color: var(--gold); }
|
||||
.lp-emblem-outer { fill: none; stroke: var(--gold); stroke-opacity: 0.5; stroke-width: 1; }
|
||||
.lp-disclaimer { max-width: 560px; }
|
||||
.lp-footer { border-top: 1px solid var(--line); padding: 28px 0; }
|
||||
/* The floating "Kérdezz" button must not cover the footer's last line. */
|
||||
body:has(.qdock-fab) .site-footer { padding-bottom: 88px; }
|
||||
.lp-footer-inner { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
|
||||
.lp-footer-nav { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; }
|
||||
.lp-footer-nav a { color: var(--muted); text-decoration: none; }
|
||||
@@ -1161,7 +1163,8 @@ a.pair-row:hover strong { color: var(--gold); }
|
||||
}
|
||||
|
||||
/* Home page footer: payment and invoicing partners */
|
||||
.lp-partners { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 16px; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
|
||||
/* On the home page, right above the common footer (whose top line separates them). */
|
||||
.lp-partners { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 16px; padding: 24px 16px; }
|
||||
.lp-partner { height: 26px; width: auto; opacity: 0.65; transition: opacity 0.2s; }
|
||||
.lp-partner:hover { opacity: 1; }
|
||||
.lp-partners .hint + .lp-partner { margin-right: 18px; }
|
||||
@@ -1631,9 +1634,9 @@ span.tarot-fan-card { cursor: default; }
|
||||
.feedback-body { margin: 0; white-space: pre-line; color: var(--ink-2); }
|
||||
.feedback-reply { padding: 10px 14px; border-left: 2px solid var(--gold); background: rgba(217, 180, 106, 0.06); border-radius: 0 8px 8px 0; }
|
||||
.feedback-reply p { margin: 4px 0 0; white-space: pre-line; }
|
||||
/* At the bottom of the page; the room under it keeps the "Kérdezz" button off it. */
|
||||
/* At the bottom of the page, before the footer. */
|
||||
.nps {
|
||||
max-width: 1180px; margin: 8px auto 96px; padding: 12px 16px; display: flex; gap: 12px; align-items: flex-start;
|
||||
max-width: 1180px; margin: 8px auto 24px; padding: 12px 16px; display: flex; gap: 12px; align-items: flex-start;
|
||||
background: var(--panel); border: 1px solid rgba(217, 180, 106, 0.4); border-radius: 12px; width: calc(100% - 32px);
|
||||
}
|
||||
.nps-main { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
|
||||
|
||||
@@ -5,7 +5,7 @@ import { notFound } from "next/navigation";
|
||||
|
||||
import { AnalysisView } from "@/components/AnalysisView";
|
||||
import { ChartWheel, WheelLegend } from "@/components/ChartWheel";
|
||||
import { JsonLd, PublicFooter } from "@/components/PublicFooter";
|
||||
import { JsonLd } from "@/components/PublicFooter";
|
||||
import { PublicHeader } from "@/components/SiteHeader";
|
||||
import { SIGNS, signName } from "@/lib/astro";
|
||||
import { birthLine, celebrityImageVersion, loadCelebrity } from "@/lib/celebrities";
|
||||
@@ -135,7 +135,6 @@ export default async function CelebrityPage({ params }: Props) {
|
||||
A portrét mesterséges intelligencia írta, kizárólag a születési képlet alapján, nem az életrajz ismeretében.
|
||||
</p>
|
||||
</main>
|
||||
<PublicFooter />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ import type { Metadata } from "next";
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
|
||||
import { PublicFooter } from "@/components/PublicFooter";
|
||||
import { PublicHeader } from "@/components/SiteHeader";
|
||||
import { SIGNS, signName } from "@/lib/astro";
|
||||
import { loadCelebrities } from "@/lib/celebrities";
|
||||
@@ -69,7 +68,6 @@ export default async function CelebritiesPage() {
|
||||
</ul>
|
||||
)}
|
||||
</main>
|
||||
<PublicFooter />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import Link from "next/link";
|
||||
|
||||
import { PublicFooter } from "@/components/PublicFooter";
|
||||
import { PublicHeader } from "@/components/SiteHeader";
|
||||
import { YearNav } from "@/components/YearNav";
|
||||
import { MOON_PHASES, SIGNS } from "@/lib/astro";
|
||||
@@ -119,7 +118,6 @@ export function MoonCalendar({ year, events, sky, me }: { year: number; events:
|
||||
</p>
|
||||
</section>
|
||||
</main>
|
||||
<PublicFooter />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ import type { Metadata } from "next";
|
||||
import Link from "next/link";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
import { PublicFooter } from "@/components/PublicFooter";
|
||||
import { PublicHeader } from "@/components/SiteHeader";
|
||||
import { OPERATOR } from "@/lib/legal";
|
||||
import { getMe } from "@/lib/server";
|
||||
@@ -42,7 +41,6 @@ export default async function ContactPage() {
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
<PublicFooter />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import { Suspense } from "react";
|
||||
import { NightSky } from "@/components/NightSky";
|
||||
import { NpsBanner } from "@/components/NpsBanner";
|
||||
import { PaymentReturn } from "@/components/PaymentReturn";
|
||||
import { SiteFooter } from "@/components/PublicFooter";
|
||||
import { SiteHeader } from "@/components/SiteHeader";
|
||||
import { ValidationMessages } from "@/components/ValidationMessages";
|
||||
import { getMe } from "@/lib/server";
|
||||
@@ -39,6 +40,7 @@ export default async function RootLayout({ children }: { children: React.ReactNo
|
||||
{children}
|
||||
{/* At the very bottom, apart from the page content: up top it drew the eye away. */}
|
||||
{me?.nps_due && <NpsBanner />}
|
||||
<SiteFooter loggedIn={me !== null} />
|
||||
{me && (
|
||||
<Suspense fallback={null}>
|
||||
<PaymentReturn />
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import Link from "next/link";
|
||||
|
||||
import { PublicFooter } from "@/components/PublicFooter";
|
||||
import { PublicHeader } from "@/components/SiteHeader";
|
||||
import { YearNav } from "@/components/YearNav";
|
||||
import { POINTS } from "@/lib/astro";
|
||||
@@ -112,7 +111,6 @@ export function RetrogradeCalendar({
|
||||
</p>
|
||||
</section>
|
||||
</main>
|
||||
<PublicFooter />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { Metadata } from "next";
|
||||
import Link from "next/link";
|
||||
|
||||
import { JsonLd, PublicFooter } from "@/components/PublicFooter";
|
||||
import { JsonLd } from "@/components/PublicFooter";
|
||||
import { PublicHeader } from "@/components/SiteHeader";
|
||||
import { getMe } from "@/lib/server";
|
||||
import { siteUrl } from "@/lib/share";
|
||||
@@ -92,7 +92,6 @@ export default async function BirthChartPage() {
|
||||
))}
|
||||
</section>
|
||||
</main>
|
||||
<PublicFooter />
|
||||
<JsonLd
|
||||
data={{
|
||||
"@context": "https://schema.org",
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user