This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

chore: remove (now unsupported) web-haptics triggers

+1 -21
-3
src/webapp/components/navigation/bottomBarItem/BottomBarItem.tsx
··· 6 6 import { ReactElement, isValidElement } from 'react'; 7 7 import { usePathname } from 'next/navigation'; 8 8 import { useNavbarContext } from '@/providers/navbar'; 9 - import { useWebHaptics } from 'web-haptics/react'; 10 9 11 10 interface Props { 12 11 href: string; ··· 18 17 const pathname = usePathname(); 19 18 const isActive = pathname === props.href; 20 19 const { toggleMobile, mobileOpened } = useNavbarContext(); 21 - const { trigger } = useWebHaptics(); 22 20 23 21 const renderIcon = () => { 24 22 // If the icon is already a React element, just return it ··· 34 32 href={props.href} 35 33 underline="never" 36 34 onClick={() => { 37 - trigger(); 38 35 if (mobileOpened) { 39 36 toggleMobile(); 40 37 }
-3
src/webapp/components/navigation/refetchButton/RefetchButton.tsx
··· 2 2 3 3 import { ActionIcon } from '@mantine/core'; 4 4 import { useWindowScroll, useDebouncedCallback } from '@mantine/hooks'; 5 - import { useWebHaptics } from 'web-haptics/react'; 6 5 import { LuRefreshCcw } from 'react-icons/lu'; 7 6 8 7 interface Props { ··· 10 9 } 11 10 12 11 export default function RefetchButton(props: Props) { 13 - const { trigger } = useWebHaptics(); 14 12 const [_scroll, scrollTo] = useWindowScroll(); 15 13 const DEBOUNCE_MS = 500; 16 14 ··· 26 24 variant="default" 27 25 c="gray" 28 26 onClick={() => { 29 - trigger(); 30 27 debouncedRefetch(); 31 28 scrollTo({ y: 0 }); 32 29 }}
-5
src/webapp/features/cards/components/urlCardActions/UrlCardActions.tsx
··· 32 32 import { TbPlugConnected } from 'react-icons/tb'; 33 33 import AddConnectionModal from '@/features/connections/components/addConnectionModal/AddConnectionModal'; 34 34 import { AiOutlineDisconnect } from 'react-icons/ai'; 35 - import { useWebHaptics } from 'web-haptics/react'; 36 35 37 36 interface Props { 38 37 id: string; ··· 84 83 const [showAddToModal, setShowAddToModal] = useState(false); 85 84 const [showAddConnectionModal, setShowAddConnectionModal] = useState(false); 86 85 87 - const { trigger } = useWebHaptics(); 88 86 const router = useRouter(); 89 87 90 88 return ( ··· 123 121 router.push('/login'); 124 122 return; 125 123 } 126 - trigger(); 127 124 setShowAddToModal(true); 128 125 }} 129 126 > ··· 154 151 router.push('/login'); 155 152 return; 156 153 } 157 - trigger(); 158 154 setShowAddConnectionModal(true); 159 155 }} 160 156 > ··· 242 238 } 243 239 onClick={(e) => { 244 240 e.stopPropagation(); 245 - trigger(); 246 241 props.onTogglePinInCollection?.(); 247 242 }} 248 243 >
+1 -4
src/webapp/features/collections/components/collectionActions/CollectionActions.tsx
··· 11 11 import AddCardToModal from '@/features/cards/components/addCardToModal/AddCardToModal'; 12 12 import { notifications } from '@mantine/notifications'; 13 13 import FollowButton from '@/features/follows/components/followButton/FollowButton'; 14 - import { useWebHaptics } from 'web-haptics/react'; 15 14 import useGetCardFromMyLibrary from '@/features/cards/lib/queries/useGetCardFromMyLibrary'; 16 15 import useSembleLibraries from '@/features/semble/lib/queries/useSembleLibraries'; 17 16 import { IoMdCheckmark } from 'react-icons/io'; ··· 30 29 const [showAddDrawer, setShowAddDrawer] = useState(false); 31 30 const [showSaveToLibraryModal, setShowSaveToLibraryModal] = useState(false); 32 31 const [showAddConnectionModal, setShowAddConnectionModal] = useState(false); 33 - const { trigger } = useWebHaptics(); 34 32 35 33 const isAuthor = user?.handle === collection.author?.handle; 36 34 const canAddCard = ··· 52 50 <Fragment> 53 51 <Menu shadow="sm"> 54 52 <Menu.Target> 55 - <ActionIcon size="lg" radius={'xl'} onClick={() => trigger()}> 53 + <ActionIcon size="lg" radius={'xl'}> 56 54 <FiPlus size={18} /> 57 55 </ActionIcon> 58 56 </Menu.Target> ··· 80 78 size="lg" 81 79 radius={'xl'} 82 80 onClick={() => { 83 - trigger(); 84 81 setShowAddConnectionModal(true); 85 82 }} 86 83 >
-3
src/webapp/features/composer/components/composerDrawer/ComposerDrawer.tsx
··· 7 7 import { useNavbarContext } from '@/providers/navbar'; 8 8 import { useSearchParams } from 'next/navigation'; 9 9 import Composer from '../Composer'; 10 - import { useWebHaptics } from 'web-haptics/react'; 11 10 12 11 export default function ComposerDrawer() { 13 12 const { mobileOpened, desktopOpened } = useNavbarContext(); ··· 15 14 const isNavOpen = isDesktop ? desktopOpened : mobileOpened; 16 15 const shouldShowFab = !isNavOpen; 17 16 const [opened, setOpened] = useState(false); 18 - const { trigger } = useWebHaptics(); 19 17 20 18 // share_target support. on android could be any of these. 21 19 const shareUrl = useSearchParams().get('addUrl'); ··· 43 41 radius="xl" 44 42 variant="filled" 45 43 onClick={() => { 46 - trigger(); 47 44 setOpened((prev) => !prev); 48 45 }} 49 46 >
-3
src/webapp/features/follows/components/followButton/FollowButton.tsx
··· 3 3 import { Button, ButtonProps } from '@mantine/core'; 4 4 import { startTransition } from 'react'; 5 5 import { useToggleFollow } from '../../lib/mutations/useToggleFollow'; 6 - import { useWebHaptics } from 'web-haptics/react'; 7 6 8 7 interface Props 9 8 extends Omit<ButtonProps, 'onClick' | 'variant' | 'color' | 'children'> { ··· 24 23 }: Props) { 25 24 const { isFollowing, toggleAction, setOptimisticIsFollowing } = 26 25 useToggleFollow(initialIsFollowing ?? false); 27 - const { trigger } = useWebHaptics(); 28 26 29 27 return ( 30 28 <Button ··· 32 30 color={isFollowing ? 'gray' : 'dark'} 33 31 {...buttonProps} 34 32 onClick={() => { 35 - trigger(); 36 33 startTransition(() => { 37 34 setOptimisticIsFollowing(!isFollowing); 38 35 toggleAction({ targetId, targetType });