This commit is contained in:
parent
6f7b821c8b
commit
3a5b0bdcbc
162 changed files with 15801 additions and 224 deletions
16
FRONT/DEV/src/hooks/useToolBar.ts
Normal file
16
FRONT/DEV/src/hooks/useToolBar.ts
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import { useToolBarStore } from "../store";
|
||||
|
||||
export const useToolBar = (menuId: string) => {
|
||||
const { toolBar, toggleMenu } = useToolBarStore();
|
||||
|
||||
const menu = toolBar.toolSpace.find((m) => m.id === menuId);
|
||||
|
||||
const isOpen = menu ? menu.isOpen : false;
|
||||
const isActive = menu ? menu.isActive : false;
|
||||
|
||||
const collapseMenu = () => {
|
||||
toggleMenu(menuId);
|
||||
};
|
||||
|
||||
return { isOpen, isActive, collapseMenu };
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue