Skip to content

Commit 99da5a1

Browse files
feat: add nav hooks
1 parent 5363fae commit 99da5a1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/hooks.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
import { useLocation } from 'react-router-dom';
2+
13
export const nullMethod = () => ({});
24

5+
export const useActiveView = () => useLocation().pathname.split('/')[1];
6+
export const useIsEmbedded = () => useLocation().pathname.split('/')[2] === 'embedded';
7+
38
export default {
49
nullMethod,
510
};

0 commit comments

Comments
 (0)