fix: logo w stopce nawiguje na stronę główną z podstron
Logo miało href="#", więc na /privacy i /platforma klikało w pustkę — ta sama usterka co wcześniej w linkach "Oferta"/"Kontakt" w tym samym pliku. Cel to teraz "/", a onClick przechwytuje klik na samej stronie głównej i przewija płynnie do góry, zamiast przeładowywać stronę. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
f3fb0a244d
commit
f062e23dba
|
|
@ -2,13 +2,24 @@ import React from 'react';
|
||||||
|
|
||||||
const Footer = () => {
|
const Footer = () => {
|
||||||
const currentYear = new Date().getFullYear();
|
const currentYear = new Date().getFullYear();
|
||||||
|
|
||||||
|
// Same reasoning as the /#section nav links below: this footer is shared with
|
||||||
|
// /privacy and /platforma, so the logo needs a real href to get home from
|
||||||
|
// there. On the homepage that href would mean a full reload, so intercept the
|
||||||
|
// click and scroll to the top instead.
|
||||||
|
const handleLogoClick = (e: React.MouseEvent<HTMLAnchorElement>) => {
|
||||||
|
if (window.location.pathname !== '/') return;
|
||||||
|
e.preventDefault();
|
||||||
|
window.scrollTo({ top: 0, behavior: 'smooth' });
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<footer className="py-12 border-t border-white/5 bg-background">
|
<footer className="py-12 border-t border-white/5 bg-background">
|
||||||
<div className="container mx-auto px-6">
|
<div className="container mx-auto px-6">
|
||||||
<div className="grid md:grid-cols-4 gap-12 mb-12">
|
<div className="grid md:grid-cols-4 gap-12 mb-12">
|
||||||
<div className="col-span-2">
|
<div className="col-span-2">
|
||||||
<a href="#" className="text-2xl font-bold tracking-tight mb-4 block">
|
<a href="/" onClick={handleLogoClick} className="text-2xl font-bold tracking-tight mb-4 block">
|
||||||
human<span className="text-primary">AI</span>
|
human<span className="text-primary">AI</span>
|
||||||
</a>
|
</a>
|
||||||
<p className="text-muted max-w-xs mb-6">
|
<p className="text-muted max-w-xs mb-6">
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue