()
| 2 | import { useLocation } from "react-router-dom"; |
| 3 | |
| 4 | export 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 | |
| 27 | export const useClickOutOfBounds = ( |
| 28 | outOfBoundsCallback: (e: any) => any, |
no outgoing calls
no test coverage detected