feat: floating contact bar, remove pricing contact links, fix admin hooks

- Add FloatingContact bar (Записаться + Instagram) visible while scrolling
- Hides on hero and near contact section, centered at bottom
- Move BackToTop button up to avoid overlap
- Remove redundant ContactHint from Pricing section (floating bar covers it)
- Fix React hooks order violation in AdminLayout (early return before useEffect)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-20 13:35:36 +03:00
parent 1bfd502930
commit 96e3333e9f
5 changed files with 79 additions and 49 deletions

View File

@@ -51,15 +51,11 @@ export default function AdminLayout({
const router = useRouter();
const [sidebarOpen, setSidebarOpen] = useState(false);
const [unreadTotal, setUnreadTotal] = useState(0);
// Don't render admin shell on login page
if (pathname === "/admin/login") {
return <>{children}</>;
}
const isLoginPage = pathname === "/admin/login";
// Fetch unread counts — poll every 30s
// eslint-disable-next-line react-hooks/rules-of-hooks
useEffect(() => {
if (isLoginPage) return;
function fetchCounts() {
adminFetch("/api/admin/unread-counts")
.then((r) => r.json())
@@ -69,7 +65,12 @@ export default function AdminLayout({
fetchCounts();
const interval = setInterval(fetchCounts, 30000);
return () => clearInterval(interval);
}, []);
}, [isLoginPage]);
// Don't render admin shell on login page
if (isLoginPage) {
return <>{children}</>;
}
async function handleLogout() {
await fetch("/api/logout", { method: "POST" });

View File

@@ -9,6 +9,7 @@ import { News } from "@/components/sections/News";
import { FAQ } from "@/components/sections/FAQ";
import { Contact } from "@/components/sections/Contact";
import { BackToTop } from "@/components/ui/BackToTop";
import { FloatingContact } from "@/components/ui/FloatingContact";
import { Header } from "@/components/layout/Header";
import { Footer } from "@/components/layout/Footer";
import { getContent } from "@/lib/content";
@@ -42,6 +43,7 @@ export default function HomePage() {
<FAQ data={content.faq} />
<Contact data={content.contact} />
<BackToTop />
<FloatingContact />
</main>
<Footer />
</>