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:
@@ -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" });
|
||||
|
||||
Reference in New Issue
Block a user