diff --git a/tavla/src/Shared/hooks/useHash.ts b/tavla/src/Shared/hooks/useHash.ts deleted file mode 100644 index 924c4b818..000000000 --- a/tavla/src/Shared/hooks/useHash.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { useRouter } from 'next/router' - -function useHashState(id: string) { - const router = useRouter() - const hash = router.asPath.split('#')[1] ?? '' - const isOpen = hash === id - const open = () => { - router.push({ - query: { ...router.query }, - pathname: router.pathname, - hash: id, - }) - } - const close = () => { - router.push({ - query: { ...router.query }, - pathname: router.pathname, - hash: '', - }) - } - return { isOpen, open, close } -} - -export { useHashState } diff --git a/tavla/src/Shared/hooks/useToggle.ts b/tavla/src/Shared/hooks/useToggle.ts deleted file mode 100644 index dc6e9edbb..000000000 --- a/tavla/src/Shared/hooks/useToggle.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { useState } from 'react' - -function useToggle() { - const [isEnabled, setIsEnabled] = useState(false) - - const enable = () => setIsEnabled(true) - - const disable = () => setIsEnabled(false) - - return [isEnabled, enable, disable] as const -} - -export { useToggle } diff --git a/tavla/src/Shared/hooks/useUpdateLastActive.ts b/tavla/src/Shared/hooks/useUpdateLastActive.ts deleted file mode 100644 index 4a1ab71b1..000000000 --- a/tavla/src/Shared/hooks/useUpdateLastActive.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { useCallback, useEffect } from 'react' -import { TBoardID } from 'types/settings' - -function useUpdateLastActive(documentId: TBoardID | undefined) { - const updateLastActive = useCallback(async () => { - await fetch(`/api/ping/${documentId}`, { - method: 'POST', - }) - }, [documentId]) - - useEffect(() => { - updateLastActive() - const intervalId = setInterval(updateLastActive, 1000 * 60 * 60 * 24) - return () => { - clearInterval(intervalId) - } - }, [updateLastActive]) -} - -export { useUpdateLastActive }