feat: enhance landing page, Telegram webhook, SEO suite, and cookie consent banner

This commit is contained in:
ayrisdev
2026-08-22 22:57:03 +03:00
parent 5ac5988a3a
commit 61dd85133c
26 changed files with 3264 additions and 896 deletions
+55 -45
View File
@@ -2,74 +2,82 @@
import { signOut } from 'next-auth/react'
import Link from 'next/link'
import { usePathname } from 'next/navigation'
import Image from 'next/image'
import { usePathname, useParams } from 'next/navigation'
import { LayoutDashboard, Users, Settings, LogOut, Menu, X } from 'lucide-react'
import { useState } from 'react'
export default function AdminLayout({ children }: { children: React.ReactNode }) {
const pathname = usePathname()
const params = useParams()
const locale = (params?.locale as string) || 'tr'
const [sidebarOpen, setSidebarOpen] = useState(false)
const navigation = [
{ name: 'Dashboard', href: '/admin', icon: LayoutDashboard },
{ name: 'Kullanıcılar', href: '/admin/users', icon: Users },
{ name: 'Ayarlar', href: '/admin/settings', icon: Settings },
{ name: 'Dashboard', href: `/${locale}/admin`, icon: LayoutDashboard },
{ name: 'Kullanıcılar', href: `/${locale}/admin/users`, icon: Users },
{ name: 'Ayarlar', href: `/${locale}/admin/settings`, icon: Settings },
]
return (
<div className="min-h-screen bg-gray-50 dark:bg-gray-900 flex">
<div className="min-h-screen bg-zinc-50 flex">
{/* Mobile sidebar backdrop */}
{sidebarOpen && (
<div
className="fixed inset-0 z-40 bg-gray-900/80 lg:hidden"
className="fixed inset-0 z-40 bg-zinc-950/60 lg:hidden"
onClick={() => setSidebarOpen(false)}
/>
)}
{/* Sidebar */}
<div className={`
fixed inset-y-0 left-0 z-50 w-64 bg-white dark:bg-gray-950 border-r border-gray-200 dark:border-gray-800
fixed inset-y-0 left-0 z-50 w-64 bg-white border-r border-zinc-200
transform transition-transform duration-200 ease-in-out lg:translate-x-0 lg:static lg:inset-0
${sidebarOpen ? 'translate-x-0' : '-translate-x-full'}
`}>
<div className="h-full flex flex-col">
<div className="h-16 flex items-center px-6 border-b border-gray-200 dark:border-gray-800">
<h1 className="text-lg font-bold text-gray-900 dark:text-white">Admin Paneli</h1>
<button
className="ml-auto lg:hidden text-gray-500"
onClick={() => setSidebarOpen(false)}
>
<X className="h-5 w-5" />
</button>
<div className="h-full flex flex-col justify-between">
<div>
<div className="h-16 flex items-center justify-between px-6 border-b border-zinc-100">
<Link href={`/${locale}`} className="flex items-center gap-2">
<Image src="/logo.png" alt="AyrisLegal" width={110} height={22} className="h-5 w-auto object-contain" priority />
</Link>
<button
className="lg:hidden text-zinc-500 hover:text-zinc-900"
onClick={() => setSidebarOpen(false)}
aria-label="Menüyü Kapat"
>
<X className="h-5 w-5" />
</button>
</div>
<nav className="px-4 py-6 space-y-1 overflow-y-auto">
{navigation.map((item) => {
const isActive = pathname === item.href || (item.href !== `/${locale}/admin` && pathname.startsWith(item.href))
return (
<Link
key={item.name}
href={item.href}
className={`
flex items-center px-3.5 py-2.5 text-sm font-semibold rounded-xl transition-all
${isActive
? 'bg-[#FDEEEC] text-[#B8140F]'
: 'text-zinc-600 hover:bg-zinc-100/70 hover:text-zinc-900'}
`}
>
<item.icon className={`mr-3 flex-shrink-0 h-4 w-4 ${isActive ? 'text-[#B8140F]' : 'text-zinc-500'}`} />
{item.name}
</Link>
)
})}
</nav>
</div>
<nav className="flex-1 px-4 py-6 space-y-1 overflow-y-auto">
{navigation.map((item) => {
const isActive = pathname.endsWith(item.href)
return (
<Link
key={item.name}
href={item.href}
className={`
flex items-center px-3 py-2.5 text-sm font-medium rounded-md transition-colors
${isActive
? 'bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white'
: 'text-gray-600 dark:text-gray-400 hover:bg-gray-50 dark:hover:bg-gray-800 hover:text-gray-900 dark:hover:text-white'}
`}
>
<item.icon className={`mr-3 flex-shrink-0 h-5 w-5 ${isActive ? 'text-gray-900 dark:text-white' : 'text-gray-400'}`} />
{item.name}
</Link>
)
})}
</nav>
<div className="p-4 border-t border-gray-200 dark:border-gray-800">
<div className="p-4 border-t border-zinc-100">
<button
onClick={() => signOut({ callbackUrl: '/' })}
className="flex w-full items-center px-3 py-2.5 text-sm font-medium text-red-600 dark:text-red-400 rounded-md hover:bg-red-50 dark:hover:bg-red-950/30 transition-colors"
onClick={() => signOut({ callbackUrl: `/${locale}` })}
className="flex w-full items-center px-3.5 py-2.5 text-sm font-semibold text-zinc-700 hover:text-[#B8140F] rounded-xl hover:bg-[#FDEEEC] transition-colors"
>
<LogOut className="mr-3 h-5 w-5" />
<LogOut className="mr-3 h-4 w-4" />
Çıkış Yap
</button>
</div>
@@ -78,17 +86,19 @@ export default function AdminLayout({ children }: { children: React.ReactNode })
{/* Main content */}
<div className="flex-1 flex flex-col min-w-0 overflow-hidden">
<header className="h-16 flex items-center lg:hidden bg-white dark:bg-gray-950 border-b border-gray-200 dark:border-gray-800 px-4">
<header className="h-16 flex items-center justify-between lg:hidden bg-white border-b border-zinc-200 px-4">
<button
onClick={() => setSidebarOpen(true)}
className="text-gray-500 hover:text-gray-900 dark:hover:text-white focus:outline-none"
className="text-zinc-600 hover:text-zinc-900 focus:outline-none"
aria-label="Menüyü Aç"
>
<Menu className="h-6 w-6" />
</button>
<span className="ml-4 text-lg font-bold text-gray-900 dark:text-white">Admin Paneli</span>
<span className="text-sm font-bold text-zinc-900">Admin Paneli</span>
<div className="w-6" />
</header>
<main className="flex-1 overflow-y-auto p-4 sm:p-6 lg:p-8">
<main className="flex-1 overflow-y-auto p-5 sm:p-8 max-w-[1400px]">
{children}
</main>
</div>
+16 -19
View File
@@ -4,41 +4,38 @@ export default async function AdminDashboardPage() {
const session = await auth()
return (
<div className="space-y-6">
<div className="space-y-8">
<div>
<h2 className="text-2xl font-bold tracking-tight text-gray-900 dark:text-white">Dashboard</h2>
<p className="text-gray-500 dark:text-gray-400 mt-2">
Hoş geldiniz, {session?.user?.name || session?.user?.email}. İşte projenizin genel görünümü.
<h1 className="text-2xl font-extrabold tracking-tight text-zinc-950">Yönetim Paneli</h1>
<p className="text-zinc-600 text-sm mt-1.5">
Hoş geldiniz, <span className="font-semibold text-zinc-900">{session?.user?.name || session?.user?.email}</span>. İşte platformun genel görünümü.
</p>
</div>
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4">
{/* Placeholder Stat Cards */}
{[
{ name: 'Toplam Kullanıcı', stat: '1,245' },
{ name: 'Aktif Oturumlar', stat: '42' },
{ name: 'Yeni Kayıtlar', stat: '8' },
{ name: 'Sistem Durumu', stat: 'Online' },
{ name: 'Toplam Demo Talebi', stat: '28' },
{ name: 'Aktif Pilot Bürolar', stat: '14' },
{ name: 'Haftalık Analiz Sayısı', stat: '342' },
{ name: 'Sistem Durumu', stat: 'Aktif / Çevrimiçi' },
].map((item) => (
<div
key={item.name}
className="overflow-hidden rounded-lg bg-white dark:bg-gray-950 border border-gray-200 dark:border-gray-800 px-4 py-5 shadow-sm sm:p-6"
className="overflow-hidden rounded-2xl bg-white border border-zinc-200/80 p-5 shadow-sm"
>
<dt className="truncate text-sm font-medium text-gray-500 dark:text-gray-400">{item.name}</dt>
<dd className="mt-1 text-3xl font-semibold tracking-tight text-gray-900 dark:text-white">
<dt className="truncate text-xs font-bold uppercase tracking-wide text-zinc-500">{item.name}</dt>
<dd className="mt-2 text-2xl font-extrabold tracking-tight text-zinc-950 font-mono">
{item.stat}
</dd>
</div>
))}
</div>
<div className="rounded-lg bg-white dark:bg-gray-950 border border-gray-200 dark:border-gray-800 shadow-sm">
<div className="p-6">
<h3 className="text-lg font-medium text-gray-900 dark:text-white">Son Aktiviteler</h3>
<div className="mt-4 border-t border-gray-100 dark:border-gray-800">
<div className="py-4 text-sm text-gray-500">
Henüz aktivite kaydı bulunmuyor.
</div>
<div className="rounded-2xl bg-white border border-zinc-200/80 p-6 shadow-sm">
<h2 className="text-base font-bold text-zinc-950">Son Aktiviteler &amp; Demo Başvuruları</h2>
<div className="mt-4 border-t border-zinc-100 divide-y divide-zinc-100">
<div className="py-4 text-sm text-zinc-500">
Henüz bekleyen aktivite kaydı bulunmuyor. Yeni talepler anlık olarak burada listelenecektir.
</div>
</div>
</div>