b269411823
- Giriş: satır içi doğrulama, şifre göster/gizle, beni hatırla, hoş geldin bildirimi - Kayıt: yeni hane kur / davetle katıl, /kayit?davet=KOD bağlantısı - Sunucu hataları ilgili alanda gösterilir (kayıtlı e-posta, geçersiz davet) - react-hook-form + zod, sonner bildirimleri, shadcn input/label/checkbox/card - Ortak form bileşenleri (FormField, PasswordInput, FormError) - 8 form kuralı testi (toplam 47); api.http demo hesaplara güncellendi - Faz 2 tamamlandı Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
55 lines
2.1 KiB
TypeScript
55 lines
2.1 KiB
TypeScript
import { createBrowserRouter, type RouteObject } from 'react-router'
|
||
import { AppLayout } from '@/components/layout/app-layout'
|
||
import { paths } from '@/components/layout/nav-items'
|
||
import { RequireAuth, RequireGuest } from '@/components/layout/require-auth'
|
||
import { LoginPage } from '@/features/auth/login-page'
|
||
import { RegisterPage } from '@/features/auth/register-page'
|
||
import { DashboardPage } from '@/features/dashboard/page'
|
||
import { DesignPreview } from '@/features/dev/design-preview'
|
||
import { NotFoundPage } from '@/features/errors/not-found-page'
|
||
import { LedgerPage } from '@/features/ledger/page'
|
||
import { MorePage } from '@/features/more/page'
|
||
import { PlanningPage } from '@/features/planning/page'
|
||
import { ReportsPage } from '@/features/reports/page'
|
||
import { ReviewPage } from '@/features/review/page'
|
||
import { SavingsPage } from '@/features/savings/page'
|
||
import { SettingsPage } from '@/features/settings/page'
|
||
|
||
const routes: RouteObject[] = [
|
||
// Oturumsuz
|
||
{
|
||
element: <RequireGuest />,
|
||
children: [
|
||
{ path: paths.login, element: <LoginPage /> },
|
||
{ path: paths.register, element: <RegisterPage /> },
|
||
],
|
||
},
|
||
// Oturumlu (iskelet: kenar çubuğu / alt menü)
|
||
{
|
||
element: <RequireAuth />,
|
||
children: [
|
||
{
|
||
element: <AppLayout />,
|
||
children: [
|
||
{ index: true, element: <DashboardPage /> },
|
||
{ path: paths.ledger, element: <LedgerPage /> },
|
||
{ path: paths.planning, element: <PlanningPage /> },
|
||
{ path: paths.savings, element: <SavingsPage /> },
|
||
{ path: paths.review, element: <ReviewPage /> },
|
||
{ path: paths.reports, element: <ReportsPage /> },
|
||
{ path: paths.settings, element: <SettingsPage /> },
|
||
{ path: paths.more, element: <MorePage /> },
|
||
{ path: '*', element: <NotFoundPage /> },
|
||
],
|
||
},
|
||
],
|
||
},
|
||
]
|
||
|
||
// Tasarım önizlemesi yalnızca geliştirmede (canlı derlemeye girmez)
|
||
if (import.meta.env.DEV) {
|
||
routes.unshift({ path: '/dev/tasarim', element: <DesignPreview /> })
|
||
}
|
||
|
||
export const router = createBrowserRouter(routes)
|