feat: implement localStorage persistence for user preferences in categories, statistics, transactions, and sidebar components; enhance UI with collapsible elements and improved layout
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
import Link from "next/link";
|
||||
import { usePathname, useRouter } from "next/navigation";
|
||||
import { signOut } from "next-auth/react";
|
||||
@@ -21,6 +20,7 @@ import {
|
||||
import { toast } from "sonner";
|
||||
import { Sheet, SheetContent } from "@/components/ui/sheet";
|
||||
import { useIsMobile } from "@/hooks/use-mobile";
|
||||
import { useLocalStorage } from "@/hooks/use-local-storage";
|
||||
|
||||
const navItems = [
|
||||
{ href: "/", label: "Tableau de bord", icon: LayoutDashboard },
|
||||
@@ -158,7 +158,7 @@ interface SidebarProps {
|
||||
}
|
||||
|
||||
export function Sidebar({ open, onOpenChange }: SidebarProps) {
|
||||
const [collapsed, setCollapsed] = useState(false);
|
||||
const [collapsed, setCollapsed] = useLocalStorage("sidebar-collapsed", false);
|
||||
const isMobile = useIsMobile();
|
||||
|
||||
if (isMobile) {
|
||||
|
||||
Reference in New Issue
Block a user