Session 24: Connect everything — Slate wired to all sources, copy fixed, nav fixed, startup prefetch, language button removed (1571 tests)
This commit is contained in:
@@ -5,7 +5,10 @@ import { usePathname } from 'next/navigation';
|
||||
import { useAuth } from '@/contexts/AuthContext';
|
||||
import Wordmark from '@/components/Wordmark';
|
||||
import NotificationBell from '@/components/NotificationBell';
|
||||
import LocaleSwitcher from '@/components/LocaleSwitcher';
|
||||
// Session 24 — LocaleSwitcher removed from the nav. The i18n
|
||||
// infrastructure (react-i18next, LocaleContext, useT) stays in place,
|
||||
// but a visible language toggle with no translations behind it is
|
||||
// worse than none. Re-add the switcher when translations land.
|
||||
import { useT } from '@/contexts/LocaleContext';
|
||||
|
||||
export default function Nav() {
|
||||
@@ -27,10 +30,16 @@ export default function Nav() {
|
||||
// /dashboard IS the scan surface (click [Read] on any prop). The
|
||||
// /scan page still exists as a fallback for custom props and is
|
||||
// reachable from the slate's "Scan manually" empty-state CTA.
|
||||
// Session 24 — paid users (analyst / desk) get "Account" where free
|
||||
// users and signed-out visitors see "Pricing". A subscriber shouldn't
|
||||
// be pitched a plan they already pay for.
|
||||
const isPaid = !!user && tier !== 'free';
|
||||
const NAV_LINKS = [
|
||||
{ label: t('nav.tracker'), href: '/tracker' },
|
||||
{ label: t('nav.ledger'), href: '/ledger' },
|
||||
{ label: t('nav.pricing'), href: '/pricing' },
|
||||
isPaid
|
||||
? { label: 'Account', href: '/account' }
|
||||
: { label: t('nav.pricing'), href: '/pricing' },
|
||||
{ label: 'Blog', href: '/blog' },
|
||||
];
|
||||
|
||||
@@ -124,7 +133,6 @@ export default function Nav() {
|
||||
</span>
|
||||
)}
|
||||
<NotificationBell />
|
||||
<LocaleSwitcher />
|
||||
<button
|
||||
onClick={() => setMenuOpen((o) => !o)}
|
||||
aria-haspopup="menu"
|
||||
@@ -198,7 +206,6 @@ export default function Nav() {
|
||||
</div>
|
||||
) : (
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
|
||||
<LocaleSwitcher />
|
||||
<a href="/login" className="btn-primary" style={{ padding: '8px 16px', fontSize: 13 }}>
|
||||
{t('nav.login')}
|
||||
</a>
|
||||
|
||||
Reference in New Issue
Block a user