diff --git a/src/app/dashboard/layout.tsx b/src/app/dashboard/layout.tsx index a2f41ba..3b20fe3 100644 --- a/src/app/dashboard/layout.tsx +++ b/src/app/dashboard/layout.tsx @@ -1,15 +1,22 @@ +'use client' + import { MainNav } from "@/components/main-nav" import { UserNav } from "@/components/user-nav" -import { Building } from "lucide-react" +import { Building, Menu } from "lucide-react" +import { Sheet, SheetContent, SheetTrigger } from "@/components/ui/sheet" +import { Button } from "@/components/ui/button" +import { useState } from "react" export default function DashboardLayout({ children, }: { children: React.ReactNode }) { + const [isMobileOpen, setIsMobileOpen] = useState(false) + return (
- {/* Sidebar */} + {/* Desktop Sidebar */} @@ -17,10 +24,23 @@ export default function DashboardLayout({ {/* Main Content */}
{/* Header */} -
-
- - WeddingOS +
+
+ + + + + + setIsMobileOpen(false)} /> + + +
+ + WeddingOS +
@@ -29,7 +49,7 @@ export default function DashboardLayout({
{/* Page Content */} -
+
{children}
diff --git a/src/components/calendar-view.tsx b/src/components/calendar-view.tsx index 3eb3f15..550b921 100644 --- a/src/components/calendar-view.tsx +++ b/src/components/calendar-view.tsx @@ -7,7 +7,7 @@ import startOfWeek from 'date-fns/startOfWeek' import getDay from 'date-fns/getDay' import tr from 'date-fns/locale/tr' import "react-big-calendar/lib/css/react-big-calendar.css" -import { useState, useMemo } from 'react' +import { useState, useMemo, useEffect } from 'react' import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card' import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select" import { useRouter } from 'next/navigation' @@ -40,6 +40,14 @@ export function CalendarView({ events = [], halls = [] }: CalendarViewProps) { const [view, setView] = useState(Views.MONTH) const [date, setDate] = useState(new Date()) const [selectedHallId, setSelectedHallId] = useState("all") + const [isMobile, setIsMobile] = useState(false) + + useEffect(() => { + const checkMobile = () => setIsMobile(window.innerWidth < 768) + checkMobile() + window.addEventListener('resize', checkMobile) + return () => window.removeEventListener('resize', checkMobile) + }, []) const filteredEvents = useMemo(() => { if (selectedHallId === "all") return events @@ -51,19 +59,14 @@ export function CalendarView({ events = [], halls = [] }: CalendarViewProps) { } const handleSelectSlot = ({ start, end }: { start: Date, end: Date }) => { - // Optional: Navigate to create page with pre-filled dates - // const params = new URLSearchParams() - // params.set('date', format(start, 'yyyy-MM-dd')) - // params.set('start', format(start, 'HH:mm')) - // params.set('end', format(end, 'HH:mm')) - // router.push(`/dashboard/reservations/new?${params.toString()}`) + // Optional: Navigate to create page } return ( - - + + Rezervasyon Takvimi -
+
- + - ({ - className: "bg-primary text-primary-foreground text-xs rounded-md border-none px-2 py-1 shadow-sm hover:bg-primary/90 transition-colors cursor-pointer" - })} - /> +
+
+ ({ + className: "bg-primary text-primary-foreground text-xs rounded-md border-none px-2 py-1 shadow-sm hover:bg-primary/90 transition-colors cursor-pointer" + })} + /> +
+
router.push('/dashboard/reservations/new')}> diff --git a/src/components/main-nav.tsx b/src/components/main-nav.tsx index 27bd0ec..0fae936 100644 --- a/src/components/main-nav.tsx +++ b/src/components/main-nav.tsx @@ -6,10 +6,15 @@ import { cn } from "@/lib/utils" import { Button } from "@/components/ui/button" import { CalendarDays, Users, Home, Settings, Building2, CreditCard, LogOut } from "lucide-react" +interface MainNavProps extends React.HTMLAttributes { + onNavClick?: () => void +} + export function MainNav({ className, + onNavClick, ...props -}: React.HTMLAttributes) { +}: MainNavProps) { const pathname = usePathname() const routes = [ @@ -65,7 +70,7 @@ export function MainNav({
{routes.map((route) => ( - +