Refactor New Ui Semua Pengaturan

This commit is contained in:
2026-03-25 14:38:37 +08:00
parent 1ba4643e23
commit 687ce11a81
6 changed files with 203 additions and 300 deletions

View File

@@ -1,16 +1,26 @@
import { useDisclosure } from "@mantine/hooks";
import { useState } from "react";
export function useSidebarFullscreen() {
const [opened, { toggle: toggleMobile }] = useDisclosure();
const [sidebarCollapsed, setSidebarCollapsed] = useDisclosure(false);
const [clickCount, setClickCount] = useState(0);
const toggleSidebar = () => {
setSidebarCollapsed.toggle();
setClickCount(0);
};
const handleMainClick = () => {
if (!sidebarCollapsed) {
toggleSidebar();
const newCount = clickCount + 1;
setClickCount(newCount);
if (newCount === 2) {
toggleSidebar();
} else {
setTimeout(() => setClickCount(0), 300);
}
}
};