a tool for shared writing and social publishing
0
fork

Configure Feed

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

don't focus card onclick on mobile

+4 -1
+4 -1
components/Cards.tsx
··· 23 23 import { useSearchParams } from "next/navigation"; 24 24 import { useEffect } from "react"; 25 25 import { DraftPostOptions } from "./Blocks/MailboxBlock"; 26 + import { useIsMobile } from "src/hooks/isMobile"; 26 27 27 28 export function Cards(props: { rootCard: string }) { 28 29 let openCards = useUIState((s) => s.openCards); ··· 98 99 ? focusedElement.entityID 99 100 : focusedElement?.parent; 100 101 let isFocused = focusedCardID === props.entityID; 102 + let isMobile = useIsMobile(); 101 103 102 104 return ( 103 105 <> ··· 113 115 <div 114 116 onMouseDown={(e) => { 115 117 if (e.defaultPrevented) return; 118 + if (!isMobile) return; 116 119 if (rep) { 117 120 focusCard(props.entityID, rep); 118 121 } ··· 241 244 export async function focusCard( 242 245 cardID: string, 243 246 rep: Replicache<ReplicacheMutators>, 244 - focusFirstBlock?: "focusFirstBlock", 247 + focusFirstBlock?: "focusFirstBlock" 245 248 ) { 246 249 // if this card is already focused, 247 250 let focusedBlock = useUIState.getState().focusedBlock;