mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-15 10:43:07 +00:00
106 arquivos flat -> 15 dominios (actionPlan, advisor, auth, dashboard, demand, invite, leadership, map, municipality, organization, stateDeputy, supporter, votePledge, shared, shell) via git mv; imports absolutos reescritos em 98 arquivos; excecao de lint do campaign-logo e paths dos specs de contrato (campaignInviteUi, campaignComponents) atualizados. Sem mudanca de conteudo nos componentes.
45 lines
1.5 KiB
TypeScript
45 lines
1.5 KiB
TypeScript
'use client'
|
|
|
|
import Link from 'next/link'
|
|
import { usePathname } from 'next/navigation'
|
|
|
|
import { getCampaignBottomNav, isCampaignNavActive } from '@/components/campaign/shell/nav'
|
|
import { cn } from '@/lib/utils'
|
|
import type { CampaignUser } from '@/payload-types'
|
|
|
|
export const CampaignBottomNav = ({ role }: { role: CampaignUser['role'] }) => {
|
|
const pathname = usePathname()
|
|
const navItems = getCampaignBottomNav(role)
|
|
|
|
return (
|
|
<nav
|
|
aria-label="Navegação principal"
|
|
className="fixed inset-x-0 bottom-0 border-t bg-background pb-[env(safe-area-inset-bottom)] md:hidden print:hidden"
|
|
>
|
|
<ul
|
|
className="m-0 grid list-none p-0"
|
|
style={{ gridTemplateColumns: `repeat(${navItems.length}, minmax(0, 1fr))` }}
|
|
>
|
|
{navItems.map((item) => {
|
|
const active = isCampaignNavActive(pathname, item.href)
|
|
|
|
return (
|
|
<li key={item.href} className="m-0 p-0">
|
|
<Link
|
|
href={item.href}
|
|
aria-current={active ? 'page' : undefined}
|
|
className={cn(
|
|
'flex min-h-12 flex-col items-center justify-center gap-0.5 px-3 py-1.5 text-xs font-medium text-muted-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring',
|
|
active && 'text-primary',
|
|
)}
|
|
>
|
|
<item.icon aria-hidden="true" />
|
|
<span>{item.title}</span>
|
|
</Link>
|
|
</li>
|
|
)
|
|
})}
|
|
</ul>
|
|
</nav>
|
|
)
|
|
}
|