diff --git a/src/components/emoji-graphic.tsx b/src/components/emoji-graphic.tsx deleted file mode 100644 index 541920307..000000000 --- a/src/components/emoji-graphic.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import React from 'react'; - -import Emoji from 'soapbox/components/ui/emoji/emoji'; - -interface IEmojiGraphic { - emoji: string; -} - -/** Large emoji with a background for display purposes (eg breaking up a page). */ -const EmojiGraphic: React.FC = ({ emoji }) => { - return ( -
-
- -
-
- ); -}; - -export default EmojiGraphic; \ No newline at end of file diff --git a/src/hooks/index.ts b/src/hooks/index.ts index 8d3b7a510..77a826fe8 100644 --- a/src/hooks/index.ts +++ b/src/hooks/index.ts @@ -1,7 +1,6 @@ export { useApi } from './useApi'; export { useAppDispatch } from './useAppDispatch'; export { useAppSelector } from './useAppSelector'; -export { useBackend } from './useBackend'; export { useClickOutside } from './useClickOutside'; export { useCompose } from './useCompose'; export { useDebounce } from './useDebounce'; @@ -13,10 +12,8 @@ export { useInstance } from './useInstance'; export { useLoading } from './useLoading'; export { useLocale } from './useLocale'; export { useLoggedIn } from './useLoggedIn'; -export { useOnScreen } from './useOnScreen'; export { useOwnAccount } from './useOwnAccount'; export { usePrevious } from './usePrevious'; -export { useRefEventHandler } from './useRefEventHandler'; export { useRegistrationStatus } from './useRegistrationStatus'; export { useSettings } from './useSettings'; export { useSoapboxConfig } from './useSoapboxConfig'; diff --git a/src/hooks/useBackend.ts b/src/hooks/useBackend.ts deleted file mode 100644 index a511abb2a..000000000 --- a/src/hooks/useBackend.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { parseVersion } from 'soapbox/utils/features'; - -import { useInstance } from './useInstance'; - -/** - * Get the Backend version. - * - * @returns Backend - */ -const useBackend = () => { - const instance = useInstance(); - - return parseVersion(instance.version); -}; - -export { useBackend }; \ No newline at end of file diff --git a/src/hooks/useForceUpdate.ts b/src/hooks/useForceUpdate.ts deleted file mode 100644 index 50a84a468..000000000 --- a/src/hooks/useForceUpdate.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { useState, useCallback } from 'react'; - -export function useForceUpdate(): () => void { - const [, setState] = useState(false); - - const forceUpdate = useCallback(() => { - setState(prevState => !prevState); - }, []); - - return forceUpdate; -} diff --git a/src/hooks/useOnScreen.ts b/src/hooks/useOnScreen.ts deleted file mode 100644 index de9aa23b2..000000000 --- a/src/hooks/useOnScreen.ts +++ /dev/null @@ -1,25 +0,0 @@ -import React, { useEffect, useMemo, useState } from 'react'; - -/** Detect whether a given element is on the screen. */ -// https://stackoverflow.com/a/64892655 -export const useOnScreen = (ref: React.RefObject) => { - const [isIntersecting, setIntersecting] = useState(false); - - const observer = useMemo(() => { - return new IntersectionObserver( - ([entry]) => setIntersecting(entry.isIntersecting), - ); - }, []); - - useEffect(() => { - if (ref.current) { - observer.observe(ref.current); - } - - return () => { - observer.disconnect(); - }; - }, [ref.current]); - - return isIntersecting; -}; diff --git a/src/hooks/useRefEventHandler.ts b/src/hooks/useRefEventHandler.ts deleted file mode 100644 index 503a126e5..000000000 --- a/src/hooks/useRefEventHandler.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { useRef } from 'react'; - -/** Hook that allows using useState values in event handlers. */ -// https://stackoverflow.com/a/64770671/8811886 -export const useRefEventHandler = (fn: (...params: any) => void) => { - const ref = useRef(fn); - ref.current = fn; - return ref; -};