a tool for shared writing and social publishing
0
fork

Configure Feed

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

clicking to the side of a block now focuses it

celine 41aecfff 318fb7e7

+3 -3
+2 -2
components/Blocks/Block.tsx
··· 52 52 let mouseHandlers = useBlockMouseHandlers(props); 53 53 54 54 // focus block on longpress, shouldnt the type be based on the block type (?) 55 - let { isLongPress, handlers } = useLongPress(() => { 55 + let { isLongPress, handlers: longPressHandlers } = useLongPress(() => { 56 56 if (isLongPress.current) { 57 57 focusBlock( 58 58 { type: props.type, value: props.entityID, parent: props.parent }, ··· 77 77 78 78 return ( 79 79 <div 80 - {...(!props.preview ? { ...mouseHandlers, ...handlers } : {})} 80 + {...(!props.preview ? { ...mouseHandlers, ...longPressHandlers } : {})} 81 81 className={` 82 82 blockWrapper relative 83 83 flex flex-row gap-2
+1 -1
components/Blocks/useBlockMouseHandlers.ts
··· 6 6 import { useEntitySetContext } from "components/EntitySetProvider"; 7 7 import { useReplicache } from "src/replicache"; 8 8 import { getBlocksWithType } from "src/hooks/queries/useBlocks"; 9 + import { focusBlock } from "src/utils/focusBlock"; 9 10 10 11 let debounce: number | null = null; 11 12 export function useBlockMouseHandlers(props: Block) { ··· 24 25 e.preventDefault(); 25 26 useUIState.getState().addBlockToSelection(props); 26 27 } else { 27 - if (!isTextBlock[props.type]) return; 28 28 useUIState.getState().setFocusedBlock({ 29 29 entityType: "block", 30 30 entityID: props.value,