Session 17: Audit response — checkout 401 fix, hero prop 404 fix, Slate parsing fix, ALL tab cascade isolation, cookie/nav/footer/autocomplete polish (1438 tests)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
'use client';
|
||||
|
||||
import { useState } from 'react';
|
||||
import { usePathname } from 'next/navigation';
|
||||
import { useAuth } from '@/contexts/AuthContext';
|
||||
import Wordmark from '@/components/Wordmark';
|
||||
import NotificationBell from '@/components/NotificationBell';
|
||||
@@ -10,6 +11,13 @@ import { useT } from '@/contexts/LocaleContext';
|
||||
export default function Nav() {
|
||||
const { user, tier, scansRemaining, signOut } = useAuth();
|
||||
const t = useT();
|
||||
const pathname = usePathname() || '';
|
||||
// Session 17 — read counter sits in the global nav, but the audit
|
||||
// flagged it as noise outside the scan flow. Restrict it to /scan
|
||||
// and /dashboard (where the slate-scan lives) so it acts as a
|
||||
// quota indicator next to the action it gates, not a chrome pill.
|
||||
const showReadCounter = pathname === '/scan' || pathname.startsWith('/scan/')
|
||||
|| pathname === '/dashboard' || pathname.startsWith('/dashboard/');
|
||||
const [mobileOpen, setMobileOpen] = useState(false);
|
||||
const [menuOpen, setMenuOpen] = useState(false);
|
||||
|
||||
@@ -104,7 +112,7 @@ export default function Nav() {
|
||||
|
||||
{user ? (
|
||||
<div style={{ position: 'relative', display: 'inline-flex', alignItems: 'center', gap: 10 }}>
|
||||
{scansRemaining != null && tier === 'free' && (
|
||||
{showReadCounter && scansRemaining != null && tier === 'free' && (
|
||||
<span
|
||||
className="mono"
|
||||
style={{
|
||||
|
||||
Reference in New Issue
Block a user