MCPcopy
hub / github.com/subnub/myDrive / useUtils

Function useUtils

src/hooks/utils.ts:4–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2import { useLocation } from "react-router-dom";
3
4export const useUtils = () => {
5 const location = useLocation();
6
7 const isHome = location.pathname === "/home";
8
9 const isTrash =
10 location.pathname === "/trash" ||
11 location.pathname.includes("/folder-trash") ||
12 location.pathname.includes("/search-trash");
13
14 const isMedia =
15 location.pathname === "/media" ||
16 location.pathname.includes("/search-media");
17
18 const isSettings = location.pathname === "/settings";
19
20 const isHomeFolder = location.pathname.includes("/folder/");
21
22 const isSearch = location.pathname.includes("/search/");
23
24 return { isHome, isTrash, isMedia, isSettings, isHomeFolder, isSearch };
25};
26
27export const useClickOutOfBounds = (
28 outOfBoundsCallback: (e: any) => any,

Callers 15

MainSection.tsxFile · 0.90
MultiSelectBarFunction · 0.90
LeftSectionFunction · 0.90
Folders.tsxFile · 0.90
FolderItem.tsxFile · 0.90
Dataform.tsxFile · 0.90
SearchBar.tsxFile · 0.90
ParentBar.tsxFile · 0.90
Files.tsxFile · 0.90
HeaderFunction · 0.90
QuickAccess.tsxFile · 0.90
ContextMenu.tsxFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected