NavigationPanel.hooks.ts 481 B

12345678910111213141516171819202122
  1. import { useAppSelector } from '$app/stores/store';
  2. import { useState } from 'react';
  3. export const useNavigationPanelHooks = function () {
  4. const width = useAppSelector((state) => state.navigationWidth);
  5. const [menuHidden, setMenuHidden] = useState(false);
  6. const onHideMenuClick = () => {
  7. setMenuHidden(true);
  8. };
  9. const onShowMenuClick = () => {
  10. setMenuHidden(false);
  11. };
  12. return {
  13. width,
  14. menuHidden,
  15. onHideMenuClick,
  16. onShowMenuClick,
  17. };
  18. };