Skip to content

Commit

Permalink
fix: #5
Browse files Browse the repository at this point in the history
  • Loading branch information
reyzitwo committed Jun 20, 2023
1 parent b5e42dd commit c3a6bce
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/hooks/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
RouterViewI,
RouterPopoutI,
RouterModalI,
RouterHooksI,
} from "./interfaces";

export const useRouterView = (): RouterViewI => {
Expand Down Expand Up @@ -90,3 +91,13 @@ export const useRouterModal = (): RouterModalI => {

return <RouterModalI>{ activeModal, toModal };
};

export const useRouterHooks = (): RouterHooksI => {
const { toView } = useRouterView();
const { toPanel } = useRouterPanel();
const { toPopout } = useRouterPopout();
const { toModal } = useRouterModal();
const toBack = useRouterBack();

return { toView, toPanel, toPopout, toModal, toBack };
};
8 changes: 8 additions & 0 deletions src/hooks/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,11 @@ export interface RouterModalI {
value: string | number;
};
}

export interface RouterHooksI {
toView: RouterViewI["toView"];
toPanel: RouterPanelI["toPanel"];
toPopout: RouterPopoutI["toPopout"];
toModal: RouterModalI["toModal"];
toBack: (step: number | string) => RouterBackI;
}

0 comments on commit c3a6bce

Please sign in to comment.