wacrm/src/components/docs/sidebar.tsx
Arnas Donauskas 77dfa4f165
chore: switch accent palette to Hostinger violet, drop emerald green
The legal brief on third-party trademark use says: avoid the WhatsApp
teal/green palette and any visual treatment that could read as a
WhatsApp/Meta product. Emerald-500 was used as the primary brand colour
across hero, CTAs, sidebar, charts, badges, and the favicon — close
enough in hue to WhatsApp's signature green to muddy the line.

Swapping to Tailwind violet (which matches the Hostinger brand purple
#7c3aed) makes the visual identity unambiguously ours.

Scope:
- Mechanical Tailwind class swap: emerald-* → violet-* across src/.
- src/app/globals.css: --primary, --ring, --sidebar-primary, --sidebar-ring,
  --chart-1 oklch tokens swapped from emerald (oklch 0.696 0.17 162) to
  Hostinger-aligned violet (oklch 0.526 0.247 293).
- src/app/icon.tsx: favicon background #10b981 → #7c3aed.
- src/app/opengraph-image.tsx: badge bg, accent text, gradient.
- src/components/landing/hero.tsx + cta-banner.tsx: radial-gradient hex.
- src/components/landing/mock/analytics-mock.tsx: marketing chart line.
- src/components/dashboard/conversations-chart.tsx + response-time-chart.tsx:
  "Outgoing" series colour. Distinguishable from "Incoming" blue at a
  glance; we can revisit the chart pair later for stronger colourblind
  contrast (separate concern).
- README.md: license badge colour parameter.

Out of scope:
- src/components/settings/tag-manager.tsx still offers "Emerald" as one
  of the user-pickable contact-tag colours alongside Blue / Yellow / Red
  / etc. — that's a user data choice, not a brand mark.

Contrast check: white text on #7c3aed measures ~4.78:1 (WCAG AA passing
for normal body text). Violet-400 (#a78bfa) on slate-950 measures ~10:1
for accent text, well clear of AA.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-06 11:57:12 +03:00

69 lines
2.0 KiB
TypeScript

"use client"
import Link from 'next/link'
import { usePathname } from 'next/navigation'
import { cn } from '@/lib/utils'
import type { DocPage } from '@/lib/docs/content'
interface DocsSidebarProps {
pages: DocPage[]
onNavigate?: () => void
}
export function DocsSidebar({ pages, onNavigate }: DocsSidebarProps) {
const pathname = usePathname()
const sections: Record<string, DocPage[]> = {}
for (const p of pages) {
sections[p.section] ??= []
sections[p.section].push(p)
}
return (
<nav aria-label="Documentation" className="flex flex-col gap-6 text-sm">
<Link
href="/docs"
onClick={onNavigate}
className={cn(
'flex items-center justify-between rounded-md px-3 py-2 transition-colors',
pathname === '/docs'
? 'bg-slate-800 text-white'
: 'text-slate-300 hover:bg-slate-800/60 hover:text-white',
)}
>
<span>Overview</span>
</Link>
{Object.entries(sections).map(([section, items]) => (
<div key={section}>
<p className="mb-2 px-3 text-[10px] font-semibold uppercase tracking-wider text-slate-500">
{section}
</p>
<ul className="flex flex-col gap-0.5">
{items.map((p) => {
const href = `/docs/${p.slug}`
const active = pathname === href
return (
<li key={p.slug}>
<Link
href={href}
onClick={onNavigate}
className={cn(
'block rounded-md px-3 py-1.5 transition-colors',
active
? 'bg-violet-500/10 text-violet-300'
: 'text-slate-400 hover:bg-slate-800/60 hover:text-white',
)}
>
{p.title}
</Link>
</li>
)
})}
</ul>
</div>
))}
</nav>
)
}