refactor: replace all legacy settings links with unified modal openers

This commit is contained in:
Usman Baig
2026-03-26 10:47:51 +01:00
parent 5165b885ff
commit 61a106eed6
7 changed files with 65 additions and 26 deletions

View File

@@ -4,7 +4,6 @@ import Link from 'next/link'
import { usePathname } from 'next/navigation'
import { motion } from 'framer-motion'
import { useTabListKeyboard } from '@/lib/hooks/useTabListKeyboard'
import { useAuth } from '@/lib/auth/context'
interface SiteNavProps {
siteId: string
@@ -13,8 +12,6 @@ interface SiteNavProps {
export default function SiteNav({ siteId }: SiteNavProps) {
const pathname = usePathname()
const handleTabKeyDown = useTabListKeyboard()
const { user } = useAuth()
const canEdit = user?.role === 'owner' || user?.role === 'admin'
const tabs = [
{ label: 'Dashboard', href: `/sites/${siteId}` },
@@ -24,7 +21,6 @@ export default function SiteNav({ siteId }: SiteNavProps) {
{ label: 'Search', href: `/sites/${siteId}/search` },
{ label: 'CDN', href: `/sites/${siteId}/cdn` },
{ label: 'Uptime', href: `/sites/${siteId}/uptime` },
...(canEdit ? [{ label: 'Settings', href: `/sites/${siteId}/settings` }] : []),
]
const isActive = (href: string) => {